DNProject::cloneRepo PHP Method

cloneRepo() public method

Setup a job to clone a git repository.
public cloneRepo ( ) : string
return string resque token
    public function cloneRepo()
    {
        // Avoid this being called multiple times in the same request
        if (!isset(self::$has_cloned_cache[$this->ID])) {
            $fetch = DNGitFetch::create();
            $fetch->ProjectID = $this->ID;
            $fetch->write();
            // passing true here tells DNGitFetch to force a git clone, otherwise
            // it will just update the repo if it already exists. We want to ensure
            // we're always cloning a new repo in this case, as the git URL may have changed.
            $fetch->start(true);
            self::$has_cloned_cache[$this->ID] = true;
        }
    }