mirror of https://github.com/hauke68/Magallanes
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
46 lines
1.1 KiB
11 years ago
|
<?php
|
||
11 years ago
|
namespace Mage\Task\BuiltIn\Filesystem;
|
||
11 years ago
|
|
||
|
use Mage\Task\AbstractTask;
|
||
|
use Mage\Task\SkipException;
|
||
|
use Mage\Task\Releases\IsReleaseAware;
|
||
|
|
||
11 years ago
|
class ApplyFaclsTask extends AbstractTask implements IsReleaseAware
|
||
11 years ago
|
{
|
||
|
/**
|
||
|
* Returns the Title of the Task
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getName()
|
||
|
{
|
||
|
return 'Set file ACLs on remote system [built-in]';
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Runs the task
|
||
|
*
|
||
|
* @return boolean
|
||
|
* @throws SkipException
|
||
|
*/
|
||
|
public function run()
|
||
|
{
|
||
|
$releasesDirectory = $this->getConfig()->release('directory', 'releases');
|
||
|
$currentCopy = $releasesDirectory . '/' . $this->getConfig()->getReleaseId();
|
||
|
|
||
|
|
||
|
$aclParam = $this->getParameter('acl_param', '');
|
||
|
if (empty($aclParam)) {
|
||
|
throw new SkipException('Parameter acl_param not set.');
|
||
|
}
|
||
|
|
||
|
$folders = $this->getParameter('folders', []);
|
||
|
$recursive = $this->getParameter('recursive', false) ? ' -R ' : ' ';
|
||
|
|
||
|
foreach ($folders as $folder) {
|
||
|
$this->runCommandRemote("setfacl$recursive-m $aclParam $currentCopy/$folder", $output);
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
}
|