protected function execute(array $arguments = array(), array $options = array()) { $client = new nbIvyClient(); $this->logLine('Publishing... ', nbLogger::COMMENT); $command = $client->getPublishCmdLine(isset($options['local'])); $this->executeShellCommand($command); }
protected function execute(array $arguments = array(), array $options = array()) { nbFileSystem::rmdir(nbConfig::get('project_dependencies'), true); $client = new nbIvyClient(); $this->logLine('Retrieving dependencies...', nbLogger::COMMENT); $command = $client->getRetrieveCmdLine(); $this->executeShellCommand($command); $finder = nbFileFinder::create('file'); $files = $finder->add('*-api.zip')->in(nbConfig::get('project_dependencies')); $zip = new ZipArchive(); foreach ($files as $file) { if ($zip->open($file, ZIPARCHIVE::CHECKCONS) !== true) { throw new Exception('Error opening zip file ' . $file); } $zip->extractTo(dirname($file)); $zip->close(); $this->logLine(sprintf('Unzipping %s', $file), nbLogger::COMMENT); } $files = $finder->add('*.zip')->in(nbConfig::get('project_dependencies')); foreach ($files as $file) { nbFileSystem::delete($file); } }