Page MenuHomePhabricator

GetDependenciesWorkflow.php

Authored By
avivey
Jun 15 2016, 11:52 PM
Size
1 KB
Referenced Files
None
Subscribers
None

GetDependenciesWorkflow.php

<?php
final class GetDependenciesWorkflow extends ArcanistWorkflow {
public function getWorkflowName() {
return 'get-dependencies';
}
public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT
**get-dependencies**
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Download external resources you might need.
EOTEXT
);
}
public function run() {
$console = PhutilConsole::getConsole();
$lib = 'libname';
$root = dirname(phutil_get_library_root($lib));
$working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
$configuration_manager = clone $this->getConfigurationManager();
$configuration_manager->setWorkingCopyIdentity($working_copy);
$repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
$configuration_manager);
$dependencies = array(
array(
'filename' => 'checkstyle-6.14.1-all.jar',
'sha1' => '8e2c3a2bcef100c084e6ea80cc426b3443632d8c',
'uri' =>
'http://my.web.server/checkstyle-6.14.1.jar',
),
);
chdir($root.'/resources/');
foreach ($dependencies as $dep) {
phutil_passthru('curl -o %s %s', $dep['filename'], $dep['uri']);
}
}
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
178528
Default Alt Text
GetDependenciesWorkflow.php (1 KB)

Event Timeline