src/Composer/Repository/Vcs/FossilDriver.php
public function initialize()
    {
        // Make sure fossil is installed and reachable.
        $this->checkFossil();

        // Ensure we are allowed to use this URL by config.
        $this->config->prohibitUrlByConfig($this->url, $this->io);

        // Only if url points to a locally accessible directory, assume it's the checkout directory.
        // Otherwise, it should be something fossil can clone from.
        if (Filesystem::isLocalPath($this->url) && is_dir($this->url)) {
            $this->checkoutDir = $this->url;
        } else {
            if (!Cache::isUsable($this->config->get('cache-repo-dir')) || !Cache::isUsable($this->config->get('cache-vcs-dir'))) {
                throw new \RuntimeException('FossilDriver requires a usable cache directory, and it looks like you set it to be disabled');
            }

            $localName = preg_replace('{[^a-z0-9]}i', '-', $this->url);
            $this->repoFile = $this->config->get('cache-repo-dir') . '/' . $localName . '.fossil';
            $this->checkoutDir = $this->config->get('cache-vcs-dir') . '/' . $localName . '/';

            $this->updateLocalRepo();
        }

        $this->getTags();
        $this->getBranches();
    }
public function initialize()
    {
        // Make sure fossil is installed and reachable.
        $this->checkFossil();

        // Ensure we are allowed to use this URL by config.
        $this->config->prohibitUrlByConfig($this->url, $this->io);

        // Only if url points to a locally accessible directory, assume it's the checkout directory.
        // Otherwise, it should be something fossil can clone from.
        if (Filesystem::isLocalPath($this->url) && is_dir($this->url)) {
            $this->checkoutDir = $this->url;
        } else {
            if (!Cache::isUsable($this->config->get('cache-repo-dir')) || !Cache::isUsable($this->config->get('cache-vcs-dir'))) {
                throw new \RuntimeException('FossilDriver requires a usable cache directory, and it looks like you set it to be disabled');
            }

            $localName = preg_replace('{[^a-z0-9]}i', '-', $this->url);
            $this->repoFile = $this->config->get('cache-repo-dir') . '/' . $localName . '.fossil';
            $this->checkoutDir = $this->config->get('cache-vcs-dir') . '/' . $localName . '/';

            $this->updateLocalRepo();
        }

        $this->getTags();
        $this->getBranches();
    }
public function initialize ( ) { // Make sure fossil is installed and reachable. $ this -> checkFossil ( ) ; // Ensure we are allowed to use this URL by config. $ this -> config -> prohibitUrlByConfig ( $ this -> url , $ this -> io ) ; // Only if url points to a locally accessible directory, assume it's the checkout directory. // Otherwise, it should be something fossil can clone from. if ( Filesystem :: isLocalPath ( $ this -> url ) && is_dir ( $ this -> url ) ) { $ this -> checkoutDir = $ this -> url ; } else { if ( ! Cache :: isUsable ( $ this -> config -> get ( 'cache-repo-dir' ) ) || ! Cache :: isUsable ( $ this -> config -> get ( 'cache-vcs-dir' ) ) ) { throw new \ RuntimeException ( 'FossilDriver requires a usable cache directory, and it looks like you set it to be disabled' ) ; } $ localName = preg_replace ( '{[^a-z0-9]}i' , '-' , $ this -> url ) ; $ this -> repoFile = $ this -> config -> get ( 'cache-repo-dir' ) . '/' . $ localName . '.fossil' ; $ this -> checkoutDir = $ this -> config -> get ( 'cache-vcs-dir' ) . '/' . $ localName . '/' ; $ this -> updateLocalRepo ( ) ; } $ this -> getTags ( ) ; $ this -> getBranches ( ) ; }
{@inheritDoc}
{