diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-22 13:56:16 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-22 13:56:16 -0700 |
commit | e89908f26140c217e01b2f8f755712f38f3935f3 (patch) | |
tree | 6b241fc2e33f3528cf48b415ef67906826b02e24 /scripts/imdaemon.php | |
parent | 714d920faea302b55857cc3bec4e9e6160ea136a (diff) | |
parent | eb563937df921e5fc67ca0c87e229feb2907fd19 (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 1.0.x
Conflicts:
lib/channel.php
scripts/imdaemon.php
Diffstat (limited to 'scripts/imdaemon.php')
-rwxr-xr-x | scripts/imdaemon.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/imdaemon.php b/scripts/imdaemon.php index 4a2c94223..0ce74667c 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) { |