예제 #1
0
파일: External.php 프로젝트: totten/amp
 /**
  * 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;
 }
예제 #2
0
 public function setupLogDir()
 {
     $this->fs->mkdir($this->getLogDir());
     $this->getPerm()->applyDirPermission(PermissionInterface::WEB_WRITE, $this->getLogDir());
 }