Get the package path for an environment and group.

@param  string  $env
@param  string  $package
@param  string  $group

@return string
188872
protected function getPackagePath(string $env, string $package, string $group): string
    {
        $file = "packages/{$package}/{$env}/{$group}.php";

        return $this->defaultPath.'/'.$file;
    }
1326639
public function getInstallPath(PackageInterface $package)
    {
        $textpattern = new Textpattern();
        $path = $textpattern->getRelativePath();
        $themes = $path . '/admin-themes';

        // Textpattern <= 4.5.x uses 'theme' directory.
        if (!file_exists($themes)) {
            $themes = $path . '/theme';
        }

        return $themes . '/' . basename($package->getPrettyName());
    }
581427
public static function getEvnironment($env)
    {
        // 获得全部环境描述
        $allEnv = static::environmentName();

        if ( $allEnv && array_key_exists($env, $allEnv)) {
            return $allEnv[$env];
        }

        // 否则返回第一个
        return array_pop($allEnv);
    }
8191
public function saveConfig($group, $environment = '')
    {
        // Path do arquivo
        $path = config_path();

        // Itens
        $items = config($group, []);

        // Nome do arquivo
        $file = (! $environment || ($environment == 'production'))
            ? "{$path}/{$group}.php"
            : "{$path}/{$environment}/{$group}.php";

        // Salvar arquivo
        $code = '<?php' . "\r\n\r\n";
        $code .= 'return ' . var_export($items, true) . ';';
        $this->put($file, $code);
    }
1059315
public function get($key, $default = null, $package = null)
    {
        if ($package) {
            return $this->getForPackage($package, $key, $default);
        }
        return Arr::get($this->mainConfiguration, $key, $default);

    }
140763
def get_env_path(cls):
        
        return os.path.dirname(Finder.python()) + os.pathsep + os.environ['PATH']
932108
public static function selectEnvironment($env = null) 
    {
        if (strlen($env) < 1) {
            $getenv = self::_getEnvironment();
            if (strlen($getenv) > 0) {
                $env = $getenv;
            } else {
                $env = "development";
            }
        }
        return $env;
    }
1102700
private function getDefinition($env, $key)
	{
		return isset($this->definitions[$env][$key])
			? $this->definitions[$env][$key]
			: null;
	}
953992
public function getPackageJsonFile($package)
    {
        // We get the project vendor path
        $vendorPath = $this->getVendorPath();
        // We get the target dir of the iterated package
        $targetDir = $package->getTarget();
        $jsonPath = $vendorPath . $targetDir . "/composer.json";
        if (method_exists($package, 'getJsonFile')) {
            $jsonFile = $package->getJsonFile($jsonPath);
        } else {
            // @codeCoverageIgnoreStart
            $jsonFile = new JsonFile($jsonPath);
            // @codeCoverageIgnoreEnd
        }

        return $this->fs->exists($jsonPath) ? $jsonFile->read() : null;
    }
907055
private String getGroupIdFromName(PhpPackage phpPackage) {
        String groupId = null;
        if (StringUtils.isNotBlank(phpPackage.getName())) {
            String packageName = phpPackage.getName();
            String[] gavCoordinates = packageName.split(FORWARD_SLASH);
            groupId = gavCoordinates[0];
        }
        return groupId;
    }
80919
private function getGroupPath() : string
    {
        $path = '';

        foreach ($this->groupOptionsStack as $groupOptions) {
            if (isset($groupOptions['path'])) {
                $path .= $groupOptions['path'];
            }
        }

        return $path;
    }
795321
protected function getPackageInfo($package) {
		
		$org  = "";
		$repo = "";
		$tag  = "master";
		
		if (strpos($package, "#") !== false) {
			list($package,$tag) = explode("#",$package);
		}
		
		if (strpos($package, "/") !== false) {
			list($org,$repo) = explode("/",$package);
		} else {
			Console::writeError("please provide a real path to a package...");
		}
		
		return array($org,$repo,$tag);
		
	}
1105723
public function getInstallPath(PackageInterface $package)
	{
		$prefix = mb_substr($package->getPrettyName(), 0, 23);
		if ('myadmin/template-' !== $prefix) {
			throw new \InvalidArgumentException(
				'Unable to install template, myadmin templates '
				.'should always start their package name with '
				.'"myadmin/template-"'
			);
		}
		return 'data/templates/'.mb_substr($package->getPrettyName(), 23);
	}
1130722
protected function readVersionFromLocation(string $location, string $package) : ?string
    {
        // Get the installed packages
        $installed = $this->getInstalledPackages($location);
        if(empty($installed)){
            return null;
        }

        // Search for package
        foreach ($installed as $installedPackage){
            $version = $this->readFromSource($installedPackage, $package);
            if(isset($version)){
                return $version;
            }
        }

        // Nothing found in this package
        return null;
    }
944136
def get_package_install_path(self, path):
        
        from rez.package_repository import package_repository_manager

        pkg_repo = package_repository_manager.get_repository(path)

        return pkg_repo.get_package_payload_path(
            package_name=self.package.name,
            package_version=self.package.version
        )
933447
protected static function pathsForProviderOrGroup($provider, $group)
    {
        if ($provider && $group) {
            return static::pathsForProviderAndGroup($provider, $group);
        } elseif ($group && array_key_exists($group, static::$publishGroups)) {
            return static::$publishGroups[$group];
        } elseif ($provider && array_key_exists($provider, static::$publishes)) {
            return static::$publishes[$provider];
        } elseif ($group || $provider) {
            return [];
        }
    }
1167276
public function getLoaderFilePackagePath(PackageInterface $package)
    {
        $installPath = $this->getInstallPath($package);

        if ($installPath === false) {
            return false;
        }

        $config      = $this->getInstallerConfig($package);
        $packagePath = $installPath . $config['loader'];

        return $packagePath;
    }