/** * Execute the task * * @return self * @throws BuildException */ public function execute() { if (!$this->getDirectory()) { throw new BuildException('Directory is not set'); } $directory = $this->properties->filter($this->getDirectory()); Pale::run(function () use($directory) { return chdir($directory); }); return $this; }
/** * @covers Pants\Property\Properties::filter */ public function testDetectedPropertyCyclesThrowAnException() { $this->setExpectedException("\\Pants\\Property\\PropertyNameCycleException"); $this->properties->one = '${two}'; $this->properties->two = '${one}'; $this->properties->filter('${one}'); }
/** * Execute the task * * @return self * @throws BuildException */ public function execute() { if (!$this->getTarget()) { throw new BuildException('No target set'); } $target = $this->properties->filter($this->getTarget()); $this->targets->{$target}->execute(); return $this; }
/** * Execute the task * * @return self * @throws BuildException */ public function execute() { if (!$this->getFiles()) { throw new BuildException("Files are not set"); } if (!$this->getGroup()) { throw new BuildException("Group is not set"); } $group = $this->properties->filter($this->getGroup()); foreach ($this->getFiles() as $file) { $file = $this->properties->filter($file); Pale::run(function () use($file, $group) { return chgrp($file, $group); }); } return $this; }
/** * Execute the task * * @return self * @throws BuildException */ public function execute() { if (!$this->getFiles()) { throw new BuildException("Files are not set"); } if (!$this->getMode()) { throw new BuildException("Mode is not set"); } $mode = $this->properties->filter($this->getMode()); if (is_string($mode)) { $mode = octdec($mode); } foreach ($this->getFiles() as $file) { $file = $this->properties->filter($file); Pale::run(function () use($file, $mode) { return chmod($file, $mode); }); } return $this; }