X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fimdaemon.php;h=0ce74667c5d0178e2aeea7daa7b5f86d0cec3121;hb=c4bada902296ec8d77c232a0a638b0dd60aa1bd0;hp=4a2c942234f6112d19f017aaf64e1de61fcfdbff;hpb=714d920faea302b55857cc3bec4e9e6160ea136a;p=quix0rs-gnu-social.git diff --git a/scripts/imdaemon.php b/scripts/imdaemon.php index 4a2c942234..0ce74667c5 100755 --- a/scripts/imdaemon.php +++ b/scripts/imdaemon.php @@ -53,7 +53,7 @@ class ImDaemon extends SpawningDaemon { common_log(LOG_INFO, 'Waiting to listen to IM connections and queues'); - $master = new ImMaster($this->get_id()); + $master = new ImMaster($this->get_id(), $this->processManager()); $master->init($this->allsites); $master->service(); @@ -66,6 +66,14 @@ class ImDaemon extends SpawningDaemon class ImMaster extends IoMaster { + protected $processManager; + + function __construct($id, $processManager) + { + parent::__construct($id); + $this->processManager = $processManager; + } + /** * Initialize IoManagers for the currently configured site * which are appropriate to this instance. @@ -77,6 +85,7 @@ class ImMaster extends IoMaster $qm = QueueManager::get(); $qm->setActiveGroup('im'); $classes[] = $qm; + $classes[] = $this->processManager; } Event::handle('EndImDaemonIoManagers', array(&$classes)); foreach ($classes as $class) { @@ -85,6 +94,14 @@ class ImMaster extends IoMaster } } +if (version_compare(PHP_VERSION, '5.2.6', '<')) { + $arch = php_uname('m'); + if ($arch == 'x86_64' || $arch == 'amd64') { + print "Aborting daemon - 64-bit PHP prior to 5.2.6 has known bugs in stream_select; you are running " . PHP_VERSION . " on $arch.\n"; + exit(1); + } +} + if (have_option('i', 'id')) { $id = get_option_value('i', 'id'); } else if (count($args) > 0) {