forked from GNUsocial/gnu-social
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 1.0.x
Conflicts: lib/channel.php scripts/imdaemon.php
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user