Example #1
0
 /**
  * @param Project $project
  * @param array $options
  * @return int
  */
 public function createProject(Project $project, array $options = array())
 {
     if (!$project->getBootstrap()) {
         throw new InvalidArgumentException('The bootstrap of the project is not defined');
     }
     return $this->execute(trim(sprintf('composer create-project --prefer-dist %s %s %s', $project->getBootstrap()->getPackage(), $project->getDirectoryPath() ? '"' . $project->getDirectoryPath() . '"' : '', $project->getBootstrap()->getVersion())) . $this->mapOptions($options));
 }