function startSession($pkg, $contents)
    {
        if ($this->installphase != PEAR_TASK_INSTALL) {
            return false;
        }
        // remove the tasks: namespace if present
        $this->_pkg = $pkg;
        $this->_stripNamespace();
        $this->logger->log(0, 'Including external post-installation script "' .
            $contents . '" - any errors are in this script');
        include_once $contents;
        if (class_exists($this->_class)) {
            $this->logger->log(0, 'Inclusion succeeded');
        } else {
            return $this->throwError('init of post-install script class "' . $this->_class
                . '" failed');
        }
        $this->_obj = new $this->_class;
        $this->logger->log(1, 'running post-install script "' . $this->_class . '->init()"');
        PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
        $res = $this->_obj->init($this->config, $pkg, $this->_lastversion);
        PEAR::popErrorHandling();
        if ($res) {
            $this->logger->log(0, 'init succeeded');
        } else {
            return $this->throwError('init of post-install script "' . $this->_class .
                '->init()" failed');
        }
        $this->_contents = $contents;
        return true;
    }
function startSession($pkg, $contents)
    {
        if ($this->installphase != PEAR_TASK_INSTALL) {
            return false;
        }
        // remove the tasks: namespace if present
        $this->_pkg = $pkg;
        $this->_stripNamespace();
        $this->logger->log(0, 'Including external post-installation script "' .
            $contents . '" - any errors are in this script');
        include_once $contents;
        if (class_exists($this->_class)) {
            $this->logger->log(0, 'Inclusion succeeded');
        } else {
            return $this->throwError('init of post-install script class "' . $this->_class
                . '" failed');
        }
        $this->_obj = new $this->_class;
        $this->logger->log(1, 'running post-install script "' . $this->_class . '->init()"');
        PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
        $res = $this->_obj->init($this->config, $pkg, $this->_lastversion);
        PEAR::popErrorHandling();
        if ($res) {
            $this->logger->log(0, 'init succeeded');
        } else {
            return $this->throwError('init of post-install script "' . $this->_class .
                '->init()" failed');
        }
        $this->_contents = $contents;
        return true;
    }
function startSession ( $ pkg , $ contents ) { if ( $ this -> installphase != PEAR_TASK_INSTALL ) { return false ; } // remove the tasks: namespace if present $ this -> _pkg = $ pkg ; $ this -> _stripNamespace ( ) ; $ this -> logger -> log ( 0 , 'Including external post-installation script "' . $ contents . '" - any errors are in this script' ) ; include_once $ contents ; if ( class_exists ( $ this -> _class ) ) { $ this -> logger -> log ( 0 , 'Inclusion succeeded' ) ; } else { return $ this -> throwError ( 'init of post-install script class "' . $ this -> _class . '" failed' ) ; } $ this -> _obj = new $ this -> _class ; $ this -> logger -> log ( 1 , 'running post-install script "' . $ this -> _class . '->init()"' ) ; PEAR :: pushErrorHandling ( PEAR_ERROR_RETURN ) ; $ res = $ this -> _obj -> init ( $ this -> config , $ pkg , $ this -> _lastversion ) ; PEAR :: popErrorHandling ( ) ; if ( $ res ) { $ this -> logger -> log ( 0 , 'init succeeded' ) ; } else { return $ this -> throwError ( 'init of post-install script "' . $ this -> _class . '->init()" failed' ) ; } $ this -> _contents = $ contents ; return true ; }
Unlike other tasks, the installed file name is passed in instead of the file contents,
because this task is handled post-installation
@param PEAR_PackageFile_v1|PEAR_PackageFile_v2
@param string file name
@return bool|PEAR_Error false to skip this file, PEAR_Error to fail
(use $this->throwError)
Unlike other tasks the installed file name is passed in instead of the file contents because this task is handled post - installation