summaryrefslogtreecommitdiff
path: root/scripts/imdaemon.php
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/imdaemon.php')
-rwxr-xr-xscripts/imdaemon.php19
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) {