Exemplo n.º 1
0
 /**
  * Test that the constructor argument overrides the detection.
  *
  * @return void
  */
 public function testConstructorOverride()
 {
     $keepEnv = getenv('COMPOSER');
     putenv('COMPOSER');
     mkdir($this->getTempDir() . DIRECTORY_SEPARATOR . 'web');
     chdir($this->getTempDir() . DIRECTORY_SEPARATOR . 'web');
     $determinator = new HomePathDeterminator('/path/to/tenside');
     $detectedHome = $determinator->homeDir();
     putenv('COMPOSER' . ($keepEnv ? '=' . $keepEnv : ''));
     $this->assertEquals('/path/to/tenside', $detectedHome);
 }
 /**
  * Check if the vendor directory is present.
  *
  * @return bool
  */
 public function isProjectInstalled()
 {
     if (isset($this->isProjectInstalled)) {
         return $this->isProjectInstalled;
     }
     return $this->isProjectInstalled = is_dir($this->home->homeDir() . DIRECTORY_SEPARATOR . 'vendor');
 }
Exemplo n.º 3
0
 /**
  * Ensure the home path has been set in the passed meta data.
  *
  * @param JsonArray $metaData The meta data to examine.
  *
  * @return void
  */
 private function ensureHomePath(JsonArray $metaData)
 {
     if ($metaData->has(AbstractPackageManipulatingTask::SETTING_HOME)) {
         return;
     }
     $metaData->set(AbstractPackageManipulatingTask::SETTING_HOME, $this->home->homeDir());
 }
 /**
  * Create an instance.
  *
  * @param HomePathDeterminator $home The home determinator.
  *
  * @return LockHandler
  */
 public static function create(HomePathDeterminator $home)
 {
     return new LockHandler('task-run', $home->tensideDataDir());
 }
Exemplo n.º 5
0
 /**
  * Create an instance.
  *
  * @param HomePathDeterminator $home The home determinator.
  *
  * @return ComposerJson
  */
 public static function create(HomePathDeterminator $home)
 {
     return new ComposerJson($home->homeDir() . DIRECTORY_SEPARATOR . 'composer.json');
 }
 /**
  * Create an instance.
  *
  * @param HomePathDeterminator $home The home determinator.
  *
  * @return TensideJsonConfig
  */
 public static function create(HomePathDeterminator $home)
 {
     return new TensideJsonConfig(new JsonFile($home->tensideDataDir() . DIRECTORY_SEPARATOR . 'tenside.json'));
 }
Exemplo n.º 7
0
 /**
  * Create an instance.
  *
  * @param HomePathDeterminator $home    The home determinator.
  *
  * @param TaskFactoryInterface $factory The event dispatcher.
  *
  * @return TaskList
  */
 public static function create(HomePathDeterminator $home, TaskFactoryInterface $factory)
 {
     return new TaskList($home->tensideDataDir(), $factory);
 }