public function __construct( $numProcs, $flags = 0 ) {
if ( php_sapi_name() != 'cli' ) {
- throw new MWException( "MultiProcess cannot be used from the web." );
+ throw new MWException( "ForkController cannot be used from the web." );
}
$this->procsToStart = $numProcs;
$this->flags = $flags;
* This will return 'child' in the child processes. In the parent process,
* it will run until all the child processes exit or a TERM signal is
* received. It will then return 'done'.
+ * @return string
*/
public function start() {
// Trap SIGTERM
}
protected function prepareEnvironment() {
- global $wgCaches, $wgMemc;
- // Don't share DB or memcached connections
+ global $wgMemc;
+ // Don't share DB, storage, or memcached connections
wfGetLBFactory()->destroyInstance();
- $wgCaches = array();
- unset( $wgMemc );
+ FileBackendGroup::destroySingleton();
+ ObjectCache::clear();
+ $wgMemc = null;
}
/**
* Fork a number of worker processes.
+ *
+ * @return string
*/
protected function forkWorkers( $numProcs ) {
$this->prepareEnvironment();