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) : false; if (!which('pear', $old_dir)) { print "\n** The 'pear' command is not currently in your PATH, so you need to\n** use '{$pear_cmd}' until you have added\n** '{$bin_dir}' to your PATH environment variable.\n\n"; print "Run it without parameters to see the available actions, try 'pear list'\nto see what packages are installed, or 'pear help' for help.\n\nFor more information about PEAR, see:\n\n http://pear.php.net/faq.php\n http://pear.php.net/manual/\n\nThanks for using go-pear!\n\n"; } } 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 ($_GET['step'] == 'install-progress') { displayHTMLProgress($progress = 100); ob_end_clean(); displayHTMLInstallationSummary(); displayHTMLFooter(); } else { $out = ob_get_contents(); $out = explode("\n", $out); foreach ($out as $line => $value) { if (preg_match('/ok$/', $value)) { $value = preg_replace('/(ok)$/', '<span class="green">\\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>';
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"; */ $config->set('download_dir', '/tmp' . '/download'); $config->set('temp_dir', '/tmp'); $config->store(); unset($config, $registry, $install); displayHTMLProgress($progress = 99); // Base installation finished // 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('<p><em>Can\'t use the \'~\' symbol for homedir substitution, write the directory out in full.</em></p>');