Get the .env file path.

@return string
337537
protected function envPath()
    {
        if (method_exists($this->laravel, 'environmentFilePath')) {
            return $this->laravel->environmentFilePath();
        }

        // check if laravel version Less than 5.4.17
        if (version_compare($this->laravel->version(), '5.4.17', '<')) {
            return $this->laravel->basePath().DIRECTORY_SEPARATOR.'.env';
        }

        return $this->laravel->basePath('.env');
    }
20792
protected function getFilePath()
    {
        $fullName = $this->fullName;

        $rootPath = public_path();

        $fullName = ltrim($fullName, '/');


        return $rootPath . '/' . $fullName;
    }
1266770
public function getCachePath() {
        $cachePath= false;
        if (!isset ($this->xpdo->config['cache_path'])) {
            while (true) {
                if (!empty ($_ENV['TMP'])) {
                    if ($cachePath= strtr($_ENV['TMP'], '\\', '/'))
                        break;
                }
                if (!empty ($_ENV['TMPDIR'])) {
                    if ($cachePath= strtr($_ENV['TMPDIR'], '\\', '/'))
                        break;
                }
                if (!empty ($_ENV['TEMP'])) {
                    if ($cachePath= strtr($_ENV['TEMP'], '\\', '/'))
                        break;
                }
                if ($temp_file= @ tempnam(md5(uniqid(rand(), true)), '')) {
                    $cachePath= strtr(dirname($temp_file), '\\', '/');
                    @ unlink($temp_file);
                }
                break;
            }
            if ($cachePath) {
                if ($cachePath{strlen($cachePath) - 1} != '/') $cachePath .= '/';
                $cachePath .= '.xpdo-cache';
            }
        }
        else {
            $cachePath= strtr($this->xpdo->config['cache_path'], '\\', '/');
        }
        if ($cachePath) {
            $perms = $this->getOption('new_folder_permissions', null, $this->getFolderPermissions());
            if (is_string($perms)) $perms = octdec($perms);
            if (@ $this->writeTree($cachePath, $perms)) {
                if ($cachePath{strlen($cachePath) - 1} != '/') $cachePath .= '/';
                if (!is_writeable($cachePath)) {
                    @ chmod($cachePath, $perms);
                }
            } else {
                $cachePath= false;
            }
        }
        return $cachePath;
    }
1240081
public static function env()
    {
        return function () {
            // Use credentials from environment variables, if available
            $enabled = getenv(self::ENV_ENABLED);
            if ($enabled !== false) {
                return Promise\promise_for(
                    new Configuration(
                        $enabled,
                        getenv(self::ENV_PORT) ?: self::DEFAULT_PORT,
                        getenv(self:: ENV_CLIENT_ID) ?: self::DEFAULT_CLIENT_ID
                     )
                );
            }

            return self::reject('Could not find environment variable CSM config'
                . ' in ' . self::ENV_ENABLED. '/' . self::ENV_PORT . '/'
                . self::ENV_CLIENT_ID);
        };
    }
1097763
public function getEnvironment()
    {
        $fileSystem = new Filesystem();
        $environment = '';
        $environmentPath = app()->getBasePath().'/.env';
        if ($fileSystem->isFile($environmentPath)) {
            $environment = trim($fileSystem->get($environmentPath));
            $envFile = app()->getBasePath().'/.'.$environment;

            if ($fileSystem->isFile($envFile.'.env')) {
                $dotEnv = new Dotenv(app()->getBasePath().'/', '.'.$environment.'.env');
                $dotEnv->load();
            }
        }

        return $environment;
    }
67243
public function getConfigPath()
    {
        if (null == $this->configPath) {
            $this->configPath = getcwd().'/Configuration';
            Configuration::addPath($this->configPath);
        }
        return $this->configPath;
    }
1073313
public function getPath()
	{
		$realpath	= realpath( $this->fileName );
		$path	= dirname( $realpath );
		$path	= str_replace( "\\", "/", $path );
		$path	.= "/";
		return	$path;
	}
759116
public function path(): string
    {
        $path = $this->uri()->getPath();

        if (empty($path)) {
            return '/';
        } elseif ($path[0] !== '/') {
            return '/' . $path;
        }

        return $path;
    }
825132
private function _get_path()
    {

        if (empty($this->file) && is_string($this->file)) return false;

        if (strpos($this->file, '/') !== false) {
            $path = explode('/', $this->file);
            array_pop($path);
            $this->path = (string)implode('/', $path) . '/';
        } elseif (strpos('\\', $this->file) !== false) {
            $path = explode('\\', $this->file);
            array_pop($path);
            $this->path = (string)implode('\\', $path) . '\\';
        } else {
            $this->path = getcwd() . '/';
        }

        return true;
    }
826235
public static function getEnv()
    {   
        if (null !== (getenv('P_DRIVER'))) {

            $dotEnv = new Dotenv($_SERVER['DOCUMENT_ROOT']);
            $dotEnv->load();
        }    
      
        self::$driver  = getenv('P_DRIVER');
        self::$host    = getenv('P_HOST');
        self::$dbname  = getenv('P_DBNAME');
        self::$user    = getenv('P_USER');
        self::$pass    = getenv('P_PASS');  
    }
802617
public function getCurrentEnv():string
    {
        $f = new JsonListener();
        $result = $f->open(
            realpath(__DIR__."/../../../../../../../elements/config_files/core/framework.config.json")
        );
        return ($result->default_env);
    }
617408
public function getFilePath()
    {
        // Generate filename with extension
        $path = $this->fileName . '.' . strtolower($this->fileExtension);

        // Prepend folder if present
        if ($this->hasFolder()) {
            $path = $this->folder.DIRECTORY_SEPARATOR.$path;
        }

        return $path;
    }
611256
protected function _getFilePath()
    {
        $opt_directory = $this->getDirPath();
        $file = $opt_directory . DIRECTORY_SEPARATOR . $this->getRealm() . '.array.php';

        return $file;
    }
396067
public function getPackagePath()
    {
        $packageHandle = $this->getPackageHandle();
        $result = $this->DIR_PACKAGES . '/' . $packageHandle;
        if (!is_dir($result)) {
            $result = $this->DIR_PACKAGES_CORE . '/' . $packageHandle;
        }

        return $result;
    }
724652
protected function generateEnv()
    {
        $env = null;

        // Get the existing .env file contents to replace
        $envPath = $this->laravel->environmentFilePath();

        if (! file_exists($envPath)) {
            // Create the .env file from the example file
            copy($envPath.'.example', $envPath);
            $this->callSilent('key:generate', ['--force' => true]);
        }

        $env = file_get_contents($envPath);

        // Loop over all of the keys we can set and replace the values that are set
        foreach ($this->keys as $key => $var) {
            // Skip if it's not set
            if (! isset($this->$var)) {
                continue;
            }

            $env = preg_replace(
                $this->keyReplacementPattern($key),
                $key.'='.(is_string($this->$var) ? '"'.$this->$var.'"' : $this->$var),
                $env,
                1
            );
        }

        return $env;
    }
238872
protected function getDataDirectoryPath() {
    $data_dir = $this->getEnvironment()->getDataDirectory();
    $config = $this->getConfiguration();
    return str_replace('{branch}', $config->getBranch(), $data_dir);
  }
1226324
protected function getKeyFile()
	{
		$env = $this->option('env') ? $this->option('env').'/' : '';

		$contents = $this->files->get($path = $this->flyphp['path']."/config/{$env}app.php");

		return array($path, $contents);
	}