public function cleanBuilds($projectRoot, $maxAge = null, $keepMax = 10, $includeActive = false, $quiet = true)
    {
        // Find all the potentially active symlinks, which might be www itself
        // or symlinks inside www. This is so we can avoid deleting the active
        // build(s).
        $blacklist = [];
        if (!$includeActive) {
            $blacklist = $this->getActiveBuilds($projectRoot);
        }

        return $this->cleanDirectory(
            $projectRoot . '/' . $this->config->get('local.build_dir'),
            $maxAge,
            $keepMax,
            $blacklist,
            $quiet
        );
    }
public function cleanBuilds($projectRoot, $maxAge = null, $keepMax = 10, $includeActive = false, $quiet = true)
    {
        // Find all the potentially active symlinks, which might be www itself
        // or symlinks inside www. This is so we can avoid deleting the active
        // build(s).
        $blacklist = [];
        if (!$includeActive) {
            $blacklist = $this->getActiveBuilds($projectRoot);
        }

        return $this->cleanDirectory(
            $projectRoot . '/' . $this->config->get('local.build_dir'),
            $maxAge,
            $keepMax,
            $blacklist,
            $quiet
        );
    }
public function cleanBuilds ( $ projectRoot , $ maxAge = null , $ keepMax = 10 , $ includeActive = false , $ quiet = true ) { // Find all the potentially active symlinks, which might be www itself // or symlinks inside www. This is so we can avoid deleting the active // build(s). $ blacklist = [ ] ; if ( ! $ includeActive ) { $ blacklist = $ this -> getActiveBuilds ( $ projectRoot ) ; } return $ this -> cleanDirectory ( $ projectRoot . '/' . $ this -> config -> get ( 'local.build_dir' ) , $ maxAge , $ keepMax , $ blacklist , $ quiet ) ; }
Remove old builds.

This preserves the currently active build.

@param string   $projectRoot
@param int|null $maxAge
@param int      $keepMax
@param bool     $includeActive
@param bool     $quiet

@return int[]
The numbers of deleted and kept builds.
Remove old builds .