<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>PEAR_Server</tt></b> on <span id="info">MAIN</span></td></tr>
<tr><td><tt><a href="#file1">package.xml</a></tt></td><td align="right" id="added">+21</td><td align="right" id="removed">-72</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.27">1.27</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.27&r2=1.28">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.28">1.28</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">package.xml</a></tt></td><td align="right" id="added">+21</td><td align="right" id="removed">-72</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.27">1.27</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.27&r2=1.28">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.28">1.28</a></td></tr>
<tr><td><tt>Server/<a href="#file3">Exception.php</a></tt></td><td align="right" id="added">+1</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.9">1.9</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.9&r2=1.10">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.10">1.10</a></td></tr>
<tr class="alt"><td><tt> /<a href="#file4">mysqlinstall.php</a></tt></td><td align="right" id="added">+101</td><td align="right" id="removed">-28</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/mysqlinstall.php?r=1.15">1.15</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/mysqlinstall.php?r1=1.15&r2=1.16">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/mysqlinstall.php?r=1.16">1.16</a></td></tr>
<tr><td></td><td align="right" id="added">+144</td><td align="right" id="removed">-173</td><td></td></tr>
</table>
<small id="info">4 modified files</small><br />
<pre class="comment">
fix exception again
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server">PEAR_Server</a><br /></span>
<div class="fileheader"><big><b>package.xml</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.27">1.27</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.27&r2=1.28">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.28">1.28</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.27 -r1.28
--- package.xml        24 Apr 2005 03:11:03 -0000        1.27
+++ package.xml        1 Jun 2005 03:31:46 -0000        1.28
@@ -11,7 +11,7 @@
</small></pre><pre class="diff" id="context"> By default, a lightweight database is used,
accessed by a DB_DataObject backend,
with an administrative frontend using HTML_QuickForm and
</pre><pre class="diff" id="removed">-xml-rpc frontend using Chiara_XML_RPC5
</pre><pre class="diff" id="added">+REST-based static frontend
</pre><pre class="diff" id="context"> Chiara_PEAR_Server replaces PEAR_Server
</description>
<lead>
</pre><pre class="diff"><small id="info">@@ -26,9 +26,9 @@
</small></pre><pre class="diff" id="context"> <email>davey@php.net</email>
<active>yes</active>
</lead>
</pre><pre class="diff" id="removed">- <date>2005-0<span id="removedchars">4-2</span>1</date>
</pre><pre class="diff" id="added">+ <date>2005-0<span id="addedchars">5-3</span>1</date>
</pre><pre class="diff" id="context"> <version>
</pre><pre class="diff" id="removed">- <release>0.18.<span id="removedchars">0</span></release>
</pre><pre class="diff" id="added">+ <release>0.18.<span id="addedchars">1</span></release>
</pre><pre class="diff" id="context"> <api>0.18.0</api>
</version>
<stability>
</pre><pre class="diff"><small id="info">@@ -37,11 +37,8 @@
</small></pre><pre class="diff" id="context"> </stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
</pre><pre class="diff" id="removed">- Implement REST support
- fix subpackage support
- fix package.info
- fix PHP5 issue with visibility of Xmlrpc5 server contructor
- add the ability to delete a package
</pre><pre class="diff" id="added">+ Consolidate post-install scripts
+ fix invalid release exception error message
</pre><pre class="diff" id="context"> </notes>
<contents>
<dir name="/" baseinstalldir="Chiara/PEAR">
</pre><pre class="diff"><small id="info">@@ -76,8 +73,6 @@
</small></pre><pre class="diff" id="context"> </dir> <!-- /Server/Backend -->
<dir name="Frontend">
<file name="HTMLQuickForm.php" role="php" />
</pre><pre class="diff" id="removed">- <file name="Xmlrpc.php" role="php" />
- <file name="Xmlrpc5.php" role="php" />
</pre><pre class="diff" id="context"> </dir> <!-- /Server/Frontend -->
<file name="Backend.php" role="php" />
<file name="Exception.php" role="php" />
</pre><pre class="diff"><small id="info">@@ -177,12 +172,6 @@
</small></pre><pre class="diff" id="context"> <type>string</type>
</param>
<param>
</pre><pre class="diff" id="removed">- <name>xmlrpcphp</name>
- <prompt>name of xmlrpc.php public XML-RPC frontend file</prompt>
- <type>string</type>
- <default>xmlrpc.php</default>
- </param>
- <param>
</pre><pre class="diff" id="context"> <name>frontendphp</name>
<prompt>name of frontend.php HTML admin frontend file</prompt>
<type>string</type>
</pre><pre class="diff"><small id="info">@@ -209,58 +198,6 @@
</small></pre><pre class="diff" id="context"> <tasks:replace from="@data-dir@" to="data_dir" type="pear-config"/>
<tasks:replace from="@php-dir@" to="php_dir" type="pear-config"/>
</file>
</pre><pre class="diff" id="removed">- <file name="restsetup.php" role="php">
- <tasks:postinstallscript>
- <paramgroup>
- <id>questionCreate</id>
- <param>
- <name>doit</name>
- <prompt>Enable REST for this server? (extremely scalable compared to XML-RPC)</prompt>
- <type>string</type>
- <default>yes</default>
- </param>
- </paramgroup>
- <paramgroup>
- <id>processExistingReleases</id>
- <param>
- <name>database</name>
- <prompt>Mysql database</prompt>
- <type>string</type>
- <default>pear</default>
- </param>
- <param>
- <name>user</name>
- <prompt>Mysql Username (must have create permision)</prompt>
- <type>string</type>
- <default>pear</default>
- </param>
- <param>
- <name>password</name>
- <prompt>Mysql password</prompt>
- <type>string</type>
- <default>pear</default>
- </param>
- <param>
- <name>dbhost</name>
- <prompt>Database Host</prompt>
- <type>string</type>
- <default>localhost</default>
- </param>
- <param>
- <name>name</name>
- <prompt>Channel Name (server uri like pear.php.net)</prompt>
- <type>string</type>
- </param>
- <param>
- <name>webroot</name>
- <prompt>Path to document root (htdocs or public_html)</prompt>
- <type>string</type>
- </param>
- </paramgroup>
- </tasks:postinstallscript>
- <tasks:replace from="@data-dir@" to="data_dir" type="pear-config"/>
- <tasks:replace from="@php-dir@" to="php_dir" type="pear-config"/>
- </file>
</pre><pre class="diff" id="context"> <file name="Release.php" role="php" />
</dir> <!-- /Server -->
<file name="Server.php" role="php" />
</pre><pre class="diff"><small id="info">@@ -284,10 +221,6 @@
</small></pre><pre class="diff" id="context"> <channel>pear.php.net</channel>
<min>3.2.2</min>
</package>
</pre><pre class="diff" id="removed">- <package>
- <name>Chiara_XML_RPC5</name>
- <channel>pear.chiaraquartet.net</channel>
- </package>
</pre><pre class="diff" id="context"> </required>
<optional>
<extension>
</pre><pre class="diff"><small id="info">@@ -589,5 +522,21 @@
</small></pre><pre class="diff" id="context"> add the ability to delete a package
</notes>
</release>
</pre><pre class="diff" id="added">+ <release>
+ <version>
+ <release>0.18.1</release>
+ <api>0.18.0</api>
+ </version>
+ <stability>
+ <release>alpha</release>
+ <api>alpha</api>
+ </stability>
+ <date>2005-05-31</date>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>
+ Consolidate post-install scripts
+ fix invalid release exception error message
+ </notes>
+ </release>
</pre><pre class="diff" id="context"> </changelog>
</package>
</pre><pre class="diff"><small id="info">\ No newline at end of file
</small></pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname"><a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server">PEAR_Server</a><br /></span>
<div class="fileheader"><big><b>package.xml</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.27">1.27</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.27&r2=1.28">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.28">1.28</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.27 -r1.28
--- package.xml        24 Apr 2005 03:11:03 -0000        1.27
+++ package.xml        1 Jun 2005 03:31:46 -0000        1.28
@@ -11,7 +11,7 @@
</small></pre><pre class="diff" id="context"> By default, a lightweight database is used,
accessed by a DB_DataObject backend,
with an administrative frontend using HTML_QuickForm and
</pre><pre class="diff" id="removed">-xml-rpc frontend using Chiara_XML_RPC5
</pre><pre class="diff" id="added">+REST-based static frontend
</pre><pre class="diff" id="context"> Chiara_PEAR_Server replaces PEAR_Server
</description>
<lead>
</pre><pre class="diff"><small id="info">@@ -26,9 +26,9 @@
</small></pre><pre class="diff" id="context"> <email>davey@php.net</email>
<active>yes</active>
</lead>
</pre><pre class="diff" id="removed">- <date>2005-0<span id="removedchars">4-2</span>1</date>
</pre><pre class="diff" id="added">+ <date>2005-0<span id="addedchars">5-3</span>1</date>
</pre><pre class="diff" id="context"> <version>
</pre><pre class="diff" id="removed">- <release>0.18.<span id="removedchars">0</span></release>
</pre><pre class="diff" id="added">+ <release>0.18.<span id="addedchars">1</span></release>
</pre><pre class="diff" id="context"> <api>0.18.0</api>
</version>
<stability>
</pre><pre class="diff"><small id="info">@@ -37,11 +37,8 @@
</small></pre><pre class="diff" id="context"> </stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
</pre><pre class="diff" id="removed">- Implement REST support
- fix subpackage support
- fix package.info
- fix PHP5 issue with visibility of Xmlrpc5 server contructor
- add the ability to delete a package
</pre><pre class="diff" id="added">+ Consolidate post-install scripts
+ fix invalid release exception error message
</pre><pre class="diff" id="context"> </notes>
<contents>
<dir name="/" baseinstalldir="Chiara/PEAR">
</pre><pre class="diff"><small id="info">@@ -76,8 +73,6 @@
</small></pre><pre class="diff" id="context"> </dir> <!-- /Server/Backend -->
<dir name="Frontend">
<file name="HTMLQuickForm.php" role="php" />
</pre><pre class="diff" id="removed">- <file name="Xmlrpc.php" role="php" />
- <file name="Xmlrpc5.php" role="php" />
</pre><pre class="diff" id="context"> </dir> <!-- /Server/Frontend -->
<file name="Backend.php" role="php" />
<file name="Exception.php" role="php" />
</pre><pre class="diff"><small id="info">@@ -177,12 +172,6 @@
</small></pre><pre class="diff" id="context"> <type>string</type>
</param>
<param>
</pre><pre class="diff" id="removed">- <name>xmlrpcphp</name>
- <prompt>name of xmlrpc.php public XML-RPC frontend file</prompt>
- <type>string</type>
- <default>xmlrpc.php</default>
- </param>
- <param>
</pre><pre class="diff" id="context"> <name>frontendphp</name>
<prompt>name of frontend.php HTML admin frontend file</prompt>
<type>string</type>
</pre><pre class="diff"><small id="info">@@ -209,58 +198,6 @@
</small></pre><pre class="diff" id="context"> <tasks:replace from="@data-dir@" to="data_dir" type="pear-config"/>
<tasks:replace from="@php-dir@" to="php_dir" type="pear-config"/>
</file>
</pre><pre class="diff" id="removed">- <file name="restsetup.php" role="php">
- <tasks:postinstallscript>
- <paramgroup>
- <id>questionCreate</id>
- <param>
- <name>doit</name>
- <prompt>Enable REST for this server? (extremely scalable compared to XML-RPC)</prompt>
- <type>string</type>
- <default>yes</default>
- </param>
- </paramgroup>
- <paramgroup>
- <id>processExistingReleases</id>
- <param>
- <name>database</name>
- <prompt>Mysql database</prompt>
- <type>string</type>
- <default>pear</default>
- </param>
- <param>
- <name>user</name>
- <prompt>Mysql Username (must have create permision)</prompt>
- <type>string</type>
- <default>pear</default>
- </param>
- <param>
- <name>password</name>
- <prompt>Mysql password</prompt>
- <type>string</type>
- <default>pear</default>
- </param>
- <param>
- <name>dbhost</name>
- <prompt>Database Host</prompt>
- <type>string</type>
- <default>localhost</default>
- </param>
- <param>
- <name>name</name>
- <prompt>Channel Name (server uri like pear.php.net)</prompt>
- <type>string</type>
- </param>
- <param>
- <name>webroot</name>
- <prompt>Path to document root (htdocs or public_html)</prompt>
- <type>string</type>
- </param>
- </paramgroup>
- </tasks:postinstallscript>
- <tasks:replace from="@data-dir@" to="data_dir" type="pear-config"/>
- <tasks:replace from="@php-dir@" to="php_dir" type="pear-config"/>
- </file>
</pre><pre class="diff" id="context"> <file name="Release.php" role="php" />
</dir> <!-- /Server -->
<file name="Server.php" role="php" />
</pre><pre class="diff"><small id="info">@@ -284,10 +221,6 @@
</small></pre><pre class="diff" id="context"> <channel>pear.php.net</channel>
<min>3.2.2</min>
</package>
</pre><pre class="diff" id="removed">- <package>
- <name>Chiara_XML_RPC5</name>
- <channel>pear.chiaraquartet.net</channel>
- </package>
</pre><pre class="diff" id="context"> </required>
<optional>
<extension>
</pre><pre class="diff"><small id="info">@@ -589,5 +522,21 @@
</small></pre><pre class="diff" id="context"> add the ability to delete a package
</notes>
</release>
</pre><pre class="diff" id="added">+ <release>
+ <version>
+ <release>0.18.1</release>
+ <api>0.18.0</api>
+ </version>
+ <stability>
+ <release>alpha</release>
+ <api>alpha</api>
+ </stability>
+ <date>2005-05-31</date>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>
+ Consolidate post-install scripts
+ fix invalid release exception error message
+ </notes>
+ </release>
</pre><pre class="diff" id="context"> </changelog>
</package>
</pre><pre class="diff"><small id="info">\ No newline at end of file
</small></pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname"><a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server">PEAR_Server</a>/<a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server/Server">Server</a><br /></span>
<div class="fileheader"><big><b>Exception.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.9">1.9</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.9&r2=1.10">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.10">1.10</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.9 -r1.10
--- Exception.php        1 Jun 2005 02:55:03 -0000        1.9
+++ Exception.php        1 Jun 2005 03:31:47 -0000        1.10
@@ -239,7 +239,7 @@
</small></pre><pre class="diff" id="context"> $info .= $err['message'];
}
} else {
</pre><pre class="diff" id="removed">- $info = 'No further information available';
</pre><pre class="diff" id="added">+ $info = $packagefile->getMessage();
</pre><pre class="diff" id="context"> }
$this->_data = array('info' => $info);
parent::__construct($msg ? $msg : $this->_message);
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname"><a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server">PEAR_Server</a>/<a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server/Server">Server</a><br /></span>
<div class="fileheader"><big><b>mysqlinstall.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/mysqlinstall.php?r=1.15">1.15</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/mysqlinstall.php?r1=1.15&r2=1.16">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/mysqlinstall.php?r=1.16">1.16</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.15 -r1.16
--- mysqlinstall.php        22 Apr 2005 02:31:14 -0000        1.15
+++ mysqlinstall.php        1 Jun 2005 03:31:47 -0000        1.16
@@ -468,6 +468,7 @@
</small></pre><pre class="diff" id="context"> function createServerFiles($answers)
{
$this->pearconfigloc = $answers['pearconfigloc'];
</pre><pre class="diff" id="added">+ $this->webroot = $answers['docroot'];
</pre><pre class="diff" id="context"> $options = &PEAR::getStaticProperty('DB_DataObject','options');
$type = extension_loaded('mysqli') ? 'mysqli' : 'mysql';
$phpdir = str_replace('\\', '/', '@php-dir@');
</pre><pre class="diff"><small id="info">@@ -493,23 +494,19 @@
</small></pre><pre class="diff" id="context"> $chan->setName($dbo->channel);
$chan->setSummary($dbo->summary);
$chan->setAlias($dbo->alias);
</pre><pre class="diff" id="removed">- $chan->setDefaultPEARProtocols();
</pre><pre class="diff" id="added">+ $chan->setBaseURL('REST1.0', 'http://' . $dbo->channel . '/Chiara_PEAR_Server_REST/');
</pre><pre class="diff" id="context"> if ($this->port != 80) {
$chan->setPort($this->port);
}
if ($this->ssl) {
$chan->setSSL();
}
</pre><pre class="diff" id="removed">- if ($this->xmlrpcphp != 'xmlrpc.php') {
- $chan->setPath('xmlrpc', $this->xmlrpcphp);
- }
</pre><pre class="diff" id="context"> if (!$this->_registry->channelExists($dbo->channel)) {
$this->_registry->addChannel($chan);
} else {
$this->_registry->updateChannel($chan);
}
$xml = $chan->toXml();
</pre><pre class="diff" id="removed">- $this->xmlrpcphp = $answers['xmlrpcphp'];
</pre><pre class="diff" id="context"> $this->ssl = ($answers['ssl'] == 'https');
$this->port = $answers['port'];
$this->frontend = $answers['frontendphp'];
</pre><pre class="diff"><small id="info">@@ -539,29 +536,6 @@
</small></pre><pre class="diff" id="context"> $config = 'array(\'database\' => \'' .
$type . '://' . $this->user . ':' . $this->password . '@' . $this->dbhost .
'/' . $this->db . '\')';
</pre><pre class="diff" id="removed">- $contents = '<?php
-require_once \'Chiara/PEAR/Server.php\';
-require_once \'Chiara/PEAR/Server/Backend/DBDataObject.php\';
-require_once \'Chiara/PEAR/Server/Frontend/Xmlrpc5.php\';
-$backend = new Chiara_PEAR_Server_Backend_DBDataObject(\'' . $this->channel . '\', false, '
- . $config . ');
-$frontend = Chiara_PEAR_Server_Frontend_Xmlrpc5::singleton(\'' . $this->channel . '\');
-$server = new Chiara_PEAR_Server(\'' . $answers['docroot'] . DIRECTORY_SEPARATOR . 'get' . '\');
-$server->setBackend($backend);
-$server->setFrontend($frontend);
-$server->run();
-?>';
- $fp = fopen($answers['docroot'] . DIRECTORY_SEPARATOR . $this->xmlrpcphp, 'w');
- $a = fwrite($fp, $contents, strlen($contents));
- fclose($fp);
- if ($a) {
- $this->_ui->outputData('Successfully created ' .
- $answers['docroot'] . DIRECTORY_SEPARATOR . $this->xmlrpcphp);
- } else {
- $this->_ui->outputData('Could not create ' .
- $answers['docroot'] . DIRECTORY_SEPARATOR . $this->xmlrpcphp);
- return false;
- }
</pre><pre class="diff" id="context">
// create frontend.php
$extraconf = '';
</pre><pre class="diff"><small id="info">@@ -617,7 +591,106 @@
</small></pre><pre class="diff" id="context"> $this->_ui->outputData(
$answers['docroot'] . DIRECTORY_SEPARATOR . 'pear_server.css already exists');
}
</pre><pre class="diff" id="added">+ $this->goREST();
</pre><pre class="diff" id="context"> return true;
}
</pre><pre class="diff" id="added">+
+ function goREST()
+ {
+ include_once 'System.php';
+ if (!class_exists('System')) {
+ $this->_ui->outputData('System class required to create REST files');
+ return false;
+ }
+ if (!file_exists($this->webroot)) {
+ System::mkdir(array('-p', $this->webroot));
+ }
+ $restroot = $this->webroot . DIRECTORY_SEPARATOR . 'Chiara_PEAR_Server_REST';
+ if (!file_exists($restroot)) {
+ System::mkdir($restroot);
+ @chmod($this->webroot . DIRECTORY_SEPARATOR . 'Chiara_PEAR_Server_REST', 0777);
+ }
+ require_once 'Chiara/PEAR/Server/Backend/DBDataObject.php';
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ $type = extension_loaded('mysqli') ? 'mysqli' : 'mysql';
+ $phpdir = str_replace('\\', '/', 'C:\php5\pear');
+ $datadir = str_replace('\\', '/', 'C:\php5\pear\data');
+ $options = array(
+ 'database' => $type . '://' . $this->user . ':' . $this->password .
+ '@' . $this->dbhost . '/' . $this->db,
+ 'schema_location' => $datadir . '/Chiara_PEAR_Server/data/DBDataObject',
+ 'class_location' => $phpdir . '/Chiara/PEAR/Server/Backend/DBDataObject/',
+ 'require_prefix' => 'Chiara/PEAR/Server/Backend/DBDataObject/',
+ 'class_prefix' => 'Chiara_PEAR_Server_Backend_DBDataObject_',
+ );
+ $this->_ui->outputData('Enabling REST for channel ' . $this->channel);
+ $chan = DB_DataObject::factory('channels');
+ $chan->channel = $this->channel;
+ if (!$chan->find(false)) {
+ $this->ui->outputData('Unknown channel: ' . $this->channel);
+ return false;
+ }
+ $chan->rest_support = 1;
+ $chan->update();
+ $this->_ui->outputData('Adding REST 1.0 to channel.xml');
+ $chan = $this->_registry->getChannel($this->channel);
+ if (is_a($chan, 'PEAR_ChannelFile')) {
+ $chan->setBaseURL('REST1.0', 'http://' . $this->channel . '/Chiara_PEAR_Server_REST/');
+ $this->_registry->updateChannel($chan);
+ file_put_contents($this->webroot . DIRECTORY_SEPARATOR . 'channel.xml',
+ $chan->toXml());
+ } else {
+ $this->_ui->outputData('Channel is not registered in local channel database');
+ return false;
+ }
+ $channelinfo = parse_url($this->channel);
+ $backend = new Chiara_PEAR_Server_Backend_DBDataObject($this->channel, $restroot, $options);
+ // package information directory
+ if (!file_exists($pdir = $restroot . DIRECTORY_SEPARATOR . 'p')) {
+ System::mkdir(array('-p', $restroot . DIRECTORY_SEPARATOR . 'p'));
+ @chmod($pdir, 0777);
+ }
+ // category information directory
+ if (!file_exists($cdir = $restroot . DIRECTORY_SEPARATOR . 'c')) {
+ System::mkdir(array('-p', $cdir));
+ @chmod($cdir, 0777);
+ }
+ // release listing directory
+ if (!file_exists($rdir = $restroot . DIRECTORY_SEPARATOR . 'r')) {
+ System::mkdir(array('-p', $rdir));
+ @chmod($rdir, 0777);
+ }
+ $categories = $backend->listCategories();
+ $this->_ui->outputData('Saving Categories REST');
+ foreach ($categories as $category) {
+ $this->_ui->outputData(' Category ' . $category['name']);
+ $backend->saveCategoryREST($category['name']);
+ }
+ $this->_ui->outputData('Saving Maintainer REST');
+ $maintainers = $backend->listMaintainers();
+ foreach ($maintainers as $maintainer) {
+ $this->_ui->outputData( 'Maintainer ' . $maintainer->handle);
+ $backend->saveMaintainerREST($maintainer);
+ }
+ $this->_ui->outputData('Saving Package REST');
+ $backend->saveAllPackagesREST();
+ $packages = $backend->listPackages(false, false, false);
+ foreach ($packages as $package) {
+ $this->_ui->outputData(' Package ' . $package['package']);
+ $backend->savePackageREST($package['package']);
+ $backend->savePackageMaintainersREST($package['package']);
+ $releases = $backend->listReleases($package['package']);
+ if (count($releases)) {
+ $backend->saveAllReleasesREST($package['package']);
+ foreach ($releases as $version => $release) {
+ $this->_ui->outputData(' Version ' . $version);
+ $backend->saveReleaseREST($package['package'], $version);
+ $backend->savePackageDepsREST($package['package'], $version,
+ $backend->getPackageFileObject($package['package'],
+ $version)->getDependencies());
+ }
+ }
+ }
+ }
</pre><pre class="diff" id="context"> }
?>
</pre><pre class="diff"><small id="info">\ No newline at end of file
</small></pre></div>
</body></html><pre>