mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Enable phd to load extra libraries
Summary: add --load-phutil-library for libraries other than phabricator and libphutil. Test Plan: launch a daemon in facebook such as PhabricatorDifferentialCommentDaemon. Reviewers: epriestley, tuomaspelkonen CC: Differential Revision: 146
This commit is contained in:
parent
ebdcedc87f
commit
c223aaa79e
2 changed files with 16 additions and 0 deletions
|
@ -181,10 +181,25 @@ EOHELP
|
||||||
$argv[$key] = escapeshellarg($arg);
|
$argv[$key] = escapeshellarg($arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$bootloader = PhutilBootloader::getInstance();
|
||||||
|
$all_libraries = $bootloader->getAllLibraries();
|
||||||
|
|
||||||
|
$non_default_libraries = array_diff(
|
||||||
|
$all_libraries,
|
||||||
|
array('phutil', 'phabricator'));
|
||||||
|
|
||||||
|
$extra_libraries = array();
|
||||||
|
foreach ($non_default_libraries as $library) {
|
||||||
|
$extra_libraries[] = csprintf(
|
||||||
|
'--load-phutil-library=%s',
|
||||||
|
phutil_get_library_root($library));
|
||||||
|
}
|
||||||
|
|
||||||
$future = new ExecFuture(
|
$future = new ExecFuture(
|
||||||
"./launch_daemon.php ".
|
"./launch_daemon.php ".
|
||||||
"%s ".
|
"%s ".
|
||||||
"--load-phutil-library=%s ".
|
"--load-phutil-library=%s ".
|
||||||
|
implode(' ', $extra_libraries)." ".
|
||||||
"--conduit-uri=%s ".
|
"--conduit-uri=%s ".
|
||||||
"--daemonize ".
|
"--daemonize ".
|
||||||
"--phd=%s ".
|
"--phd=%s ".
|
||||||
|
|
|
@ -15,6 +15,7 @@ phutil_require_module('phutil', 'future/exec');
|
||||||
phutil_require_module('phutil', 'moduleutils');
|
phutil_require_module('phutil', 'moduleutils');
|
||||||
phutil_require_module('phutil', 'symbols');
|
phutil_require_module('phutil', 'symbols');
|
||||||
phutil_require_module('phutil', 'utils');
|
phutil_require_module('phutil', 'utils');
|
||||||
|
phutil_require_module('phutil', 'xsprintf/csprintf');
|
||||||
|
|
||||||
|
|
||||||
phutil_require_source('PhabricatorDaemonControl.php');
|
phutil_require_source('PhabricatorDaemonControl.php');
|
||||||
|
|
Loading…
Reference in a new issue