public function getProjectConfig($projectRoot = null)
    {
        $projectRoot = $projectRoot ?: $this->getProjectRoot();
        if (isset(self::$projectConfigs[$projectRoot])) {
            return self::$projectConfigs[$projectRoot];
        }
        $projectConfig = null;
        $configFilename = $this->config->get('local.project_config');
        if ($projectRoot && file_exists($projectRoot . '/' . $configFilename)) {
            $yaml = new Parser();
            $projectConfig = $yaml->parse(file_get_contents($projectRoot . '/' . $configFilename));
            self::$projectConfigs[$projectRoot] = $projectConfig;
        } elseif ($projectRoot && is_dir($projectRoot . '/.git')) {
            $gitUrl = $this->getGitRemoteUrl($projectRoot);
            if ($gitUrl && ($projectConfig = $this->parseGitUrl($gitUrl))) {
                $this->writeCurrentProjectConfig($projectConfig, $projectRoot);
            }
        }

        return $projectConfig;
    }
public function getProjectConfig($projectRoot = null)
    {
        $projectRoot = $projectRoot ?: $this->getProjectRoot();
        if (isset(self::$projectConfigs[$projectRoot])) {
            return self::$projectConfigs[$projectRoot];
        }
        $projectConfig = null;
        $configFilename = $this->config->get('local.project_config');
        if ($projectRoot && file_exists($projectRoot . '/' . $configFilename)) {
            $yaml = new Parser();
            $projectConfig = $yaml->parse(file_get_contents($projectRoot . '/' . $configFilename));
            self::$projectConfigs[$projectRoot] = $projectConfig;
        } elseif ($projectRoot && is_dir($projectRoot . '/.git')) {
            $gitUrl = $this->getGitRemoteUrl($projectRoot);
            if ($gitUrl && ($projectConfig = $this->parseGitUrl($gitUrl))) {
                $this->writeCurrentProjectConfig($projectConfig, $projectRoot);
            }
        }

        return $projectConfig;
    }
public function getProjectConfig ( $ projectRoot = null ) { $ projectRoot = $ projectRoot ? : $ this -> getProjectRoot ( ) ; if ( isset ( self :: $ projectConfigs [ $ projectRoot ] ) ) { return self :: $ projectConfigs [ $ projectRoot ] ; } $ projectConfig = null ; $ configFilename = $ this -> config -> get ( 'local.project_config' ) ; if ( $ projectRoot && file_exists ( $ projectRoot . '/' . $ configFilename ) ) { $ yaml = new Parser ( ) ; $ projectConfig = $ yaml -> parse ( file_get_contents ( $ projectRoot . '/' . $ configFilename ) ) ; self :: $ projectConfigs [ $ projectRoot ] = $ projectConfig ; } elseif ( $ projectRoot && is_dir ( $ projectRoot . '/.git' ) ) { $ gitUrl = $ this -> getGitRemoteUrl ( $ projectRoot ) ; if ( $ gitUrl && ( $ projectConfig = $ this -> parseGitUrl ( $ gitUrl ) ) ) { $ this -> writeCurrentProjectConfig ( $ projectConfig , $ projectRoot ) ; } } return $ projectConfig ; }
Get the configuration for the current project.

@param string|null $projectRoot

@return array|null
The current project's configuration.
Get the configuration for the current project .