/** * 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; }
/** * @param string $root local path to document root * @param string $url preferred public URL */ public function dropVhost($root, $url) { $this->fs->remove($this->createFilePath($root, $url)); }