public function mapDirectory($directory, Project $project)
    {
        if (!file_exists($directory . '/.git')) {
            throw new \InvalidArgumentException('Not a Git repository: ' . $directory);
        }
        $projectConfig = [
            'id' => $project->id,
        ];
        if ($host = parse_url($project->getUri(), PHP_URL_HOST)) {
            $projectConfig['host'] = $host;
        }
        $this->writeCurrentProjectConfig($projectConfig, $directory, true);
        $this->ensureGitRemote($directory, $project->getGitUrl());
    }
public function mapDirectory($directory, Project $project)
    {
        if (!file_exists($directory . '/.git')) {
            throw new \InvalidArgumentException('Not a Git repository: ' . $directory);
        }
        $projectConfig = [
            'id' => $project->id,
        ];
        if ($host = parse_url($project->getUri(), PHP_URL_HOST)) {
            $projectConfig['host'] = $host;
        }
        $this->writeCurrentProjectConfig($projectConfig, $directory, true);
        $this->ensureGitRemote($directory, $project->getGitUrl());
    }
public function mapDirectory ( $ directory , Project $ project ) { if ( ! file_exists ( $ directory . '/.git' ) ) { throw new \ InvalidArgumentException ( 'Not a Git repository: ' . $ directory ) ; } $ projectConfig = [ 'id' => $ project -> id , ] ; if ( $ host = parse_url ( $ project -> getUri ( ) , PHP_URL_HOST ) ) { $ projectConfig [ 'host' ] = $ host ; } $ this -> writeCurrentProjectConfig ( $ projectConfig , $ directory , true ) ; $ this -> ensureGitRemote ( $ directory , $ project -> getGitUrl ( ) ) ; }
Initialize a directory as a project root.

@param string $directory
The Git repository that should be initialized.
@param Project $project
The project.
Initialize a directory as a project root .