Example #1
0
 public function setUp()
 {
     $path = new PlatformFileSystemPathFactory();
     $this->workspace = $path->createTemporaryPath();
     mkdir($this->workspace, 0777, true);
     $this->workspace = realpath($this->workspace);
     $this->cache = new Cache($this->workspace, $this->getApp());
 }
Example #2
0
 public function setUp()
 {
     $app = $this->getApp();
     $path = new PlatformFileSystemPathFactory();
     $this->workspace = $path->createTemporaryPath();
     mkdir($this->workspace, 0777, true);
     $this->workspace = realpath($this->workspace);
     $this->cache = new Cache($this->workspace, Cache::EXTENSION, 02, $app['filesystem']);
 }
 /**
  * Create a new instance of the default path factory.
  *
  * @return PathFactoryInterface The new default path factory instance.
  */
 protected function createDefaultPathFactory()
 {
     return PlatformFileSystemPathFactory::instance();
 }
Example #4
0
 /**
  * Helper to initialize the directory variables.
  *
  * @throws \ErrorException
  */
 protected function initDirectories()
 {
     // Pathogen working directory as reference for initial path calculation.
     $factory = new PlatformFileSystemPathFactory();
     $workingDirectoryPath = $factory->createWorkingDirectoryPath();
     // Build repo root path object, relative to the current working directory.
     $repo_path_input = $this->currentInput->getArgument('repo');
     $this->repoPath = $workingDirectoryPath->resolve($factory->create($repo_path_input));
     // Get the new working directory from the --subdir option.
     $subdir_input = $this->currentInput->getOption('subdir');
     $this->workingPath = $this->repoPath->resolve($factory->create($subdir_input));
     // If the working directory is not in or is not the repository's directory
     // we cannot proceed.
     if (!$this->repoPath->isAncestorOf($this->workingPath) && $this->repoPath->string() != $this->workingPath->string()) {
         throw new \ErrorException('The subdirectory has to be located in the repository');
     }
 }
Example #5
0
 /**
  * Get the most appropriate path factory for this type of path.
  *
  * @return Factory\FileSystemPathFactoryInterface The path factory.
  */
 protected static function factory()
 {
     return Factory\PlatformFileSystemPathFactory::instance();
 }