X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fiomaster.php;h=e53fc6511e1eebce4694d4bc187a1c00fd60d605;hb=ebc8e2a0e7dde135aef73be7b3d96dff155fe091;hp=3745a5c7a9b6caede91ef727955820e0d8118159;hpb=d5cbfe8071d56438cfa168dc3db56a959317eae0;p=quix0rs-gnu-social.git diff --git a/lib/iomaster.php b/lib/iomaster.php index 3745a5c7a9..e53fc6511e 100644 --- a/lib/iomaster.php +++ b/lib/iomaster.php @@ -55,27 +55,18 @@ abstract class IoMaster if ($multiSite !== null) { $this->multiSite = $multiSite; } - if ($this->multiSite) { - $this->sites = StatusNet::findAllSites(); - } else { - $this->sites = array(StatusNet::currentSite()); - } - - if (empty($this->sites)) { - throw new Exception("Empty status_network table, cannot init"); - } - foreach ($this->sites as $site) { - StatusNet::switchSite($site); - $this->initManagers(); - } + $this->initManagers(); } /** - * Initialize IoManagers for the currently configured site - * which are appropriate to this instance. + * Initialize IoManagers which are appropriate to this instance; + * pass class names or instances into $this->instantiate(). + * + * If setup and configuration may vary between sites in multi-site + * mode, it's the subclass's responsibility to set them up here. * - * Pass class names into $this->instantiate() + * Switching site configurations is an acceptable side effect. */ abstract function initManagers(); @@ -141,7 +132,7 @@ abstract class IoMaster $write = array(); $except = array(); $this->logState('listening'); - common_log(LOG_DEBUG, "Waiting up to $timeout seconds for socket data..."); + //common_debug("Waiting up to $timeout seconds for socket data..."); $ready = stream_select($read, $write, $except, $timeout, 0); if ($ready === false) { @@ -161,7 +152,7 @@ abstract class IoMaster if ($timeout > 0 && empty($sockets)) { // If we had no listeners, sleep until the pollers' next requested wakeup. - common_log(LOG_DEBUG, "Sleeping $timeout seconds until next poll cycle..."); + common_debug("Sleeping $timeout seconds until next poll cycle..."); $this->logState('sleep'); sleep($timeout); } @@ -199,7 +190,7 @@ abstract class IoMaster } } else if (common_config('queue', 'debug_memory')) { $fmt = number_format($usage); - common_log(LOG_DEBUG, "Memory usage $fmt"); + common_debug("Memory usage $fmt"); } } }