Changeset View
Changeset View
Standalone View
Standalone View
scripts/daemon/launch_daemon.php
| #!/usr/bin/env php | #!/usr/bin/env php | ||||
| <?php | <?php | ||||
| // NOTE: This is substantially the same as the libphutil/ "launch_daemon.php" | // NOTE: This is substantially the same as the libphutil/ "launch_daemon.php" | ||||
| // script, except it loads the Phabricator environment and adds some Phabricator | // script, except it loads the Phabricator environment and adds some Phabricator | ||||
| // specific flags. | // specific flags. | ||||
| $root = dirname(dirname(dirname(__FILE__))); | $root = dirname(dirname(dirname(__FILE__))); | ||||
| require_once $root.'/scripts/__init_script__.php'; | require_once $root.'/scripts/__init_script__.php'; | ||||
| $flags = array(); | $overseer = new PhutilDaemonOverseer($argv); | ||||
| $bootloader = PhutilBootloader::getInstance(); | $bootloader = PhutilBootloader::getInstance(); | ||||
| foreach ($bootloader->getAllLibraries() as $library) { | foreach ($bootloader->getAllLibraries() as $library) { | ||||
| if ($library == 'phutil') { | $overseer->addLibrary(phutil_get_library_root($library)); | ||||
| // No need to load libphutil, it's necessarily loaded implicitly by the | |||||
| // daemon itself. | |||||
| continue; | |||||
| } | |||||
| $flags[] = '--load-phutil-library='.phutil_get_library_root($library); | |||||
| } | } | ||||
| // Add more flags. | |||||
| array_splice($argv, 2, 0, $flags); | |||||
| $overseer = new PhutilDaemonOverseer($argv); | |||||
| $overseer->run(); | $overseer->run(); | ||||