コード例 #1
0
ファイル: Config.php プロジェクト: franzliedke/studio
 public function removePackage(Package $package)
 {
     // Ensure paths are loaded
     $this->getPaths();
     $path = $package->getPath();
     if (($key = array_search($path, $this->paths)) !== false) {
         unset($this->paths[$key]);
         $this->dump();
     }
 }
コード例 #2
0
 public function serializePaths(array $paths)
 {
     $globbedPaths = array_map(function ($path) {
         return glob($path, GLOB_MARK | GLOB_ONLYDIR);
     }, $paths);
     $allPaths = array_reduce($globbedPaths, function ($collect, $pathOrPaths) {
         if (is_array($pathOrPaths)) {
             return array_merge($collect, $pathOrPaths);
         } else {
             $collect[] = $pathOrPaths;
             return $collect;
         }
     }, []);
     $allPaths = array_filter($allPaths, function ($path) {
         return is_dir($path) && file_exists("{$path}/composer.json");
     });
     $packages = array_map(function ($path) {
         return Package::fromFolder(rtrim($path, '/'));
     }, $allPaths);
     $packagePaths = array_reduce($packages, function ($collect, Package $package) {
         $collect[$package->getComposerId()] = $package->getPath();
         return $collect;
     }, []);
     return ['packages' => $packagePaths];
 }
コード例 #3
0
ファイル: LoadCommand.php プロジェクト: mlanin-forks/studio
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $package = Package::fromFolder($input->getArgument('path'));
     $this->config->addPackage($package);
     $output->writeln("<info>Package loaded successfully.</info>");
     $output->writeln("<comment>Dumping autoloads...</comment>");
     Shell::run('composer dump-autoload');
     $output->writeln("<info>Autoloads successfully generated.</info>");
 }
コード例 #4
0
ファイル: LoadCommand.php プロジェクト: joynal/studio
 protected function fire()
 {
     $package = Package::fromFolder($this->input->getArgument('path'));
     $this->config->addPackage($package);
     $this->output->note('Package loaded successfully.');
     $this->output->note('Dumping autoloads...');
     Shell::run('composer dump-autoload');
     $this->output->success('Autoloads successfully generated.');
 }
コード例 #5
0
 protected function fire()
 {
     $path = $this->input->getArgument('path');
     if ($this->abortDeletion($path)) {
         $this->output->note('Aborted.');
         return;
     }
     $package = Package::fromFolder($path);
     $this->config->removePackage($package);
     $this->output->note('Removing package...');
     $filesystem = new Filesystem();
     $filesystem->remove($path);
     $this->output->success('Package successfully removed.');
 }
コード例 #6
0
ファイル: ScrapCommand.php プロジェクト: sethathay/PPBakery
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $path = $input->getArgument('path');
     if ($this->abortDeletion($path, $output)) {
         $output->writeln("<comment>Aborted.</comment>");
         return;
     }
     $package = Package::fromFolder($path);
     $this->config->removePackage($package);
     $output->writeln("<comment>Removing package...</comment>");
     $filesystem = new Filesystem(new Local(getcwd()));
     $filesystem->deleteDir($path);
     $output->writeln("<info>Package successfully removed.</info>");
     $output->writeln("<comment>Dumping autoloads...</comment>");
     Shell::run('composer dump-autoload');
     $output->writeln("<info>Autoloads successfully generated.</info>");
 }
コード例 #7
0
ファイル: CreateCommand.php プロジェクト: mlanin-forks/studio
 /**
  * @param OutputInterface $output
  * @param Package $package
  * @return void
  */
 protected function refreshAutoloads(OutputInterface $output, Package $package)
 {
     if (file_exists(getcwd() . '/' . $package->getPath() . '/composer.json')) {
         $output->writeln("<comment>Dumping autoloads...</comment>");
         Shell::run('composer dump-autoload', $package->getPath());
         $output->writeln("<info>Autoloads successfully generated.</info>");
     }
 }
コード例 #8
0
 protected function fire()
 {
     $package = Package::fromFolder($this->input->getArgument('path'));
     $this->config->addPackage($package);
     $this->output->success('Package loaded successfully.');
 }
コード例 #9
0
 /**
  * Create the new package.
  *
  * @return \Studio\Package
  */
 public function create()
 {
     $this->installParts();
     return Package::fromFolder($this->path);
 }
コード例 #10
0
 /**
  * Create the new package.
  *
  * @return \Studio\Package
  */
 public function create()
 {
     $this->cloneRepository();
     return Package::fromFolder($this->path);
 }