⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install.php

📁 php-4.4.7学习linux时下载的源代码
💻 PHP
📖 第 1 页 / 共 3 页
字号:
                'installroot' => array(                    'shortopt' => 'R',                    'arg' => 'DIR',                    'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)',                    ),                'ignore-errors' => array(                    'doc' => 'force install even if there were errors',                    ),                'offline' => array(                    'shortopt' => 'O',                    'doc' => 'do not attempt to uninstall remotely',                    ),                ),            'doc' => '[channel/]<package> ...Uninstalls one or more PEAR packages.  More than one package may bespecified at once.  Prefix with channel name to uninstall from achannel not in your default channel ({config default_channel})'),        'bundle' => array(            'summary' => 'Unpacks a Pecl Package',            'function' => 'doBundle',            'shortcut' => 'bun',            'options' => array(                'destination' => array(                   'shortopt' => 'd',                    'arg' => 'DIR',                    'doc' => 'Optional destination directory for unpacking (defaults to current path or "ext" if exists)',                    ),                'force' => array(                    'shortopt' => 'f',                    'doc' => 'Force the unpacking even if there were errors in the package',                ),            ),            'doc' => '<package>Unpacks a Pecl Package into the selected location. It will download thepackage if needed.'),        'run-scripts' => array(            'summary' => 'Run Post-Install Scripts bundled with a package',            'function' => 'doRunScripts',            'shortcut' => 'rs',            'options' => array(            ),            'doc' => '<package>Run post-installation scripts in package <package>, if any exist.'),    );    // }}}    // {{{ constructor    /**     * PEAR_Command_Install constructor.     *     * @access public     */    function PEAR_Command_Install(&$ui, &$config)    {        parent::PEAR_Command_Common($ui, $config);    }    // }}}    /**     * For unit testing purposes     */    function &getDownloader(&$ui, $options, &$config)    {        if (!class_exists('PEAR_Downloader')) {            require_once 'PEAR/Downloader.php';        }        $a = &new PEAR_Downloader($ui, $options, $config);        return $a;    }    /**     * For unit testing purposes     */    function &getInstaller(&$ui)    {        if (!class_exists('PEAR_Installer')) {            require_once 'PEAR/Installer.php';        }        $a = &new PEAR_Installer($ui);        return $a;    }    // {{{ doInstall()    function doInstall($command, $options, $params)    {        if (empty($this->installer)) {            $this->installer = &$this->getInstaller($this->ui);        }        if ($command == 'upgrade') {            $options['upgrade'] = true;        }        if (isset($options['installroot']) && isset($options['packagingroot'])) {            return $this->raiseError('ERROR: cannot use both --installroot and --packagingroot');        }        if (isset($options['packagingroot']) && $this->config->get('verbose') > 2) {            $this->ui->outputData('using package root: ' . $options['packagingroot']);        }        $reg = &$this->config->getRegistry();        if ($command == 'upgrade-all') {            $options['upgrade'] = true;            $reg = &$this->config->getRegistry();            $savechannel = $this->config->get('default_channel');            $params = array();            foreach ($reg->listChannels() as $channel) {                if ($channel == '__uri') {                    continue;                }                $this->config->set('default_channel', $channel);                $chan = &$reg->getChannel($channel);                if (PEAR::isError($chan)) {                    return $this->raiseError($chan);                }                if ($chan->supportsREST($this->config->get('preferred_mirror')) &&                      $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) {                    $dorest = true;                    unset($remote);                } else {                    $dorest = false;                    $remote = &$this->config->getRemote($this->config);                }                $state = $this->config->get('preferred_state');                $installed = array_flip($reg->listPackages($channel));                PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);                if ($dorest) {                    $rest = &$this->config->getREST('1.0', array());                    $latest = $rest->listLatestUpgrades($base, $state, $installed, $channel, $reg);                } else {                    if (empty($state) || $state == 'any') {                        $latest = $remote->call("package.listLatestReleases");                    } else {                        $latest = $remote->call("package.listLatestReleases", $state);                    }                }                PEAR::staticPopErrorHandling();                if (PEAR::isError($latest) || !is_array($latest)) {                    continue;                }                foreach ($latest as $package => $info) {                    $package = strtolower($package);                    if (!isset($installed[$package])) {                        // skip packages we don't have installed                        continue;                    }                    $inst_version = $reg->packageInfo($package, 'version', $channel);                    if (version_compare("$info[version]", "$inst_version", "le")) {                        // installed version is up-to-date                        continue;                    }                    $params[] = $reg->parsedPackageNameToString(array('package' => $package,                        'channel' => $channel));                    $this->ui->outputData(array('data' => "Will upgrade $package"), $command);                }            }            $this->config->set('default_channel', $savechannel);        }        $this->downloader = &$this->getDownloader($this->ui, $options, $this->config);        $errors = array();        $downloaded = array();        $downloaded = &$this->downloader->download($params);        $errors = $this->downloader->getErrorMsgs();        if (count($errors)) {            foreach ($errors as $error) {                $err['data'][] = array($error);            }            $err['headline'] = 'Install Errors';            $this->ui->outputData($err);            if (!count($downloaded)) {                return $this->raiseError("$command failed");            }        }        $data = array(            'headline' => 'Packages that would be Installed'        );        if (isset($options['pretend'])) {            foreach ($downloaded as $package) {                $data['data'][] = array($reg->parsedPackageNameToString($package->getParsedPackage()));            }            $this->ui->outputData($data, 'pretend');            return true;        }        $this->installer->setOptions($options);        $this->installer->sortPackagesForInstall($downloaded);        if (PEAR::isError($err = $this->installer->setDownloadedPackages($downloaded))) {            $this->raiseError($err->getMessage());            return true;        }        $extrainfo = array();        foreach ($downloaded as $param) {            PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);            $info = $this->installer->install($param, $options);            PEAR::staticPopErrorHandling();            if (PEAR::isError($info)) {                $oldinfo = $info;                $pkg = &$param->getPackageFile();                if ($info->getCode() != PEAR_INSTALLER_NOBINARY) {                    if (!($info = $pkg->installBinary($this->installer))) {                        $this->ui->outputData('ERROR: ' .$oldinfo->getMessage());                        continue;                    }                    // we just installed a different package than requested,                    // let's change the param and info so that the rest of this works                    $param = $info[0];                    $info = $info[1];                }            }            if (is_array($info)) {                if ($param->getPackageType() == 'extsrc' ||                      $param->getPackageType() == 'extbin') {                    $pkg = &$param->getPackageFile();                    if ($instbin = $pkg->getInstalledBinary()) {                        $instpkg = &$reg->getPackage($instbin, $pkg->getChannel());                    } else {                        $instpkg = &$reg->getPackage($pkg->getPackage(), $pkg->getChannel());                    }                    foreach ($instpkg->getFilelist() as $name => $atts) {                        $pinfo = pathinfo($atts['installed_as']);                        if (!isset($pinfo['extension']) ||                              in_array($pinfo['extension'], array('c', 'h'))) {                            continue; // make sure we don't match php_blah.h                        }                        if ((strpos($pinfo['basename'], 'php_') === 0 &&                              $pinfo['extension'] == 'dll') ||                              // most unices                              $pinfo['extension'] == 'so' ||                              // hp-ux                              $pinfo['extension'] == 'sl') {                            $extrainfo[] = 'You should add "extension=' . $pinfo['basename']                                . '" to php.ini';                            break;                        }                    }                }                if ($this->config->get('verbose') > 0) {                    $channel = $param->getChannel();                    $label = $reg->parsedPackageNameToString(                        array(                            'channel' => $channel,                            'package' => $param->getPackage(),                            'version' => $param->getVersion(),                        ));                    $out = array('data' => "$command ok: $label");                    if (isset($info['release_warnings'])) {                        $out['release_warnings'] = $info['release_warnings'];                    }                    $this->ui->outputData($out, $command);                    if (!isset($options['register-only']) && !isset($options['offline'])) {                        if ($this->config->isDefinedLayer('ftp')) {                            PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);                            $info = $this->installer->ftpInstall($param);                            PEAR::staticPopErrorHandling();                            if (PEAR::isError($info)) {                                $this->ui->outputData($info->getMessage());

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -