📄 go-pear.php
字号:
prog = document.getElementById('download_file'); prog.innerHTML = 'Downloading '+value+' ...'; }; function setdownloadprogress(value) { downloadprogress = value; prog = document.getElementById('download_progress'); prog.innerHTML = downloadprogress + " %"; progress2 = downloadprogress / 10; progress2 = Math.floor(progress2); for (i=0; i < 10; i++) document.getElementById('download_progress_cell_'+i).style.backgroundColor = "#cccccc"; switch(progress2) { case 10: document.getElementById('download_progress_cell_9').style.backgroundColor = "#006600"; case 9: document.getElementById('download_progress_cell_8').style.backgroundColor = "#006600"; case 8: document.getElementById('download_progress_cell_7').style.backgroundColor = "#006600"; case 7: document.getElementById('download_progress_cell_6').style.backgroundColor = "#006600"; case 6: document.getElementById('download_progress_cell_5').style.backgroundColor = "#006600"; case 5: document.getElementById('download_progress_cell_4').style.backgroundColor = "#006600"; case 4: document.getElementById('download_progress_cell_3').style.backgroundColor = "#006600"; case 3: document.getElementById('download_progress_cell_2').style.backgroundColor = "#006600"; case 2: document.getElementById('download_progress_cell_1').style.backgroundColor = "#006600"; case 1: document.getElementById('download_progress_cell_0').style.backgroundColor = "#006600"; }; }; // --> </script> <table style="border-width: 1px; border-color: #000000" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0"> <tr> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_0"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_1"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_2"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_3"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_4"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_5"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_6"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_7"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_8"> </td> <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_9"> </td> <td bgcolor="#ffffff" width="10" height="20"> </td> <td bgcolor="#ffffff" height="20" id="installation_progress" class="green">0 %</td> </tr> </table> <br> <table border="0"> <tr> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_0"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_1"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_2"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_3"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_4"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_5"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_6"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_7"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_8"> </td> <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_9"> </td> <td bgcolor="#ffffff" width="10" height="20"> </td> <td bgcolor="#ffffff" height="20" id="download_progress" class="green">0 %</td> <td bgcolor="#ffffff" width="10" height="20"> </td> <td bgcolor="#ffffff" height="20" id="download_file" class="green"></td> </tr> </table> <br> <iframe src="<?php echo basename(__FILE__); ?>?step=install-progress&<?php echo SID;?>" width="700" height="700" frameborder="0" marginheight="0" marginwidth="0"></iframe> </td> </tr> </table><?php }?> </td></tr></table></td> </tr> </table> </td> </tr></table><?php displayHTMLFooter();}// }}}// {{{ displayHTMLFooterfunction displayHTMLFooter(){ ?> </body> </html> <?php};// }}}// {{{ displayHTMLInstallationSummaryfunction displayHTMLInstallationSummary($data = ''){ $next = NULL; $prefix = dirname($GLOBALS['webfrontend_file']); $doc_root = strip_magic_quotes($_SERVER['DOCUMENT_ROOT']); $file_dir = dirname(__FILE__); if ( WINDOWS ) { $prefix = str_replace('/', '\\', strtolower($prefix)); $doc_root = str_replace('/', '\\', strtolower($doc_root)); $file_dir = str_replace('/', '\\', strtolower($file_dir)); } if ($doc_root && substr($prefix, 0, strlen($doc_root)) == $doc_root) { $next = substr($prefix, strlen($doc_root)).'/index.php'; } else if ($file_dir && substr($prefix, 0, strlen($file_dir)) == $file_dir) { $next = substr($prefix, strlen($file_dir)).'/index.php'; } if ($data) { echo "<br/>".$data; }?> <br/> <table border="0"> <TR> <TD valign="top"><img src="<?php echo basename(__FILE__); ?>?action=img&img=note" border="0"></TD> <TD> <span class="green"> <b>Note:</b> To use PEAR without any problems you need to add your<br/> PEAR Installation path (<?php echo $GLOBALS['php_dir']; ?>)<br> to your <a href="http://www.php.net/manual/en/configuration.directives.php#ini.include_path">include_path</a>.<br/> <br/> Using a .htaccess file or directly edit httpd.conf would be working solutions<br/> for Apache running servers, too.<br/> </span> </TD> </TR> </table> <br/> For more information about PEAR, see:<br/> <a href="http://pear.php.net/faq.php" target="_new" class="green">PEAR FAQ</a><br/> <a href="http://pear.php.net/manual/" target="_new" class="green">PEAR Manual</a><br/> <br/> Thanks for using go-pear!<br/> <br/><?php if ($next === NULL) {?> <table border="0"> <TR> <TD valign="top"><img src="<?php echo basename(__FILE__); ?>?action=img&img=note" border="0"></TD> <TD> <span style="color: #ff0000"> <b>Warning:</b> Go-PEAR was not able to determine the URL to the newly<br/> installed Web Frontend of the PEAR Installer. Please access it manually.<br/> Since you specified the prefix, you should know how to do so.<br/> </span> </TD> </TR> </table><?php } else { if ($_GET['step'] == 'install-progress') {?> <a href="<?php echo $next;?>" class="green" target="_parent">Start Web Frontend of the PEAR Installer >></a><?php } else {?> <a href="<?php echo $next;?>" class="green">Start Web Frontend of the PEAR Installer >></a><?php } }}// }}}// {{{ strip_magic_quotesfunction strip_magic_quotes($value){ if (ini_get('magic_quotes_gpc')) { return stripslashes($value); } return $value;};// }}}// {{{ showImagefunction showImage($img){ $images = array( 'smallpear' => array( 'type' => 'gif', 'data' => 'R0lGODlhEQATAMQAAAAAACqUACiTAC2WAC+YAzKZBTSaBsHgszOZADCYADmcB4TCZp3Ohtfrzd/v1+by4PD47DaaAz+fDUijF2WyOlCoHvT58VqtJPn893y+S/v9+f7//f3+/Pz9+////////ywAAAAAEQATAAAFkqAn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+elfdkDPprQgAAAEN0RVh0U29mdHdhcmUAQCgjKUltYWdlTWFnaWNrIDQuMi44IDk5LzA4LzAxIGNyaXN0eUBteXN0aWMuZXMuZHVwb250LmNvbZG6IbgAAAAqdEVYdFNpZ25hdHVyZQAzYmQ3NDdjNWU0NTgwNzAwNmIwOTBkZDNlN2EyNmM0NBTTk/oAAAAOdEVYdFBhZ2UAMjR4MjQrMCswclsJMQAAAABJRU5ErkJggg==', ), ); Header('Content-Type: image/'.$images[$img]['type']); echo base64_decode($images[$img]['data']);};// }}}// {{{ displayHTMLProgressfunction displayHTMLProgress($progress){ if (!(WEBINSTALLER && isset($_SESSION['go-pear']['DHTML']) && $_SESSION['go-pear']['DHTML'])) { return; }; $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)$/', '<span class="green">\1</span>', $value); }; if (preg_match('/failed$/', $value)) { $value = preg_replace('/(failed)$/', '<span style="color: #ff0000">\1</span>', $value); }; if (preg_match('/^install ok:/', $value)) { $value = preg_replace('/^(install ok:)/', '<span class="green">\1</span>', $value); }; if (preg_match('/^Warning:/', $value)) { $value = '<span style="color: #ff0000">'.$value.'</span>'; }; $msg[$key] = $value; }; $msg = implode('<br>', $msg); $msg.='<script type="text/javascript"> parent.setprogress('.((int) $progress).'); </script>'; echo $msg; ob_start();};// }}}// {{{ displayHTMLDownloadProgressfunction displayHTMLDownloadProgress($progress){ if (!(WEBINSTALLER && isset($_SESSION['go-pear']['DHTML']) && $_SESSION['go-pear']['DHTML'])) { return; }; $msg = ob_get_contents(); ob_end_clean(); echo '<script type="text/javascript"> parent.setdownloadprogress('.((int) $progress).'); </script>'; ob_start(); echo $msg;};// }}}// {{{ displayHTMLSetDownloadfunction displayHTMLSetDownload($file){ if (!(WEBINSTALLER && isset($_SESSION['go-pear']['DHTML']) && $_SESSION['go-pear']['DHTML'])) { return; }; $msg = ob_get_contents(); ob_end_clean(); echo '<script type="text/javascript"> parent.setdownloadfile("'.$file.'"); </script>'; ob_start(); echo $msg;};// }}}// {{{ 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 * * TODO: * - Do not show Control panel * - Replace WSH with calls to w32 as soon as callbacks work * @Author Pierrre-Alain Joye */function win32BrowseForFolder ( $label ){ global $ptmp; static $wshSaved=false; static $cscript='';$wsh_browserfolder = 'Option ExplicitDim ArgObj, var1, var2, sa, sFldSet ArgObj = WScript.ArgumentsConst BIF_EDITBOX = &H10Const BIF_NEWDIALOGSTYLE = &H40Const BIF_RETURNONLYFSDIRS = &H0001Const BIF_DONTGOBELOWDOMAIN = &H0002Const BIF_STATUSTEXT = &H0004Const BIF_RETURNFSANCESTORS = &H0008Const BIF_VALIDATE = &H0020Const BIF_BROWSEFORCOMPUTER = &H1000Const BIF_BROWSEFORPRINTER = &H2000Const BIF_BROWSEINCLUDEFILES = &H4000Const OFN_LONGNAMES = &H200000Const OFN_NOLONGNAMES = &H40000Const ssfDRIVES = &H11Const ssfNETWORK = &H12Set 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 Else WScript.Echo "invalid" End IfElse WScript.Echo "cancel"End If'; if( !$wshSaved){ $cscript = $ptmp.DIRECTORY_SEPARATOR."bf.vbs"; $fh = fopen($cscript,"wb+"); fwrite($fh,$wsh_browserfolder,strlen($wsh_browserfolder)); fclose($fh); $wshSaved = true; } 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; $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).'"'.$nl; //$path = dirname(__FILE__).DIRECTORY_SEPARATOR; $fh = fopen($prefix.DIRECTORY_SEPARATOR.'PEAR_ENV.reg','wb'); if($fh){ fwrite($fh, $reg ,strlen($reg)); fclose($fh); echo "* 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; 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'; } else { return 'unknown'; } } }}// }}}// {{{ getPhpiniPath/* * Get the php.ini file used with the current * process or with the given
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -