示例#1
0
     * @param string $user_file   (optional) file to read PEAR user-defined
     *                            options from
     * @param string $system_file (optional) file to read PEAR system-wide
     *                            defaults from
     *
     * @static
     * @return bool
     * @access public
     * @since  version 1.6.0 (2005-01-03)
     */
    function packageInstalled($name, $version = null, $channel = null, $user_file = '', $system_file = '')
    {
        $config =& PEAR_Config::singleton($user_file, $system_file);
        $reg =& $config->getRegistry();
        if (is_null($version)) {
            return $reg->packageExists($name, $channel);
        } else {
            $info =& $reg->getPackage($name, $channel);
            if (is_object($info)) {
                $installed['version'] = $info->getVersion();
            } else {
                $installed = $info;
            }
            return version_compare($version, $installed['version'], '<=');
        }
    }
}
if (isset($_GET['pear_image'])) {
    PEAR_Info::pearImage();
    exit;
}