cvs: pear /PEAR_Frontend_Web WebInstaller.php /PEAR_Frontend_Web/Frontend Web.php /PEAR_Frontend_Web/docs example.php
| From: | Christian Dickmann | Date: | Sun, 09 Jun 2002 21:25:56 +0000 |
| Subject: | cvs: pear /PEAR_Frontend_Web WebInstaller.php /PEAR_Frontend_Web/Frontend Web.php /PEAR_Frontend_Web/docs example.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4521@lists.php.net to get a copy of this message | ||
dickmann Sun Jun 9 17:25:56 2002 EDT
Modified files:
/pear/PEAR_Frontend_Web WebInstaller.php
/pear/PEAR_Frontend_Web/Frontend Web.php
/pear/PEAR_Frontend_Web/docs example.php
Log:
first step for PEAR_Frontend_Web working 'out of the box'
Index: pear/PEAR_Frontend_Web/WebInstaller.php
diff -u pear/PEAR_Frontend_Web/WebInstaller.php:1.7 pear/PEAR_Frontend_Web/WebInstaller.php:1.8
--- pear/PEAR_Frontend_Web/WebInstaller.php:1.7 Sun Jun 9 14:57:50 2002
+++ pear/PEAR_Frontend_Web/WebInstaller.php Sun Jun 9 17:25:56 2002
@@ -16,7 +16,7 @@
| Author: Christian Dickmann <dickmann@php.net> |
+----------------------------------------------------------------------+
- $Id: WebInstaller.php,v 1.7 2002/06/09 18:57:50 dickmann Exp $
+ $Id: WebInstaller.php,v 1.8 2002/06/09 21:25:56 dickmann Exp $
*/
define('PEAR_Frontend_Web',1);
@session_start();
@@ -41,7 +41,9 @@
if (isset($_GET["img"])) {
$ui->outputFrontendFile($_GET["img"], 'image');
};
-
+
+
+
$config = &PEAR_Config::singleton($pear_user_config, '');
$verbose = $config->get("verbose");
$cmdopts = array();
@@ -49,6 +51,41 @@
$params = array();
$URL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
+ if (!file_exists($pear_user_config)) {
+ // I think PEAR_Frontend_Web is running for the first time!
+ // Install it properly ...
+
+ // First of all set some config-vars:
+ $dir = substr(dirname(__FILE__), 0, -strlen('PEAR/PEAR')); // strip PEAR/PEAR
+ $cmd = PEAR_Command::factory('config-set', $config);
+ $ok = $cmd->run('config-set', array(), array('php_dir',
$dir.'PEAR'));
+ $ok = $cmd->run('config-set', array(), array('doc_dir',
$dir.'docs'));
+ $ok = $cmd->run('config-set', array(), array('ext_dir',
$dir.'ext'));
+ $ok = $cmd->run('config-set', array(), array('bin_dir',
$dir.'bin'));
+ $ok = $cmd->run('config-set', array(), array('data_dir',
$dir.'data'));
+ $ok = $cmd->run('config-set', array(), array('test_dir',
$dir.'test'));
+
+ // Register packages
+ function installPackage($dir, $filename) {
+ $data = unserialize(implode('',file($dir.$filename)));
+ if (is_array($data['filelist']))
+ foreach($data['filelist'] as $key => $value) {
+ if ($value['role'] == "php")
+ $data['filelist'][$key] =
str_replace('/var/www/pear/go-pear/pear-web/',$dir, $data['filelist'][$key]);
+ };
+ $fp = fopen($dir.$filename, 'w');
+ fwrite($fp, serialize($data));
+ fclose($fp);
+ };
+ installPackage($dir,'PEAR/.registry/Archive_Tar.reg');
+ installPackage($dir,'PEAR/.registry/Console_Getopt.reg');
+ installPackage($dir,'PEAR/.registry/HTML_Template_IT.reg');
+ installPackage($dir,'PEAR/.registry/Net_UserAgent_Detect.reg');
+ installPackage($dir,'PEAR/.registry/Pager.reg');
+ installPackage($dir,'PEAR/.registry/PEAR.reg');
+ installPackage($dir,'PEAR/.registry/PEAR_Frontent_Web.reg');
+ installPackage($dir,'PEAR/.registry/XML_RPC.reg');
+ };
// Handle some diffrent Commands
if (isset($_GET["command"]))
Index: pear/PEAR_Frontend_Web/Frontend/Web.php
diff -u pear/PEAR_Frontend_Web/Frontend/Web.php:1.9 pear/PEAR_Frontend_Web/Frontend/Web.php:1.10
--- pear/PEAR_Frontend_Web/Frontend/Web.php:1.9 Sun Jun 9 14:57:50 2002
+++ pear/PEAR_Frontend_Web/Frontend/Web.php Sun Jun 9 17:25:56 2002
@@ -16,7 +16,7 @@
| Author: Christian Dickmann <dickmann@php.net> |
+----------------------------------------------------------------------+
- $Id: Web.php,v 1.9 2002/06/09 18:57:50 dickmann Exp $
+ $Id: Web.php,v 1.10 2002/06/09 21:25:56 dickmann Exp $
*/
require_once "PEAR.php";
@@ -255,6 +255,7 @@
$tpl->setVariable('PagerTo', $to);
$tpl->setVariable('PagerCount', $pager->numItems());
+ if (is_array($data['data']))
foreach($data['data'] as $category => $packages)
{
foreach($packages as $row)
Index: pear/PEAR_Frontend_Web/docs/example.php
diff -u pear/PEAR_Frontend_Web/docs/example.php:1.3 pear/PEAR_Frontend_Web/docs/example.php:1.4
--- pear/PEAR_Frontend_Web/docs/example.php:1.3 Sun Jun 9 16:20:27 2002
+++ pear/PEAR_Frontend_Web/docs/example.php Sun Jun 9 17:25:56 2002
@@ -25,7 +25,7 @@
// Configfile
$pear_user_config = dirname(__FILE__)."/pear.conf";
-
+
// Include WebInstaller
require_once("PEAR/WebInstaller.php");
?>