Merge commit 'refs/merge-requests/230' of git://gitorious.org/statusnet/mainline into merge-requests/230

This commit is contained in:
Mikael Nordfeldth 2013-08-12 12:37:46 +02:00
commit 3ad3535cd8
8 changed files with 21 additions and 8 deletions

View File

@ -179,8 +179,7 @@ class ProfilecompletionAction extends Action
else { else {
$cnt = $profile->find(); $cnt = $profile->find();
} }
// @todo FIXME: Call-time pass-by-reference has been deprecated. Event::handle('EndProfileCompletionSearch', $this, $profile, $search_engine);
Event::handle('EndProfileCompletionSearch', $this, &$profile, $search_engine);
} }
while ($profile->fetch()) { while ($profile->fetch()) {

View File

@ -48,6 +48,17 @@ class Daemon
function background() function background()
{ {
/* Starting PHP 5.4 (dotdeb), maybe earlier for some version/distrib
* seems MySQL connection using mysqli driver get lost when fork.
* Need to unset it so that child process recreate it.
*
* Not needed if using mysql driver (but it's deprecated starting PHP 5.5)
*
* @todo FIXME cleaner way to do it ?
*/
global $_DB_DATAOBJECT;
unset($_DB_DATAOBJECT['CONNECTIONS']);
$pid = pcntl_fork(); $pid = pcntl_fork();
if ($pid < 0) { // error if ($pid < 0) { // error
common_log(LOG_ERR, "Could not fork."); common_log(LOG_ERR, "Could not fork.");

View File

@ -109,7 +109,7 @@ class AimPlugin extends ImPlugin
function onStartImDaemonIoManagers(&$classes) function onStartImDaemonIoManagers(&$classes)
{ {
parent::onStartImDaemonIoManagers(&$classes); parent::onStartImDaemonIoManagers($classes);
$classes[] = new AimManager($this); // handles sending/receiving $classes[] = new AimManager($this); // handles sending/receiving
return true; return true;
} }

View File

@ -267,6 +267,9 @@ class DomainStatusNetworkInstaller extends Installer
function createDatabase() function createDatabase()
{ {
// Create the New DB // Create the New DB
/* FIXME
* Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli instead.
*/
$res = mysql_connect($this->host, $this->rootname, $this->rootpass); $res = mysql_connect($this->host, $this->rootname, $this->rootpass);
if (!$res) { if (!$res) {
throw new ServerException("Cannot connect to {$this->host} as {$this->rootname}."); throw new ServerException("Cannot connect to {$this->host} as {$this->rootname}.");

View File

@ -147,7 +147,7 @@ class IrcPlugin extends ImPlugin {
* @return boolean * @return boolean
*/ */
public function onStartImDaemonIoManagers(&$classes) { public function onStartImDaemonIoManagers(&$classes) {
parent::onStartImDaemonIoManagers(&$classes); parent::onStartImDaemonIoManagers($classes);
$classes[] = new IrcManager($this); // handles sending/receiving $classes[] = new IrcManager($this); // handles sending/receiving
return true; return true;
} }

View File

@ -120,7 +120,7 @@ class MsnPlugin extends ImPlugin {
* @return boolean * @return boolean
*/ */
public function onStartImDaemonIoManagers(&$classes) { public function onStartImDaemonIoManagers(&$classes) {
parent::onStartImDaemonIoManagers(&$classes); parent::onStartImDaemonIoManagers($classes);
$classes[] = new MsnManager($this); // handles sending/receiving $classes[] = new MsnManager($this); // handles sending/receiving
return true; return true;
} }

View File

@ -249,7 +249,7 @@ class TwitterBridgePlugin extends Plugin
* *
* @return boolean hook return * @return boolean hook return
*/ */
function onGetValidDaemons($daemons) function onGetValidDaemons(&$daemons)
{ {
if (self::hasKeys()) { if (self::hasKeys()) {
array_push( array_push(

View File

@ -310,7 +310,7 @@ class XmppPlugin extends ImPlugin
function onStartImDaemonIoManagers(&$classes) function onStartImDaemonIoManagers(&$classes)
{ {
parent::onStartImDaemonIoManagers(&$classes); parent::onStartImDaemonIoManagers($classes);
$classes[] = new XmppManager($this); // handles pings/reconnects $classes[] = new XmppManager($this); // handles pings/reconnects
return true; return true;
} }
@ -440,7 +440,7 @@ class XmppPlugin extends ImPlugin
* *
* @return boolean hook return * @return boolean hook return
*/ */
function onGetValidDaemons($daemons) function onGetValidDaemons(&$daemons)
{ {
if( isset($this->server) && if( isset($this->server) &&
isset($this->port) && isset($this->port) &&