Knp\Bundle\KnpBundlesBundle\Git\RepoManager::getRepo PHP Method

getRepo() public method

public getRepo ( Bundle $bundle ) : Repo
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle
return Repo
    public function getRepo(BundleEntity $bundle)
    {
        if ($this->hasRepo($bundle)) {
            $dir = $this->getRepoDir($bundle);
            $repo = new PHPGit_Repository($dir, false, array('git_executable' => $this->gitExecutable));
        } else {
            $repo = $this->createGitRepo($bundle);
        }
        return new Repo($bundle, $repo);
    }

Usage Example

Example #1
0
 protected function getRepo($repoFullName = 'KnpLabs/KnpGaufretteBundle')
 {
     $dir = sys_get_temp_dir() . '/kb_git_repos';
     $manager = new RepoManager($dir, $_SERVER['GIT_BIN']);
     $repo = new Bundle($repoFullName);
     $gitRepo = $manager->getRepo($repo);
     return $gitRepo;
 }
All Usage Examples Of Knp\Bundle\KnpBundlesBundle\Git\RepoManager::getRepo