/**
* Execution method always used for tasks
*
* @return void
*/
public function execute()
{
parent::execute();
//引数のセット
if (isset($this->params[self::KEY_APACHE_OWNER])) {
$owner = Hash::get($this->params, self::KEY_APACHE_OWNER);
$writables = array(APP . 'Config', APP . 'tmp', ROOT . DS . 'composer.json', ROOT . DS . 'bower.json');
foreach ($writables as $file) {
$messages = array();
$ret = null;
$cmd = sprintf('`which chown` %s -R %s 2>&1', $owner, $file);
exec($cmd, $messages, $ret);
}
}
if (array_key_exists(self::KEY_RELEASE, $this->params)) {
$path = ROOT . DS . 'app' . DS . 'Plugin' . DS;
$plugins = array_unique(array_merge(App::objects('plugins'), array_map('basename', glob($path . '*', GLOB_ONLYDIR))));
$folder = new Folder();
foreach ($plugins as $plugin) {
$folder->delete($path . $plugin . DS . '.git');
}
$folder->delete(ROOT . DS . '.git');
$folder->delete(ROOT . DS . '.chef');
}
Configure::write('NetCommons.installed', true);
$this->InstallUtil->saveAppConf();
}