bin/php/updatesearchindexsolr.php
protected function forkAndExecute( $nodeID, $offset, $limit )
    {
        eZDB::setInstance( null );

        // Prepare DB-based cluster handler for fork (it will re-connect DB automatically).
        eZClusterFileHandler::preFork();

        $pid = pcntl_fork();

        // reinitialize DB after fork
        $this->initializeDB();

        if ( $pid == -1 )
        {
            die( 'could not fork' );
        }
        else if ( $pid )
        {
            // Main process
            return $pid;
        }
        else
        {
            // We are the child process
            if ( $this->execute( $nodeID, $offset, $limit ) > 0 )
            {
                $this->Script->shutdown( 0 );
            }
            else
            {
                $this->Script->shutdown( 3 );
            }
        }
    }
protected function forkAndExecute( $nodeID, $offset, $limit )
    {
        eZDB::setInstance( null );

        // Prepare DB-based cluster handler for fork (it will re-connect DB automatically).
        eZClusterFileHandler::preFork();

        $pid = pcntl_fork();

        // reinitialize DB after fork
        $this->initializeDB();

        if ( $pid == -1 )
        {
            die( 'could not fork' );
        }
        else if ( $pid )
        {
            // Main process
            return $pid;
        }
        else
        {
            // We are the child process
            if ( $this->execute( $nodeID, $offset, $limit ) > 0 )
            {
                $this->Script->shutdown( 0 );
            }
            else
            {
                $this->Script->shutdown( 3 );
            }
        }
    }
protected function forkAndExecute ( $ nodeID , $ offset , $ limit ) { eZDB :: setInstance ( null ) ; // Prepare DB-based cluster handler for fork (it will re-connect DB automatically). eZClusterFileHandler :: preFork ( ) ; $ pid = pcntl_fork ( ) ; // reinitialize DB after fork $ this -> initializeDB ( ) ; if ( $ pid == - 1 ) { die ( 'could not fork' ) ; } else if ( $ pid ) { // Main process return $ pid ; } else { // We are the child process if ( $ this -> execute ( $ nodeID , $ offset , $ limit ) > 0 ) { $ this -> Script -> shutdown ( 0 ) ; } else { $ this -> Script -> shutdown ( 3 ) ; } } }
Fork and execute

@param int $nodeid
@param int $offset
@param int $limit
Fork and execute