<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/Server</tt></b> on <span id="info">MAIN</span></td></tr>
<tr><td><tt><a href="#file1">restsetup.php</a></tt></td><td align="right" id="added">+1</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.3">1.3</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.3&r2=1.4">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.4">1.4</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">restsetup.php</a></tt></td><td align="right" id="added">+1</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.3">1.3</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.3&r2=1.4">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.4">1.4</a></td></tr>
<tr><td><tt>Backend/<a href="#file3">DBDataObject.php</a></tt></td><td align="right" id="added">+52</td><td align="right" id="removed">-3</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.18">1.18</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.18&r2=1.19">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.19">1.19</a></td></tr>
<tr><td></td><td align="right" id="added">+54</td><td align="right" id="removed">-3</td><td></td></tr>
</table>
<small id="info">3 modified files</small><br />
<pre class="comment">
add saveAllReleasesREST() - will allow seriously
fast package.getDownloadURL() equivalency
</pre>
<hr /><a name="file1" /><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>restsetup.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.3">1.3</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.3&r2=1.4">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.4">1.4</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.3 -r1.4
--- restsetup.php        20 Apr 2005 04:06:18 -0000        1.3
+++ restsetup.php        20 Apr 2005 23:25:39 -0000        1.4
@@ -120,6 +120,7 @@
</small></pre><pre class="diff" id="context"> $backend->savePackageREST($package['package']);
$releases = $backend->listReleases($package['package']);
if (count($releases)) {
</pre><pre class="diff" id="added">+ $backend->saveAllReleasesREST($package['package']);
</pre><pre class="diff" id="context"> foreach ($releases as $version => $release) {
$this->_ui->outputData(' Version ' . $version);
$backend->saveReleaseREST($package['package'], $version);
</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>/<a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server/Server">Server</a><br /></span>
<div class="fileheader"><big><b>restsetup.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.3">1.3</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.3&r2=1.4">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.4">1.4</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.3 -r1.4
--- restsetup.php        20 Apr 2005 04:06:18 -0000        1.3
+++ restsetup.php        20 Apr 2005 23:25:39 -0000        1.4
@@ -120,6 +120,7 @@
</small></pre><pre class="diff" id="context"> $backend->savePackageREST($package['package']);
$releases = $backend->listReleases($package['package']);
if (count($releases)) {
</pre><pre class="diff" id="added">+ $backend->saveAllReleasesREST($package['package']);
</pre><pre class="diff" id="context"> foreach ($releases as $version => $release) {
$this->_ui->outputData(' Version ' . $version);
$backend->saveReleaseREST($package['package'], $version);
</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>/<a href="http://cvs.phpdoc.org/cvs.php/PEAR_Server/Server/Backend">Backend</a><br /></span>
<div class="fileheader"><big><b>DBDataObject.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.18">1.18</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.18&r2=1.19">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.19">1.19</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.18 -r1.19
--- DBDataObject.php        20 Apr 2005 14:18:12 -0000        1.18
+++ DBDataObject.php        20 Apr 2005 23:25:39 -0000        1.19
@@ -168,7 +168,52 @@
</small></pre><pre class="diff" id="context"> $releasedata->filepath = $release->getFilePath();
$releasedata->deps = serialize($release->getDeps(false));
$releasedata->packagexml = $release->getXml();
</pre><pre class="diff" id="removed">- <span id="removedchars">return</span> $releasedata->insert();
</pre><pre class="diff" id="added">+ <span id="addedchars">$ret =</span> $releasedata->insert();
+ if ($ret) {
+ $this->savePackageREST($releasedata->package);
+ $this->saveReleaseREST($releasedata->package, $releasedata->version);
+ $this->saveAllReleasesREST();
+ }
+ return $ret;
+ }
+
+ public function saveAllReleasesREST($package)
+ {
+ $channel = DB_DataObject::factory('channels');
+ $channel->channel = $this->_channel;
+ $channel->find(true);
+ if ($channel->rest_support) {
+ $channelinfo = parse_url($this->_channel);
+ if (isset($channelinfo['host'])) {
+ $extra = $channelinfo['path'] . '/Chiara_PEAR_Server_REST/';
+ } else {
+ $extra = '/Chiara_PEAR_Server_REST';
+ }
+ $releasedata = DB_DataObject::factory('releases');
+ $releasedata->channel = $this->_channel;
+ $releasedata->package = $package;
+ if (!$releasedata->find(false)) {
+ throw new Chiara_PEAR_Server_ExceptionPackageDoesntExist($package, $this->_channel);
+ }
+ $info = '<a>
+ <p>' . $package . '</p>
+ <c>' . $this->_channel . '</c>
+';
+ while ($releasedata->fetch()) {
+ $info .= ' <r><v>' . $releasedata->version . '</v><s>' . $releasedata->state . '</s></r>
+';
+ }
+ $info .= '</a>';
+ $rdir = $this->_restdir . DIRECTORY_SEPARATOR . 'r';
+ if (!file_exists($rdir . DIRECTORY_SEPARATOR . $package)) {
+ System::mkdir(array('-p', $rdir . DIRECTORY_SEPARATOR . $package));
+ @chmod($rdir . DIRECTORY_SEPARATOR . $package, 0777);
+ }
+ file_put_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
+ DIRECTORY_SEPARATOR . 'allreleases.xml', $version);
+ @chmod($rdir . DIRECTORY_SEPARATOR . $release['package'] .
+ DIRECTORY_SEPARATOR . 'allreleases.xml', 0666);
+ }
</pre><pre class="diff" id="context"> }
public function saveReleaseREST($package, $version)
</pre><pre class="diff"><small id="info">@@ -417,7 +462,9 @@
</small></pre><pre class="diff" id="context"> $category->description = $cat->description;
$category->alias = $cat->alias;
$ret = $category->insert();
</pre><pre class="diff" id="removed">- $this->saveCategoryREST($cat->name);
</pre><pre class="diff" id="added">+ if ($ret) {
+ $this->saveCategoryREST($cat->name);
+ }
</pre><pre class="diff" id="context"> return $ret;
}
</pre><pre class="diff"><small id="info">@@ -635,7 +682,9 @@
</small></pre><pre class="diff" id="context"> $packages_extras->docs_uri = $pkg->docs_uri;
$packages_extras->insert();
$ret = $package->insert();
</pre><pre class="diff" id="removed">- $this->savePackageREST($pkg->name);
</pre><pre class="diff" id="added">+ if ($ret) {
+ $this->savePackageREST($pkg->name);
+ }
</pre><pre class="diff" id="context"> return $ret;
}
</pre></div>
</body></html><pre>