コード例 #1
0
ファイル: Command.php プロジェクト: bmartel/workshop
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return bool
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($isNotPackage = $this->builder->isNotPackageRoot()) {
         $output->writeln("<error>Cannot generate file. Generator commands must be run from the root of a composer package.</error>");
     }
     return !$isNotPackage;
 }
コード例 #2
0
ファイル: Package.php プロジェクト: bmartel/workshop
 /**
  * Create directory tree.
  *
  * @param string $dir
  * @return bool
  */
 public function makeDirectory($dir = '')
 {
     $dirPath = rtrim($this->outputPath . '/' . ltrim($dir, '/'), '/');
     parent::makeDirectory($dirPath);
     // Directory was created
     if ($this->filesystem->exists($dirPath)) {
         return true;
     }
     return false;
 }