Ejemplo n.º 1
0
 /**
  * Ensure that $command executes without error when applied to a test directory.
  *
  * @param string $testDir
  * @param string $command
  * @return string $command if well-formed
  * @throws \Symfony\Component\Filesystem\Exception, \RuntimeException
  */
 public static function validateDirCommand($testDir, $command)
 {
     if (empty($command)) {
         throw new \RuntimeException("Command is required");
     }
     $fs = new \Amp\Util\Filesystem();
     $fs->mkdir($testDir);
     $permHandler = new \Amp\Permission\External();
     $permHandler->setDirCommand('examplePerm', $command);
     $permHandler->applyDirPermission('examplePerm', $testDir);
     $fs->remove($testDir);
     return $command;
 }
Ejemplo n.º 2
0
 public function setupLogDir()
 {
     $this->fs->mkdir($this->getLogDir());
     $this->getPerm()->applyDirPermission(PermissionInterface::WEB_WRITE, $this->getLogDir());
 }