lib/base/BaseDeploy.class.php
public function cleanup()
	{
		$this->log('cleanup', LOG_DEBUG);

		$past_deployments = array();

		if (is_array($this->remote_host))
		{
			foreach ($this->remote_host as $remote_host)
			{
				if ($past_dirs = $this->collectPastDeployments($remote_host, $this->remote_dir))
				{
					$past_deployments[] = array(
						'remote_host' => $remote_host,
						'remote_dir' => $this->remote_dir,
						'dirs' => $past_dirs
					);
				}
			}
		}
		else
		{
			if ($past_dirs = $this->collectPastDeployments($this->remote_host, $this->remote_dir))
			{
				$past_deployments[] = array(
					'remote_host' => $this->remote_host,
					'remote_dir' => $this->remote_dir,
					'dirs' => $past_dirs
				);
			}
		}

		if (!empty($past_deployments)) {
			if (static::inputPrompt('Delete old directories? (yes/no): ', 'no') == 'yes')
				$this->deletePastDeployments($past_deployments);
		}
		else {
			$this->log('No cleanup needed');
		}
	}
public function cleanup()
	{
		$this->log('cleanup', LOG_DEBUG);

		$past_deployments = array();

		if (is_array($this->remote_host))
		{
			foreach ($this->remote_host as $remote_host)
			{
				if ($past_dirs = $this->collectPastDeployments($remote_host, $this->remote_dir))
				{
					$past_deployments[] = array(
						'remote_host' => $remote_host,
						'remote_dir' => $this->remote_dir,
						'dirs' => $past_dirs
					);
				}
			}
		}
		else
		{
			if ($past_dirs = $this->collectPastDeployments($this->remote_host, $this->remote_dir))
			{
				$past_deployments[] = array(
					'remote_host' => $this->remote_host,
					'remote_dir' => $this->remote_dir,
					'dirs' => $past_dirs
				);
			}
		}

		if (!empty($past_deployments)) {
			if (static::inputPrompt('Delete old directories? (yes/no): ', 'no') == 'yes')
				$this->deletePastDeployments($past_deployments);
		}
		else {
			$this->log('No cleanup needed');
		}
	}
public function cleanup ( ) { $ this -> log ( 'cleanup' , LOG_DEBUG ) ; $ past_deployments = array ( ) ; if ( is_array ( $ this -> remote_host ) ) { foreach ( $ this -> remote_host as $ remote_host ) { if ( $ past_dirs = $ this -> collectPastDeployments ( $ remote_host , $ this -> remote_dir ) ) { $ past_deployments [ ] = array ( 'remote_host' => $ remote_host , 'remote_dir' => $ this -> remote_dir , 'dirs' => $ past_dirs ) ; } } } else { if ( $ past_dirs = $ this -> collectPastDeployments ( $ this -> remote_host , $ this -> remote_dir ) ) { $ past_deployments [ ] = array ( 'remote_host' => $ this -> remote_host , 'remote_dir' => $ this -> remote_dir , 'dirs' => $ past_dirs ) ; } } if ( ! empty ( $ past_deployments ) ) { if ( static :: inputPrompt ( 'Delete old directories? (yes/no): ' , 'no' ) == 'yes' ) $ this -> deletePastDeployments ( $ past_deployments ) ; } else { $ this -> log ( 'No cleanup needed' ) ; } }
Deletes obsolete deployment directories
Deletes obsolete deployment directories