virus.bat.danger.genrunurLa是什么

AVG - 免费杀毒软件 - 中文免费正版杀毒软件
为中小企业提供极致防护
为中小企业提供最强的保护
立即对您的企业进行安全自检
并获得度身定做的安全解决方法
提供最新的用户指南,视频,
教程或案例研究
全新设计! 使用更便捷基本的保护。
屡获殊荣的反病毒防护软件
更快的扫描和PC启动
为个人隐私提供基础防护
检测并阻止病毒、威胁和恶意软件
每个人都需要的简单易用的基本保护
我们的任务是在病毒到入侵您的电脑之前就阻止它。我们在您打开文件之前就检查它们, 我们在您点击Facebook的链接之前检查它,我们在您的邮件还没到达您的邮箱前检查它,我们在您访问一个网页之前就检查它。这样全面的保护让您高枕无忧地使用电脑
AntiVirus, AntiMalware (AVG Resident Shield), AVG Anti-Rootkit, AVG Email Scanner (AVG邮件扫描组件), AVG Protective Cloud Technology (AVG云保护技术), AVG Community Protection Network (AVG 社群网络保护), AVG LinkScanner& Surf-Shield (在线防护组件), AVG Social Networking Protection (AVG社交网络保护)
AVG反病毒组件
帮助您阻止、删除、预防病毒,蠕虫病毒或木马的传播。.
AVG反恶意软件组件
检查您打开、复制或保存的文件,并及时阻止任何企图感染您的电脑的病毒或者恶意软件。
AVG Anti-Rootkit
检测、删除和隐藏那些控制您电脑的恶意软件的隐匿程序。
AVG Email Scanner (AVG邮件扫描组件)
我们将有效地检测您收到的邮件附件,及时删除可能会损害您电脑的附件。这个组件还可以作为一个插件内置与Microsoft Outlook2010内或者其他的诸如POP3、SMTP和IMAP账户内。
AVG Protective Cloud Technology (AVG云保护技术)
通过实时更新我们的反病毒软件可以有效识别和阻止来自“云端”的威胁
AVG Community Protection Network (AVG 社群网络保护)
我们可以及时我社区内每个成员遇到的威胁转换为所需的解决方案。该功能已经加入到AVG社区,
AVG LinkScanner& Surf-Shield (在线防护组件)
全新的智能防护技术可以有效地识别和阻止受感染或非法网站。如果该组件检测到任何威胁,在您未点击这个站点前,它会立即提示该威胁并阻止您登陆该网站。
AVG Social Networking Protection (AVG社交网络保护)
通过检查像”脸书“、”推特“这样的社交网络内互相交换的链接以达到保护您和您朋友的电脑安全。
了解更多关闭
阻止间谍软件入侵和预防数据丢失
您监控上网行为必不可少的工具
您的隐私很重要,无论是您的身份信息还是其他您需要使用的数据,我们都为它们提供完全保护
AVG Do Not
Track 反跟踪器, AVG Identity Protection组件, AVG反间谍软件组件, AVG WiFi 卫士
AVG Do Not
Track 反跟踪器
它可以帮你找出哪些网站正在收集您的网上活动的数据,并让您选择是否允许这种行为进行下去。它可以作为一个单独的插件工具栏来帮助您。该组件支持Internet Explorer&,Mozilla Firefox&和谷歌Chrome&。浏览器
AVG Identity Protection&
当您忙于线上业务时候,我们不仅能有效地保护您的个人信息,还可以有力地组织犯罪组织在线窃取您电脑上的个人数据。
Anti-Spyware
保持您个人信息的充分安全,远离间谍软件和广告软件对您的侵扰。
AVG WiFi Guard
帮助您识别可能含有威胁无线热点。我们在试图搜寻无线热点的时候很容易被黑客入侵,AVG该项功能可以有效阻止这一威胁。
了解更多关闭
让您的电脑运行更快速
杀毒软件不应拖慢您的电脑运行速度!
我们的产品不仅具有智能扫描功能,还能让您的电脑运行更加快速。
AVG加速扫描, 游戏模式, AVG智能扫描
AVG智能扫描
全新的扫描技术极大地缩短了扫描时间,比如根据文件保存在硬盘时间的先后顺序进行扫描
我们的扫描和更新不会拖慢您游戏运行的速度。同时也可以保护您的网络游戏免受黑客的骚扰。
AVG智能扫描
在您的电脑空闲时,我们将启用我们高优先的智能扫描模式;而当您轻轻敲击鼠标和键盘时,我们会采用低优先的扫描模式。我们在扫描时,会忽略已扫描过的和已知的安全文件,这会大大改善扫描时间。
了解更多关闭
电脑硬件需求
基本系统需求
Intel Pentium 1.5 GHz or faster
512 MB of RAM
硬盘所需空间(本产品安装需求)
建议系统需求
Intel Pentium 1.8 GHz or faster
512 MB RAM
硬盘所需空间(本产品安装需求)
网页浏览器
AVG LinkScanner& 技术适用于:
Microsoft Internet Explorer
Mozilla Firefox
Google Chrome
AVG杀毒永久免费版 可用于:
MS Windows XP
MS Windows XP Pro x64
MS Windows Vista
MS Windows Vista x64 Edition
MS Windows 7
MS Windows 7 x64 Edition
&|&(C) 2015 AVG Technologies&|&京ICP备号<?php //; echo "YOU NEED TO RUN THIS SCRIPT WITH PHP!"; echo "Point your webbrowser to it or run: php -q go-pear.php"; exit # -*- PHP -*-
# The PEAR installation wizard, both webbased or command line.
# Webbased installation:
# 1) Download this file and save it as go-pear.php
# 2) Put go-pear.php on your webserver, where you would put your website
# 3) Open http://yourdomain.example.org/go-pear.php in your browser
# 4) Follow the instructions, done!
# Command-line installation (for advanced users):
# 1) Download this file and save it as go-pear.php
# 2) Open a terminal/command prompt and type: php -q go-pear.php
# 3) Follow the instructions, done!
# * Get the latest go-pear version from http://pear.php.net/go-pear
# * This installer requires PHP 4.3.0 or newer.
# * On windows, the PHP CLI binary is php.exe, don't forget the -q option if using the CGI binary.
# * The default for the command-line installation is a system-wide configuration file,
For a local install use: php -q go-pear.php local
* go-pear is the online PEAR installer: just download it and run it
* (through a browser or command line), it will set up a minimal PEAR
* installation that will be ready for immediate use.
* @license
http://www.php.net/license/2_02.txt
PHP License 2.02
* @version
http://pear.php.net/package/pearweb_gopear
Tomas V.V.Cox
Stig Bakken
Christian Dickmann
Pierre-Alain Joye
Greg Beaver
$sapi_name = php_sapi_name();
$safe_mode = (bool)ini_get('safe_mode');
if (!$safe_mode) {
set_time_limit(0);
@ob_end_clean();
ob_implicit_flush(true);
define('WEBINSTALLER', ($sapi_name != 'cli' && !(substr($sapi_name,0,3)=='cgi' && !isset($_SERVER['GATEWAY_INTERFACE']))));
ini_set('track_errors', true);
ini_set('html_errors', WEBINSTALLER);
ini_set('magic_quotes_runtime', false);
error_reporting( E_ALL & ~E_NOTICE);
define('WINDOWS', (substr(PHP_OS, 0, 3) == 'WIN'));
define('GO_PEAR_VER', '1.1.6');
define('WIN32GUI', !WEBINSTALLER && WINDOWS && $sapi_name=='cli' && which('cscript'));
* See bug #23069
if ( WEBINSTALLER && WINDOWS ) {
$php_sapi_name = win32DetectPHPSAPI();
if($php_sapi_name=='cgi'){
$msg = nl2br("
Sorry! The PEAR installer actually does not work on Windows platform
using CGI and Apache. Please install the module SAPI (see
http://www.php.net/manual/en/install.apache.php for the instructions) or
use the CLI (cli\php.exe) in the console.
displayHTML('error', $msg);
if (WEBINSTALLER && isset($_GET['action']) && $_GET['action'] == 'img' && isset($_GET['img'])) {
switch ($_GET['img'])
case 'note':
case 'pearlogo':
case 'smallpear':
showImage($_GET['img']);
// Check if PHP version is sufficient
$phpVersion = phpversion();
if (function_exists("version_compare") && version_compare($phpVersion, "4.4",'=')) {
die("Sorry!
Your PHP version is too new ($phpVersion) for this go-pear.
Instead use http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.
Thank you for your coopertion and sorry for the inconvenience!
$gopear_bundle_dir = dirname(__FILE__).'/go-pear-bundle';
$bootstrap_files = array(
'PEAR5.php'
=> '/pear/pear-core/master/PEAR5.php',
'PEAR.php'
=> '/pear/pear-core/master/PEAR.php',
'Archive/Tar.php'
=> '/pear/Archive_Tar/master/Archive/Tar.php',
'Console/Getopt.php'
=> '/pear/Console_Getopt/trunk/Console/Getopt.php',
$bootstrap_pkgs = array( // uses URL like http://pear.php.net/get/%s
'Structures_Graph'
$installer_packages = array(
'Structures_Graph-stable',
'Archive_Tar-stable',
'Console_Getopt-stable',
$pfc_packages = array(
'PEAR_Frontend_Web-beta' => 'Webbased PEAR Installer',
'PEAR_Frontend_Gtk2' => 'Graphical PEAR installer based on PHP-Gtk2',
'MDB2' => 'database abstraction layer.',
$config_desc = array(
'prefix' => 'Installation prefix ($prefix)',
'temp_dir' => 'Temporary files directory',
'bin_dir' => 'Binaries directory',
'php_dir' => 'PHP code directory ($php_dir)',
'doc_dir' => 'Documentation base directory',
'data_dir' => 'Data base directory',
'test_dir' => 'Tests base directory',
if(!WEBINSTALLER && WINDOWS){
$config_desc['php_bin'] = 'php.exe path';
if (WEBINSTALLER) {
$config_desc['cache_dir'] = 'PEAR Installer cache directory';
$config_desc['cache_ttl'] = 'Cache TimeToLive';
$config_desc['webfrontend_file'] = 'Filename of WebFrontend';
$config_desc['php_bin'] = "php.exe path, optional (CLI command tools)";
if (my_env('HTTP_PROXY')) {
$http_proxy = my_env('HTTP_PROXY');
} elseif (my_env('http_proxy')) {
$http_proxy = my_env('http_proxy');
$http_proxy = '';
register_shutdown_function('bail');
detect_install_dirs();
if (WEBINSTALLER) {
@session_start();
// If welcome, just welcome
if (!isset($_GET['step'])) {
$_GET['step'] = 'Welcome';
/* clean up old sessions datas */
session_destroy();
if ($_GET['step'] == 'Welcome') {
displayHTML('Welcome');
if (!isset($_SESSION['go-pear']) || isset($_GET['restart'])) {
$_SESSION['go-pear'] = array(
'http_proxy' => $http_proxy,
'config' => array(
=> dirname(__FILE__),
=> $bin_dir,
=> $php_bin,
=> '$prefix/PEAR',
=> $doc_dir,
'data_dir'
=> $data_dir,
'test_dir'
=> $test_dir,
'temp_dir'
=> '$prefix/temp',
'cache_dir' => '$php_dir/cache',
'cache_ttl' => 300,
'webfrontend_file' => '$prefix/index.php',
'install_pfc' => true,
'install_optional_packages' => array(),
'DHTML' => true,
// save submited values
if ($_GET['step'] == 'install') {
$_SESSION['go-pear']['http_proxy'] = strip_magic_quotes($_POST['proxy']['host']).':'.strip_magic_quotes($_POST['proxy']['port']);
if ($_SESSION['go-pear']['http_proxy'] == ':') {
$_SESSION['go-pear']['http_proxy'] = '';
$config_errors = array();
foreach($_POST['config'] as $key => $value) {
$_POST['config'][$key] = strip_magic_quotes($value);
if ($key != 'cache_ttl' && $key != 'php_bin') {
if ( empty($_POST['config'][$key]) ) {
$config_errors[$key] = 'Please fill this path, you can use $prefix, $php_dir or a full path.';
if( sizeof($config_errors)>0){
$_GET['step'] = 'config';
$_SESSION['go-pear']['config'] = $_POST['config'];
$_SESSION['go-pear']['install_pfc'] = (isset($_POST['install_pfc']) && $_POST['install_pfc'] == 'on');
// webinstaller allows to choose pfc packages individually
foreach ($pfc_packages as $key => $value) {
$pos = array_search($key, $_SESSION['go-pear']['install_optional_packages']);
if (isset($_POST[$key]) && $_POST[$key] == 'on' && $pos === false) {
$_SESSION['go-pear']['install_optional_packages'][] = $
if (!isset($_POST[$key]) && $pos !== false) {
unset($_SESSION['go-pear']['install_optional_packages'][$pos]);
$_SESSION['go-pear']['DHTML'] = isset($_POST['BCmode']) ? false :
// export session values
$http_proxy = $_SESSION['go-pear']['http_proxy'];
$GLOBALS['config_vars'] = array_keys($config_desc);
array_unshift($GLOBALS['config_vars'], '');
unset($GLOBALS['config_vars'][0]); // make indices run from 1...
foreach($_SESSION['go-pear']['config'] as $var => $value) {
$install_pfc = $_SESSION['go-pear']['install_pfc'];
$install_optional_packages = $_SESSION['go-pear']['install_optional_packages'];
if ($_GET['step'] == 'config') {
displayHTML('config');
// Anything past this step has something to do with the installation
if (!WEBINSTALLER) {
$tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r');
if (!$tty) {
$tty = fopen('php://stdin', 'r');
$local = isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local';
if ($local) {
$local = "
Running in local install mode
} elseif (WINDOWS) {
$local = "
Use 'php " . $_SERVER['argv'][0] . " local' to install a local copy of PEAR.
print "Welcome to go-pear!
Go-pear will install the 'pear' command and all the files needed by
This command is your tool for PEAR installation and maintenance.
Go-pear also lets you download and install the following optional PEAR
packages: " . implode(', ', array_keys($pfc_packages)) . ".
If you wish to abort, press Control-C now, or press Enter to continue: ";
fgets($tty, 1024);
print "\n";
print "HTTP proxy (http://user:password@:port), or Enter for none:";
if (!empty($http_proxy)) {
print " [$http_proxy]";
print ": ";
$tmp = trim(fgets($tty, 1024));
if (!empty($tmp)) {
$http_proxy = $
$origpwd = getcwd();
$config_vars = array_keys($config_desc);
// make indices run from 1...
array_unshift($config_vars, "");
unset($config_vars[0]);
reset($config_vars);
$desclen = max(array_map('strlen', $config_desc));
$descfmt = "%-{$desclen}s";
$first = key($config_vars);
end($config_vars);
$last = key($config_vars);
$progress = 0;
* Checks PHP SAPI version under windows/CLI
if( WINDOWS && !WEBINSTALLER && $php_bin=='') {
We do not find any php.exe, please select the php.exe folder (CLI is
recommanded, usually in c:\php\cli\php.exe)
$php_bin_set =
} elseif ( WINDOWS && !WEBINSTALLER && strlen($php_bin) ) {
$php_bin_sapi = win32DetectPHPSAPI();
$php_bin_set =
switch($php_bin_sapi){
case 'cli':
case 'cgi':
We found php.exe under $php_bin, it uses a $php_bin_sapi SAPI. PEAR commandline
tool works well with it, if you have a CLI php.exe available, we
recommand to use it.
We found php.exe under $php_bin, it uses an unknown SAPI. PEAR commandline
tool has not been tested with it, if you have a CLI (or CGI) php.exe available,
we strongly recommand to use it.
while (!WEBINSTALLER) {
Below is a suggested file layout for your new PEAR installation.
change individual locations, type the number in front of the
directory.
Type 'all' to change all of them or simply press Enter to
accept these locations.
foreach ($config_vars as $n => $var) {
printf("%2d. $descfmt : %s\n", $n, $config_desc[$var], $$var);
print "\n$first-$last, 'all' or Enter to continue: ";
$tmp = trim(fgets($tty, 1024));
if ( empty($tmp) ) {
if( WINDOWS && !$php_bin_set ){
echo "**ERROR**
Please, enter the php.exe path.
if (isset($config_vars[(int)$tmp])) {
$var = $config_vars[(int)$tmp];
$desc = $config_desc[$var];
$current = $$
if(WIN32GUI){
$tmp = win32BrowseForFolder("$desc [$current] :");
print "$desc [$current] : ";
$tmp = trim(fgets($tty, 1024));
if(WINDOWS && $var=='php_bin' ){
if(file_exists($tmp.DIRECTORY_SEPARATOR.'php.exe')){
$tmp = $tmp.DIRECTORY_SEPARATOR.'php.exe';
$php_bin_sapi = win32DetectPHPSAPI();
if($php_bin_sapi=='cgi'){
******************************************************************************
NOTICE! We found php.exe under $php_bin, it uses a $php_bin_sapi SAPI.
PEAR commandline tool works well with it.
If you have a CLI php.exe available, we recommand to use it.
} elseif ($php_bin_sapi=='unknown') {
******************************************************************************
WARNING! We found php.exe under $php_bin, it uses an $php_bin_sapi SAPI.
PEAR commandline tool has not been tested with it.
If you have a CLI (or CGI) php.exe available, we strongly recommand to use it.
echo "php.exe (sapi: $php_bin_sapi) found.\n\n";
$php_bin_set =
echo "**ERROR**: no php.exe found in this folder.\n";
if (!empty($tmp) ) {
$$var = parse_dirname($tmp);
} elseif ($tmp == 'all') {
foreach ($config_vars as $n => $var) {
$desc = $config_desc[$var];
$current = $$
print "$desc [$current] : ";
$tmp = trim(fgets($tty, 1024));
if (!empty($tmp)) {
# Installation stuff
// expand all subvars in the config vars
foreach ($config_vars as $n => $var) {
for ($m = 1; $m <= count($config_vars); $m++) {
$var2 = $config_vars[$m];
$$var = str_replace('$'.$var2, $$var2, $$var);
$$var = parse_dirname($$var);
// temp dir stuff (separate for windows bugs)
if (!empty($temp_dir)) {
$_found = temp_dir($temp_dir);
$_found = temp_dir();
if (!$_found) {
if (!WEBINSTALLER) {
******************************************************************************
FATAL ERROR! We cannot initialize the temp directory. Please be sure to give
full write access to this directory and the install directory.
if (!empty($temp_dir)) {
print "'$temp_dir' was given.";
} else { // WEBINSTALLER
if (!is_dir($temp_dir)) {
$config_errors['temp_dir'] = 'FATAL ERROR! This directory does not exist and we can not create it. Create the directory manually or make sure we have full permission in its parent directory.';
if (!WINDOWS) {
$config_errors['temp_dir'] .= 'You can grant this permission by logging on to the server and issuing the following command:
mkdir '.dirname($temp_dir).' && chmod 0777 '.dirname($temp_dir).'';
} else { // is_dir(temp_dir)
$config_errors['temp_dir'] = 'FATAL ERROR! This directory exists, but we have no write permission in it.';
if (!WINDOWS) {
$config_errors['temp_dir'] .= 'You can grant this permission by logging on to the server and issuing the following command:
chmod 0777 '.$temp_dir.'';
if (@is_dir($ptmp)) {
chdir($ptmp);
// check every dir, existence and permissions
foreach ($config_vars as $var) {
if (!preg_match('/_dir$/', $var) || $var == 'temp_dir') {
if (!@is_dir($dir)) {
if (!mkdir_p($dir)) {
if (!WEBINSTALLER) {
$root = WINDOWS ? 'administrator' : 'root';
bail("Unable to create {$config_desc[$var]} $dir.
Run this script as $root or pick another location.\n");
} else { // WEBINSTALLER
$config_errors[$var] = 'ERROR! This directory does not exist and we can not create it. Create the directory manually or make sure we have full permission in its parent directory.';
if (!WINDOWS) {
$config_errors[$var] .= 'You can grant this permission by logging on to the server and issuing the following command:
mkdir '.dirname($dir).' && chmod 0777 '.dirname($dir).'';
if (WEBINSTALLER && @is_dir($dir) && !is_writable($dir)) {
$config_errors[$var] = 'ERROR! This directory exists, but we have no write permission in it.';
if (!WINDOWS) {
$config_errors[$var] .= 'You can grant this permission by logging on to the server and issuing the following command:
chmod 0777 '.$dir.'';
// check every file, existence and permissions
foreach ($config_vars as $var) {
if (!preg_match('/_file$/', $var)) {
$file = $$
$dir = dirname($file);
if (!file_exists($file) && !is_writable($dir)) {
if (!WEBINSTALLER) {
$root = WINDOWS ? 'administrator' : 'root';
bail("Unable to create {$config_desc[$var]} $file.
Run this script as $root or pick another location.\n");
} else { // WEBINSTALLER
$config_errors[$var] = 'ERROR! This file does not exist and we can not create it. Make sure we have full permission in its parent directory.';
if (!WINDOWS) {
$config_errors[$var] .= 'You can grant this permission by logging on to the server and issuing the following command:
chmod 0777 '.$dir.'';
} elseif (WEBINSTALLER && file_exists($file) && !is_writable($file)) {
$config_errors[$var] = 'ERROR! This file exists, but we have no write permission on it.';
if (!WINDOWS) {
$config_errors[$var] .= 'You can grant this permission by logging on to the server and issuing the following command:
chmod 0777 '.$file.'';
if (WEBINSTALLER) {
if ( isset($config_errors) && sizeof($config_errors) ) {
displayHTML('config');
if (isset($_SESSION['go-pear']['DHTML']) && $_SESSION['go-pear']['DHTML'] == true && $_GET['step'] == 'install') {
$_GET['step'] = 'preinstall';
if ($_GET['step'] != 'install' && $_GET['step'] != 'install-progress') {
displayHTML($_GET['step']);
if ($_GET['step'] == 'install-progress') {
displayHTMLHeader();
echo "Starting installation ...";
ob_start();
if (!WEBINSTALLER) {
$msg = "The following PEAR packages are bundled with PHP: " .
implode(', ', array_keys($pfc_packages));
print "\n" . wordwrap($msg, 75) . ".\n";
print "Would you like to install these as well? [Y/n] : ";
$install_pfc = !stristr(fgets($tty, 1024), "n");
$install_optional_packages = array();
print "\n";
# Download
if (function_exists('set_include_path')) {
set_include_path($ptmp);
ini_set('include_path', $ptmp);
if (!extension_loaded('zlib') && !WEBINSTALLER) { // In Web context we could be in multithread env which makes dl() end up with a fatal error.
if (WINDOWS) {
@dl('php_zlib.dll');
} elseif (PHP_OS == 'HP-UX') {
@dl('zlib.sl');
} elseif (PHP_OS == 'AIX') {
@dl('zlib.a');
@dl('zlib.so');
if (!extension_loaded('zlib')) {
$urltemplate = 'http://pear.php.net/get/%s?uncompress=yes';
$have_gzip =
$urltemplate = 'http://pear.php.net/get/%s';
$have_gzip =
print "Loading zlib: ".($have_gzip ? 'ok' : 'failed')."\n";
if (!$have_gzip) {
print "Downloading uncompressed packages\n";
if ($install_pfc) {
$to_install = array_merge($installer_packages, array_keys($pfc_packages));
$to_install = $installer_
// webinstaller allows to choose pfc packages individually
foreach ($pfc_packages as $pkg => $desc) {
if (in_array($pkg, $install_optional_packages)) {
array_push($to_install, $pkg);
// gopear_bundle usage
$local_dir = array();
if (file_exists($gopear_bundle_dir) || is_dir($gopear_bundle_dir)) {
$dh = @opendir($gopear_bundle_dir);
while($file = @readdir($dh)) {
if ($file == '.' || $file == '..' || !is_file($gopear_bundle_dir.'/'.$file)) {
$_pos = strpos($file, '-');
if ($_pos === false) {
$local_dir[$file] = $
$local_dir[substr($file, 0, $_pos)] = $
closedir($dh);
unset($dh, $file, $_pos);
print "\n".'Bootstrapping Installer...................'."\n";
displayHTMLProgress($progress = 5);
// Bootstrap needed ?
$nobootstrap =
if (is_dir($php_dir)) {
$nobootstrap =
foreach ($bootstrap_files as $file => $url) {
$nobootstrap &= is_file($php_dir.'/'.$file);
if ($nobootstrap) {
print('Using previously install ... ');
if (function_exists('set_include_path')) {
set_include_path($php_dir);
ini_set('include_path', $php_dir);
include_once 'PEAR.php';
print "ok\n";
foreach($bootstrap_files as $name => $url) {
$file = basename($name);
$dir = dirname($name);
print 'Bootstrapping '.$name.'............';
displayHTMLProgress($progress += round(14 / count($bootstrap_files)));
if ($dir != '' && $dir != '.') {
mkdir($dir, 0700);
if (in_array($file, $local_dir)) {
copy($gopear_bundle_dir.'/'.$file, $name);
echo '(local) ';
download_url($url, $name, $http_proxy);
echo '(remote) ';
include_once $
print "ok\n";
unset($nobootstrap, $file, $url, $name, $dir);
PEAR::setErrorHandling(PEAR_ERROR_DIE, "\n%s\n");
print "\n".'Extracting installer..................'."\n";
displayHTMLProgress($progress = 20);
// Extract needed ?
$noextract =
if (is_dir($php_dir)) {
$noextract = @include_once 'PEAR/Registry.php';
if ($noextract) {
$registry = new PEAR_Registry($php_dir);
foreach ($bootstrap_pkgs as $pkg) {
$noextract &= $registry->packageExists($pkg);
if ($noextract) {
print('Using previously installed installer ... ');
print "ok\n";
$bootstrap_pkgs_tarballs = array();
foreach ($bootstrap_pkgs as $pkg) {
$tarball =
if (isset($local_dir[$pkg])) {
echo str_pad("Using local package: $pkg", max(38,21+strlen($pkg)+4), '.');
copy($gopear_bundle_dir.'/'.$local_dir[$pkg], $local_dir[$pkg]);
$tarball = $local_dir[$pkg];
print str_pad("Downloading package: $pkg", max(38,21+strlen($pkg)+4), '.');
$url = sprintf($urltemplate, $pkg);
$pkg = str_replace('-stable', '', $pkg);
$tarball = download_url($url, null, $http_proxy);
displayHTMLProgress($progress += round(19 / count($bootstrap_pkgs)));
$fullpkg = substr($tarball, 0, strrpos($tarball, '.'));
$tar = new Archive_Tar($tarball, $have_gzip);
if (!$tar->extractModify($ptmp, $fullpkg)) {
bail("Extraction for $fullpkg failed!\n");
$bootstrap_pkgs_tarballs[$pkg] = $
print "ok\n";
unset($noextract, $registry, $pkg, $tarball, $url, $fullpkg, $tar);
print "\n".'Preparing installer..................'."\n";
displayHTMLProgress($progress = 40);
// Default for sig_bin
putenv('PHP_PEAR_SIG_BIN=""');
// Default for sig_keydir
putenv('PHP_PEAR_SIG_KEYDIR=""');
putenv('PHP_PEAR_DOWNLOAD_DIR=' . $temp_dir . '/download');
putenv('PHP_PEAR_TEMP_DIR=' . $temp_dir);
include_once "PEAR/Config.php";
include_once "PEAR/Command.php";
include_once "PEAR/Registry.php";
if (WEBINSTALLER || isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local') {
$config = &PEAR_Config::singleton($prefix."/pear.conf", '');
$config = &PEAR_Config::singleton();
$config->set('preferred_state', 'stable');
foreach ($config_vars as $var) {
if (isset($$var) && $$var != '') {
$config->set($var, $$var);
$config->set('download_dir', $temp_dir . '/download');
$config->set('temp_dir', $temp_dir);
$config->set('http_proxy', $http_proxy);
$config->store();
$registry = new PEAR_Registry($php_dir);
PEAR_Command::setFrontendType('CLI');
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently
$ch_cmd = &PEAR_Command::factory('update-channels', $config);
$ch_cmd->run('update-channels', $options, array());
PEAR::staticPopErrorHandling(); // reset error handling
unset($ch_cmd);
print "\n".'Installing selected packages..................'."\n";
displayHTMLProgress($progress = 45);
$install = &PEAR_Command::factory('install', $config);
foreach ($to_install as $pkg) {
$pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
if (in_array($pkg, $installer_packages)) {
$options = array('nodeps' => true);
$options = array('onlyreqdeps' => true);
if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) {
print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n");
displayHTMLProgress($progress += round(50 / count($to_install)));
$pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
if (in_array($pkg_basename, $bootstrap_pkgs)) {
print(str_pad("Installing bootstrap package: $pkg_basename", max(50,30+strlen($pkg_basename)+4), '.')."...");
displayHTMLProgress($progress += round(25 / count($to_install)));
$install->run('install', $options, array($bootstrap_pkgs_tarballs[$pkg_basename]));
} elseif (isset($local_dir[$pkg_basename])) {
print(str_pad("Installing local package: $pkg", max(50,26+strlen($pkg)+4), '.')."...");
displayHTMLProgress($progress += round(25 / count($to_install)));
$install->run('install', $options, array($gopear_bundle_dir.'/'.$local_dir[$pkg_basename]));
} else { // no local copy
print(str_pad("Downloading and installing package: $pkg", max(50,36+strlen($pkg)+4), '.')."...");
displayHTMLProgress($progress += round(25 / count($to_install)));
$install->run('install', $options, array($pkg));
displayHTMLProgress($progress += round(25 / count($to_install)));
unset($pkg, $pkg_basename, $options, $bootstrap_pkgs_tarballs);
/* TODO: Memory exhaustion in webinstaller : / (8Mb)
print "\n".'Making sure every package is at the latest version........';
$install->run('upgrade-all', array('soft' => true), array());
print "ok\n";
unset($config, $registry, $install);
displayHTMLProgress($progress = 99);
// Base installation finished
ini_restore("include_path");
if (!WEBINSTALLER) {
$sep = WINDOWS ? ';' : ':';
$include_path = explode($sep, ini_get('include_path'));
if (WINDOWS) {
$t = strtolower($php_dir);
foreach($include_path as $path) {
if ($t==strtolower($path)) {
$found = in_array($php_dir, $include_path);
if (!$found) {
******************************************************************************
The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.
if ( $php_ini = getPhpiniPath() ) {
print "\n\nWould you like to alter php.ini ? [Y/n] : ";
$alter_phpini = !stristr(fgets($tty, 1024), "n");
if( $alter_phpini ) {
alterPhpIni($php_ini);
if (WINDOWS) {
Please look over your php.ini file to make sure
$php_dir is in your include_path.";
I will add a workaround for this in the 'pear' command to make sure
the installer works, but please look over your php.ini or Apache
configuration to make sure $php_dir is in your include_path.
Current include path
: ".ini_get('include_path')."
Configured directory
: $php_dir
Currently used php.ini (guess) : $php_ini
print "Press Enter to continue: ";
fgets($tty, 1024);
$pear_cmd = $bin_dir . DIRECTORY_SEPARATOR . 'pear';
$pear_cmd = WINDOWS ? strtolower($pear_cmd).'.bat' : $pear_
// check that the installed pear and the one in tha path are the same (if any)
$pear_old = which(WINDOWS ? 'pear.bat' : 'pear', $bin_dir);
if ($pear_old && ($pear_old != $pear_cmd)) {
// check if it is a link or symlink
$islink = WINDOWS ? false : is_link($pear_old) ;
if ($islink && readlink($pear_old) != $pear_cmd) {
print "\n** WARNING! The link $pear_old does not point to the " .
"installed $pear_cmd\n";
} elseif (is_writable($pear_old) && !is_dir($pear_old)) {
rename($pear_old, "{$pear_old}_old");
print "\n** WARNING! Backed up old pear to {$pear_old}_old\n";
print "\n** WARNING! Old version found at $pear_old, please remove it or ".
"be sure to use the new $pear_cmd command\n";
print "\nThe 'pear' command is now at your service at $pear_cmd\n";
// Alert the user if the pear cmd is not in PATH
$old_dir = $pear_old ? dirname($pear_old) :
if (!which('pear', $old_dir)) {
** The 'pear' command is not currently in your PATH, so you need to
** use '$pear_cmd' until you have added
** '$bin_dir' to your PATH environment variable.
print "Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.
For more information about PEAR, see:
http://pear.php.net/faq.php
http://pear.php.net/manual/
Thanks for using go-pear!
if (WEBINSTALLER) {
print "\n".'Writing WebFrontend file ... ';
@unlink($webfrontend_file); //Delete old one
copy ( $doc_dir.DIRECTORY_SEPARATOR.
'PEAR_Frontend_Web'.DIRECTORY_SEPARATOR.
'docs'.DIRECTORY_SEPARATOR.
'index.php.txt',
$webfrontend_file
print "ok\n";
if (!file_str_replace($webfrontend_file, '@pear_dir@', $GLOBALS['php_dir'])) {
print "You need to replace @pear_dir@ with the actual /path/to/PEAR/ in index.php\n";
if ($_GET['step'] == 'install-progress') {
displayHTMLProgress($progress = 100);
ob_end_clean();
displayHTMLInstallationSummary();
displayHTMLFooter();
$out = ob_get_contents();
$out = explode("\n", $out);
foreach($out as $line => $value) {
if (preg_match('/ok$/', $value)) {
$value = preg_replace('/(ok)$/', '\1', $value);
if (preg_match('/^install ok:/', $value)) {
$value = preg_replace('/^(install ok:)/', '\1', $value);
if (preg_match('/^Warning:/', $value)) {
$value = ''.$value.'';
$out[$line] = $
$out = nl2br(implode("\n",$out));
ob_end_clean();
displayHTML('install', $out);
// Little hack, this will be fixed in PEAR later
if ( WINDOWS ) {
clearstatcache();
@unlink($bin_dir.DIRECTORY_SEPARATOR.'.tmppear');
// Little hack, this will be fixed in PEAR later
if ( WINDOWS ) {
clearstatcache();
@unlink($bin_dir.DIRECTORY_SEPARATOR.'.tmppear');
if (WINDOWS && !WEBINSTALLER) {
win32CreateRegEnv();
// Set of functions following
* Parse the given dirname
* eg. expands '~' etc
* @param string $dir directory, from input
* @return string parsed directory
function parse_dirname($dir)
if (!isset($_ENV['HOME'])) {
if (strpos($dir, '~') === 0) {
if (WEBINSTALLER) {
die('Can\'t use the \'~\' symbol for homedir substitution, write the directory out in full.');
die('Can\'t use the \'~\' symbol for homedir substitution, write the directory out in full.');
$home_root = $_ENV['HOME'];
// first strip last slash, if available
if (substr($home_root, -1) == DIRECTORY_SEPARATOR) {
$home_root = substr($home_root, 0, -1);
if (strpos($dir, '~/') === 0) {
// eg ~/ = /home/tias/
$dir = substr_replace($dir, $home_root, 0, 1);
} elseif (strpos($dir, '~') === 0) {
// eg ~tias/ = /home/tias/
// then delete user-dir
$home_root = dirname($home_root) . DIRECTORY_SEPARATOR;
$dir = substr_replace($dir, $home_root, 0, 1);
// {{{ file_str_replace()
function file_str_replace($filename, $search, $replace)
$str = file_get_contents($filename);
$str = str_replace($search, $replace, $str);
if (function_exists('file_put_contents')
&& file_put_contents($filename, $str) !== false)
$fh = fopen($filename, 'w');
if ($fh) {
$bytes = fwrite($fh, $data);
fclose($fh);
// {{{ download_url()
function download_url($url, $destfile = null, $proxy = null)
$use_suggested_filename = ($destfile === null);
if ($use_suggested_filename) {
$destfile = basename($url);
$tmp = parse_url($url);
if ($tmp['scheme'] == 'https' || $tmp['scheme'] == 'ssl') {
$tmp['port'] = 443;
if (empty($tmp['port'])) {
$tmp['port'] = 80;
if (empty($proxy)) {
if ($isSSL) {
$fp = fsockopen("ssl://$tmp[host]", $tmp['port'], $errno, $errstr);
$fp = fsockopen($tmp['host'], $tmp['port'], $errno, $errstr);
// print "\nconnecting to $tmp[host]:$tmp[port]\n";
$tmp_proxy = parse_url($proxy);
= $tmp_proxy['host'];
= $tmp_proxy['port'];
$fp = fsockopen($phost, $pport, $errno, $errstr);
//print "\nconnecting to $phost:$pport\n";
if (!$fp) {
bail("download of $url failed: $errstr ($errno)\n");
// If valid URL but error, no CURL extentions installed
if (empty($proxy)) {
$path = $tmp['path'];
if ($isSSL) {
$path = "ssl://$tmp[host]:$tmp[port]$tmp[path]";
$path = "http://$tmp[host]:$tmp[port]$tmp[path]";
if (isset($tmp['query'])) {
$path .= "?$tmp[query]";
if (isset($tmp['fragment'])) {
$path .= "#$tmp[fragment]";
$request = "GET $path HTTP/1.0\r\nHost: $tmp[host]:$tmp[port]\r\n".
"User-Agent: go-pear\r\n";
if (!empty($proxy) && $tmp_proxy['user'] != '') {
$request .= 'Proxy-Authorization: Basic ' .
base64_encode($tmp_proxy['user'] . ':' . $tmp_proxy['pass']) . "\r\n";
$request .= "\r\n";
fwrite($fp, $request);
$cdh = "content-disposition:";
$cdhl = strlen($cdh);
$content_length = 0;
while ($line = fgets($fp, 2048)) {
if (trim($line) == '') {
if (preg_match('/^Content-Length: (.*)$/i', $line, $matches)) {
$content_length = trim($matches[1]);
if ($use_suggested_filename && !strncasecmp($line, $cdh, $cdhl)) {
if (preg_match('@filename="([^"]+)"@', $line, $matches)) {
$destfile = basename($matches[1]);
displayHTMLSetDownload($destfile);
$wp = fopen($destfile, "wb");
if (!$wp) {
bail("could not open $destfile for writing\n");
$bytes_read = 0;
$progress = 0;
while ($data = fread($fp, 2048)) {
fwrite($wp, $data);
$bytes_read += strlen($data);
if ($content_length != 0 && floor($bytes_read * 10 / $content_length) != $progress) {
$progress = floor($bytes_read * 10 / $content_length);
displayHTMLDownloadProgress($progress * 10);
displayHTMLDownloadProgress(100);
fclose($fp);
fclose($wp);
displayHTMLSetDownload('');
// {{{ which()
function which($program, $dont_search_in = false)
if (WINDOWS) {
if ($_path=my_env('Path')) {
$dirs = explode(';', $_path);
$dirs = explode(';', my_env('PATH'));
foreach ($dirs as $i => $dir) {
$dirs[$i] = strtolower(realpath($dir));
if ($dont_search_in) {
$dont_search_in = strtolower(realpath($dont_search_in));
if ($dont_search_in &&
($key = array_search($dont_search_in, $dirs)) !== false)
unset($dirs[$key]);
foreach ($dirs as $dir) {
$dir = str_replace('\\\\', '\\', $dir);
if (!strlen($dir)) {
if ($dir{strlen($dir) - 1} != '\\') {
$dir .= '\\';
$tmp = $dir . $
$info = pathinfo($tmp);
if (in_array(strtolower($info['extension']),
array('exe', 'com', 'bat', 'cmd'))) {
if (file_exists($tmp)) {
return strtolower($tmp);
} elseif (file_exists($ret = $tmp . '.exe') ||
file_exists($ret = $tmp . '.com') ||
file_exists($ret = $tmp . '.bat') ||
file_exists($ret = $tmp . '.cmd')) {
return strtolower($ret);
$dirs = explode(':', my_env('PATH'));
if ($dont_search_in &&
($key = array_search($dont_search_in, $dirs)) !== false)
unset($dirs[$key]);
foreach ($dirs as $dir) {
if (is_executable("$dir/$program")) {
return "$dir/$program";
// {{{ bail()
function bail($msg = '')
global $ptmp, $
if ($ptmp && is_dir($ptmp)) {
chdir($origpwd);
rm_rf($ptmp);
if ($msg && WEBINSTALLER) {
$msg = @ob_get_contents() ."\n\n". $
@ob_end_clean();
displayHTML('error', $msg);
if ($msg && !WEBINSTALLER) {
die($msg);
// {{{ mkdir_p()
function mkdir_p($dir, $mode = 0777)
if (@is_dir($dir)) {
$parent = dirname($dir);
if (!@is_dir($parent) && $parent != $dir) {
$ok = mkdir_p(dirname($dir), $mode);
if ($ok) {
$ok = @mkdir($dir, $mode);
// This is handled in the caller function (eg. webfrontend or not)
//if (!$ok) {
print "mkdir failed: \n";
// {{{ rm_rf()
function rm_rf($path)
if (@is_dir($path) && is_writable($path)) {
$dp = opendir($path);
while ($ent = readdir($dp)) {
if ($ent == '.' || $ent == '..') {
$file = $path . DIRECTORY_SEPARATOR . $
if (@is_dir($file)) {
rm_rf($file);
} elseif (is_writable($file)) {
unlink($file);
echo $file . "is not writable and cannot be removed.
Please fix the permission or select a new path.\n";
closedir($dp);
return rmdir($path);
return @unlink($path);
// {{{ tmpdir()
* Fixes for winXP/wrong tmp set by Urs Gehrig (urs@circle.ch)
function temp_dir($default=false)
global $ptmp, $
if ($default) {
if (!@is_dir($default)) {
if (!mkdir_p($default)) {
/* try it really, is_writable is buggy with openbasedir */
$fh = @fopen(realpath($default) . "/test","wb");
if ($fh) {
// desparately try to set temp dir any possible way, see bug #13167
$ptmp = $_temp = $temp_dir = $
putenv('TMPDIR='.$default);
if (WINDOWS){
if ( my_env('TEMP') ) {
$_temp = my_env('TEMP');
} elseif ( my_env('TMP') ) {
$_temp = my_env('TMP');
} elseif ( my_env('windir') ) {
$_temp = my_env('windir') . '\temp';
} elseif ( my_env('SystemRoot') ) {
$_temp = my_env('SystemRoot') . '\temp';
// handle ugly ENV var like \Temp instead of c:\Temp
$dirs = explode("\\", realpath($_temp));
if(strpos($_temp, ":") != 1) {
unset($_temp);
$_dirs = array();
foreach($dirs as $val) {
if((boolean)$val ) {
$_dirs[] = str_replace("/", "",
unset($dirs);
$dirs = $_
array_unshift ($dirs, "c:" );
$_temp = $dirs[0];
for($i = 1;$i
The following PEAR packages will be installed. You can select some optional
packages to be installed by go-pear too:
&PackageDescription
(required)PEAR corePEAR Base System
// automatically install frontend
$frontend = 'PEAR_Frontend_Web-beta';
print('(required)'.$frontend.''.$GLOBALS['pfc_packages'][$frontend].'');
unset($GLOBALS['pfc_packages'][$frontend]);
foreach ($GLOBALS['pfc_packages'] as $var => $descr) {
$checked = '';
if (in_array($var, $GLOBALS['install_optional_packages'])) { $checked = ' checked'; }
printf('%s%s',
Configuration
Below is a suggested file layout for your new PEAR installation.
$error_class = '';
if (is_array($GLOBALS['config_errors']) && array_key_exists($var, $GLOBALS['config_errors'])) {
// www_error for this var
$error_class = ' class="red"';
printf('%d. %s',
$GLOBALS['config_desc'][$var],
$_SESSION['go-pear']['config'][$var],
$error_class);
// prefix dir, check perm (uses GLOBALS: resolved subvars)
if ($n == 1 && is_dir($GLOBALS[$var]) && !is_writable($GLOBALS[$var])) {
$error = 'WARNING! No permission to create subdirectories in this prefix dir. Unless you fix this, the default configuration will not work.';
if (!WINDOWS) {
$error .= 'You can grant this permission by logging on to the server and issuing the following command:
chmod 0777 '.$GLOBALS[$var].'';
print(''.$error.'');
if (is_array($GLOBALS['config_errors']) && array_key_exists($var, $GLOBALS['config_errors'])) {
// www_error for this var
print(''.$GLOBALS['config_errors'][$var].'');
HTTP proxy (host:port)
<input type="text" name="proxy[host]" value=""> : <input type="text" name="proxy[port]" value="" size="6">
Compatibility-Mode for old non-DOM Browsers
<img src="?action=img&img=note" alt="" />
Warning: Your PHP version (4.1.1) might be imcompatible with go-pear due to a bug
in your PHP binary. If the installation crashes you might want to update your PHP version.
<img src="?action=img&img=note" alt="" />
Note: Installation might take some time, because go-pear has to
download all needed files from pear.php.net. Just be patient and wait for
the next page to load.
Installation Complete - Summary
Installation in progress ...
(If the page stops loading before the end of the installation, then just reload it)
<iframe src="?step=install-progress&" width="700" height="700" frameborder="0" marginheight="0" marginwidth="0">
// {{{ displayHTMLInstallationSummary
function displayHTMLInstallationSummary($data = '')
= $GLOBALS['webfrontend_file'];
$doc_root = strip_magic_quotes($_SERVER['DOCUMENT_ROOT']);
$file_dir = dirname(__FILE__);
if ( WINDOWS ) {
= str_replace('/', '\\', strtolower($file));
$doc_root = str_replace('/', '\\', strtolower($doc_root));
$file_dir = str_replace('/', '\\', strtolower($file_dir));
if ($doc_root && substr($file, 0, strlen($doc_root)) == $doc_root) {
$next = substr($file, strlen($doc_root));
// need leading / (file - docroot = path from docroot)
if (substr($next, 0, 1) != '/') {
$next = '/'.$
} else if ($file_dir && substr($file, 0, strlen($file_dir)) == $file_dir) {
$next = substr($file, strlen($file_dir));
// strip leading / (file - file_dir = path from go-pear file)
if (substr($next, 0, 1) == '/') {
$next = substr($next, 1, strlen($next));
if ($data) {
Installation Completed !
<img src="?action=img&img=note" alt="" />
Note: To use PEAR without any problems you need to add your
PEAR Installation path ()
Using a .htaccess file or directly edit httpd.conf would be working solutions
for Apache running servers, too.
For more information about PEAR, see:
Thanks for using go-pear!
<img src="?action=img&img=note" alt="" />
Warning: Can not determine the URL of the freshly installed Web Frontend
Please access it manually !
Start Web Frontend of the PEAR Installer &&
Start Web Frontend of the PEAR Installer &&
'type' => 'gif',
'data' => 'R0lGODlhEQATAMQAAAAAACqUACiTAC2WAC+YAzKZBTSaBsHgszOZADCYADmcB4TCZp3Ohtfrzd/v1+by4PD47DaaAz+fDUijF2WyOlCoHvT58VqtJPn893y+S/v9+f7//f3+/Pz9+////////ywAAAAAEQATAAAFkqAnjiR5NGXqcdpCoapnMVRdWbEHUROVVROYalHJTCaVAKWTcjAUGckgQY04SJAFMhJJIL5e4a5I6X6/gwlkRIwOzucAY9SYZBRvOCKheIwYFxR5enxCLhVeemAHbBQVg4SMIoCCinsKVyIOdlKKAhQcJFpGiWgFQiIYPxeJCQEEcykcDIgDAwYUkjEWB70NGykhADs=',
'pearlogo' => array(
'type' => 'gif',
'data' => 'R0lGODlhaAAyAMT/AMDAwP3+/TWaAvD47Pj89vz++zebBDmcBj6fDEekFluvKmu3PvX68ujz4XvBS8LgrNXqxeHw1ZnPaa/dgvv9+cLqj8LmltD2msnuls3xmszwmf7+/f///wAAAAAAAAAAACH5BAEAAAAALAAAAABoADIAQAX/ICCOZGmeaKqubOtWWjwJphLLgH1XUu//C1Jisfj9YLEKQnSY3GaixWQqQTkYHM4AMulNLJFC9pEwIW/odKU8cqTfsWoTTtcomU4ZjbR4ZP+AgYKCG0EiZ1AuiossEhwEXRMEg5SVWQ6MmZqKWD0QlqCUEHubpaYlExwRPRZioZZVp7KzKQoSDxANDLsNXA5simd2FcQYb4YAc2jEU80TmAAIztPCMcjKdg4OEsZJmwIWWQPQI4ikIwtoVQnddgrv8PFlCWgYCwkI+fp5dkvJ/IlUKMCy6tYrDhNIIKLFEAWCTxse+ABD4SClWA0zovAjcUJFi6EwahxZwoGqHhFA/4IqoICkyxQSKkbo0gDkuBXV4FRAJkRCnTgi2P28IcEfk5xpWppykFJVuScmEvDTEETAVJ6bEpypcADPkz3pvKVAICHChkC7siQ08zVqu4Q6hgIFEFZuEn/KMgRUkaBmAQs+cEHgIiHVH5EAFpIgW4+NT6LnaqhDwe/Ov7YOmWZp4MkiAWBIl0kAVsJWuzcYpdiNgddc0E8cKBAu/FElBwagMb88ZZKDRAkWJtkWhHh3wwUbKHQJN3wQAaXGR2LpArv5oFHRR34C7Mf6oLXZNfqBgNI7oOLhj1f8PaGpygHQ0xtP8MDVKwYTSKcgxr9/hS6/pCCAAg5M4B9/sWh1YP9/XSgQWRML/idBfKUc4IBET9lFjggKhDYZAELZJYEBI2BDB3ouNBEABwE8gAwiCcSYgAKqPdEVAG7scM8BPPZ4AIlM+OgjAgpMhRE24OVoBwsIFEGFA7ZkQQBWienWxmRa7XDjKZXhBdAeSmKQwgLuUVLICa6VEKIGcK2mQWoVZHCBXJblJUFkY06yAXlGsPIHBEYdYiWHb+WQBgaIJqqoHFNpgMGB7dT5ZQuG/WbBAIAUEEFNfwxAWpokTIXJAWdgoJ9kRFG2g5eDRpXSBpEIF0oEQFaZhDbaSFANRgqcJoEDRARLREtxOQpsPO906ZUeJgjQB6dZUPBAdwcF8KLXXRVQaKFcsRRLJ6vMiiCNKxRE8ECZKgUA3Va4arOAAqdGRWO7uMZH5AL05gvsjQbg6y4NCjQ1kw8TVGcbdoKGKx8j3bGH7nARBArqwi0gkFJBrZiXBQRbHoIgnhSjcEBKfD7c3HMhz+JIQSY3t8GGKW+SUhfUajxGzKd0IoHBNkNQK86ZYEqdzYA8AHQpqXRUm80oHs1CAgMoBxzRqvzs9CIKECC1JBp7enUpfXHApwVYNAfo16c4IrYPLVdSAJVob7IAtCBFQGHcs/RRdiUDPHA33oADEAIAOw==',
'note' => array(
'type' => 'png',
'data' => 'iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAAAAADFHGIkAAAAAmJLR0QAAKqNIzIAAAEESURBVHjaZZIhksMwDEV9voWFSwsLA0MLDf8VdARBUUNBQ1FBHcErZ5M0baXJjOPnb0vfLuMMn3H+lWMgBKL89A1Eq9Q9IrwB+gIOsnMPBR8giMclguQfBGS8x5xIoPQxnxqb4LL/eQ4l2AVNONP2ZshLCqJ3qqzWtT5pNgNnLU4OcNbuiqaLmFmHGhJ0TCMC99+f2wphlhaOYjuQVc0IIzLH2BRWfQoWsNSjct8AVop4rF3belTuVAb3MRj6kLrcTwtIy+g03V1vC57t1XrMzqfP5pln5yLTkk7+5UhstvOni1X3ixLEdf2c36+W0Q7kOb48hnSRLI/XdNPfX4kpMkgP5R+elfdkDPprQgAAAEN0RVh0U29mdHdhcmUAQCgjKUltYWdlTWFnaWNrIDQuMi44IDk5LzA4LzAxIGNyaXN0eUBteXN0aWMuZXMuZHVwb250LmNvbZG6IbgAAAAqdEVYdFNpZ25hdHVyZQAzYmQ3NDdjNWU0NTgwNzAwNmIwOTBkZDNlN2EyNmM0NBTTk/oAAAAOdEVYdFBhZ2UAMjR4MjQrMCswclsJMQAAAABJRU5ErkJggg==',
Header('Content-Type: image/'.$images[$img]['type']);
echo base64_decode($images[$img]['data']);
// {{{ displayHTMLProgress
function displayHTMLProgress($progress)
if (!(WEBINSTALLER && isset($_SESSION['go-pear']['DHTML']) && $_SESSION['go-pear']['DHTML'])) {
$msg = ob_get_contents();
ob_end_clean();
$msg = explode("\n", $msg);
foreach($msg as $key => $value) {
if (preg_match('/ok$/', $value)) {
$value = preg_replace('/(ok)$/', '\1', $value);
if (preg_match('/failed$/', $value)) {
$value = preg_replace('/(failed)$/', '\1', $value);
if (preg_match('/^install ok:/', $value)) {
//$value = preg_replace('/^(install ok:)/', '\1', $value).'';
//$msg = array($value); // if install succeeded: don't show the irritatingly verbose pear installer
$msg = array('ok');
if (preg_match('/^Warning:/', $value)) {
$value = ''.$value.'';
$msg[$key] = $
$msg = implode('', $msg);
ob_start();
// {{{ displayHTMLDownloadProgress
function displayHTMLDownloadProgress($progress)
if (!(WEBINSTALLER && isset($_SESSION['go-pear']['DHTML']) && $_SESSION['go-pear']['DHTML'])) {
$msg = ob_get_contents();
ob_end_clean();
ob_start();
// {{{ displayHTMLSetDownload
function displayHTMLSetDownload($file)
if (!(WEBINSTALLER && isset($_SESSION['go-pear']['DHTML']) && $_SESSION['go-pear']['DHTML'])) {
$msg = ob_get_contents();
ob_end_clean();
if ($file != null && $file != '') {
ob_start();
// {{{ win32BrowseForFolder
* Create a vbs script to browse the getfolder dialog, called
* by cscript, if it's available.
* $label is the label text in the header of the dialog box
* - Do not show Control panel
* - Replace WSH with calls to w32 as soon as callbacks work
* @Author Pierrre-Alain Joye
function win32BrowseForFolder($label)
static $wshSaved=
static $cscript='';
$wsh_browserfolder = 'Option Explicit
Dim ArgObj, var1, var2, sa, sFld
Set ArgObj = WScript.Arguments
Const BIF_EDITBOX = &H10
Const BIF_NEWDIALOGSTYLE = &H40
Const BIF_RETURNONLYFSDIRS
Const BIF_DONTGOBELOWDOMAIN
Const BIF_STATUSTEXT
Const BIF_RETURNFSANCESTORS
Const BIF_VALIDATE
Const BIF_BROWSEFORCOMPUTER
Const BIF_BROWSEFORPRINTER
Const BIF_BROWSEINCLUDEFILES = &H4000
Const OFN_LONGNAMES = &H200000
Const OFN_NOLONGNAMES = &H40000
Const ssfDRIVES = &H11
Const ssfNETWORK = &H12
Set sa = CreateObject("Shell.Application")
var1=ArgObj(0)
Set sFld = sa.BrowseForFolder(0, var1, BIF_EDITBOX + BIF_VALIDATE + BIF_BROWSEINCLUDEFILES + BIF_RETURNFSANCESTORS+BIF_NEWDIALOGSTYLE , ssfDRIVES )
if not sFld is nothing Then
if not left(sFld.items.item.path,1)=":" Then
WScript.Echo sFld.items.item.path
WScript.Echo "invalid"
WScript.Echo "cancel"
if( !$wshSaved){
$cscript = $ptmp.DIRECTORY_SEPARATOR."bf.vbs";
$fh = fopen($cscript,"wb+");
fwrite($fh,$wsh_browserfolder,strlen($wsh_browserfolder));
fclose($fh);
exec('cscript '.$cscript.' "'.$label.'" //noLogo',$arPath);
if($arPath[0]=='' || $arPath[0]=='cancel'){
return '';
} elseif ($arPath[0]=='invalid') {
echo "Invalid Path.\n";
return '';
return $arPath[0];
// {{{ win32CreateRegEnv
* Generates a registry addOn for Win32 platform
* This addon set PEAR environment variables
* @Author Pierrre-Alain Joye
function win32CreateRegEnv()
global $prefix, $bin_dir, $php_dir, $php_bin, $doc_dir, $data_dir, $test_dir, $temp_
$nl = "\r\n";
$reg ='REGEDIT4'.$nl.
'[HKEY_CURRENT_USER\Environment]'.$nl.
'"PHP_PEAR_SYSCONF_DIR"="'.addslashes($prefix).'"'.$nl.
'"PHP_PEAR_INSTALL_DIR"="'.addslashes($php_dir).'"'.$nl.
'"PHP_PEAR_DOC_DIR"="'.addslashes($doc_dir).'"'.$nl.
'"PHP_PEAR_BIN_DIR"="'.addslashes($bin_dir).'"'.$nl.
'"PHP_PEAR_DATA_DIR"="'.addslashes($data_dir).'"'.$nl.
'"PHP_PEAR_PHP_BIN"="'.addslashes($php_bin).'"'.$nl.
'"PHP_PEAR_TEST_DIR"="'.addslashes($test_dir).'"'.$
$fh = fopen($prefix.DIRECTORY_SEPARATOR.'PEAR_ENV.reg','wb');
fwrite($fh, $reg ,strlen($reg));
fclose($fh);
* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under $prefix\\PEAR_ENV.reg .
This file creates ENV variables for the current user.
Double-click this file to add it to the current user registry.
// {{{ win32DetectPHPSAPI
* Try to detect the kind of SAPI used by the
* the given php.exe.
* @Author Pierrre-Alain Joye
function win32DetectPHPSAPI()
global $php_bin,$php_sapi_
if (WEBINSTALLER) {
return $php_sapi_
if($php_bin!=''){
exec($php_bin.' -v', $res);
if(is_array($res)) {
if( isset($res[0]) && strpos($res[0],"(cli)")) {
return 'cli';
if( isset($res[0]) && strpos($res[0],"cgi")) {
return 'cgi';
return 'unknown';
return 'unknown';
// {{{ getPhpiniPath
* Get the php.ini file used with the current
* process or with the given php.exe
* Horrible hack,)
* Not used yet, will add the support later
* @Author Pierre-Alain Joye
function getPhpiniPath()
$pathIni = get_cfg_var('cfg_file_path');
if( $pathIni && is_file($pathIni) ){
return $pathI
// Oh well, we can keep this too :)
// I dunno if get_cfg_var() is safe on every OS
if (WINDOWS) {
// on Windows, we can be pretty sure that there is a php.ini
// file somewhere
$php_ini = PHP_CONFIG_FILE_PATH . DIRECTORY_SEPARATOR . 'php.ini';
if ( @file_exists($php_ini) )
$php_ini = 'c:\winnt\php.ini';
if ( @file_exists($php_ini) )
$php_ini = 'c:\windows\php.ini';
} while (false);
$php_ini = PHP_CONFIG_FILE_PATH . DIRECTORY_SEPARATOR . 'php.ini';
if( @is_file($php_ini) ){
return $php_
// We re running in hackz&troubles :)
ob_implicit_flush(false);
ob_start();
phpinfo(INFO_GENERAL);
$strInfo = ob_get_contents ();
ob_end_clean();
ob_implicit_flush(true);
if ( php_sapi_name() != 'cli' ) {
$strInfo = strip_tags($strInfo,'');
$arrayInfo
= explode("", $strInfo );
$arrayInfo = explode("\n",$strInfo);
foreach($arrayInfo as $val){
if ( strpos($val,"php.ini") ) {
list(,$pathIni) = explode('=>',$val);
$pathIni = strip_tags(trim($val) );
$pathIni = trim($pathIni);
if(is_file($pathIni)){
return $pathI
// {{{ alterPhpIni
* Not optimized, but seems to work, if some nice
* peardev will test it? :)
* @Author Pierre-Alain Joye
function alterPhpIni($pathIni='')
global $php_dir, $
$iniSep = WINDOWS?';':':';
if( $pathIni=='' ){
$pathIni =
getphpinipath();
$arrayIni = file($pathIni);
// Looks for each active include_path directives
foreach ( $arrayIni as $iniLine ) {
$iniLine = trim($iniLine);
$iniLine = str_replace(array("\n","\r"),array(),$iniLine);
if( preg_match("/^include_path/",$iniLine) ){
$foundAt[] = $i;
if ( $found ) {
$includeLine = $arrayIni[$foundAt[0]];
list(,$currentPath)=explode('=',$includeLine);
$currentPath = trim($currentPath);
if(substr($currentPath,0,1)=='"'){
$currentPath = substr($currentPath,1,strlen($currentPath)-2);
$arrayPath = explode($iniSep, $currentPath);
if( $arrayPath[0]=='.' ){
$newPath[0] = '.';
$newPath[1] = $php_
array_shift($arrayPath);
$newPath[0] = $php_
foreach( $arrayPath as $path ){
$newPath[]= $
$newPath[0] = '.';
$newPath[1] = $php_
$nl = WINDOWS?"\r\n":"\n";
$includepath = 'include_path="'.implode($iniSep,$newPath).'"';
$newInclude =
"$nl$***** Added by go-pear$nl".
$includepath.
$nl.";*****".
$arrayIni[$foundAt[0]] =
for( $i=1; $i<$ $i++){
$arrayIni[$foundAt[$i]]=';'.trim($arrayIni[$foundAt[$i]]);
$newIni = implode("",$arrayIni);
if ( !($fh = @fopen($pathIni, "wb+")) ){
$prefixIni = $prefix.DIRECTORY_SEPARATOR."php.ini-gopear";
$fh = fopen($prefixIni, "wb+");
if ( !$fh ) {
******************************************************************************
I cannot write to $pathIni nor in $prefix/php.ini-gopear. Please
modify manually your php.ini by adding:
$includepath
fwrite($fh, $newIni, strlen($newIni));
fclose($fh);
******************************************************************************
I cannot write to $pathIni, but I succesfully created a php.ini
under . Please replace the file
or modify your php.ini by adding:
$includepath
fwrite($fh, $newIni, strlen($newIni));
fclose($fh);
include_path updated.}

我要回帖

更多关于 virus.bat.crypt.a 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信