<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">+5</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.25">1.25</a></td></tr>
<tr class="alt"><td><tt><a href="#file2">package.xml</a></tt></td><td align="right" id="added">+5</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.25">1.25</a></td></tr>
<tr><td><tt>Server/<a href="#file3">Backend.php</a></tt></td><td align="right" id="added">+10</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.6">1.6</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend.php?r1=1.6&r2=1.7">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.7">1.7</a></td></tr>
<tr class="alt"><td><tt> /<a href="#file4">Exception.php</a></tt></td><td align="right" id="added">+15</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.5">1.5</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.5&r2=1.6">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.6">1.6</a></td></tr>
<tr><td><tt> /<a href="#file5">Backend.php</a></tt></td><td align="right" id="added">+10</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.6">1.6</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend.php?r1=1.6&r2=1.7">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.7">1.7</a></td></tr>
<tr class="alt"><td><tt> /<a href="#file6">Exception.php</a></tt></td><td align="right" id="added">+15</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.5">1.5</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.5&r2=1.6">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.6">1.6</a></td></tr>
<tr><td><tt>Server/Backend/<a href="#file7">DBDataObject.php</a></tt></td><td align="right" id="added">+149</td><td align="right" id="removed">-35</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.21">1.21</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.21&r2=1.22">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.22">1.22</a></td></tr>
<tr><td></td><td align="right" id="added">+209</td><td align="right" id="removed">-45</td><td></td></tr>
</table>
<small id="info">7 modified files</small><br />
<pre class="comment">
fully implement all REST support, including deletion
of rest stuff to match deletion from the database
</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.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.25">1.25</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.24 -r1.25
--- package.xml        20 Apr 2005 04:06:18 -0000        1.24
+++ package.xml        21 Apr 2005 03:39:49 -0000        1.25
@@ -26,7 +26,7 @@
</small></pre><pre class="diff" id="context"> <email>davey@php.net</email>
<active>yes</active>
</lead>
</pre><pre class="diff" id="removed">- <date>2005-04-<span id="removedchars">18</span></date>
</pre><pre class="diff" id="added">+ <date>2005-04-<span id="addedchars">20</span></date>
</pre><pre class="diff" id="context"> <version>
<release>0.18.0</release>
<api>0.18.0</api>
</pre><pre class="diff"><small id="info">@@ -39,6 +39,8 @@
</small></pre><pre class="diff" id="context"> <notes>
Implement REST support
fix subpackage support
</pre><pre class="diff" id="added">+ fix package.info
+ fix PHP5 issue with visibility of Xmlrpc5 server contructor
</pre><pre class="diff" id="context"> </notes>
<contents>
<dir name="/" baseinstalldir="Chiara/PEAR">
</pre><pre class="diff"><small id="info">@@ -581,6 +583,8 @@
</small></pre><pre class="diff" id="context"> <notes>
Implement REST support
fix subpackage support
</pre><pre class="diff" id="added">+ fix package.info
+ fix PHP5 issue with visibility of Xmlrpc5 server contructor
</pre><pre class="diff" id="context"> </notes>
</release>
</changelog>
</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.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/package.xml?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/package.xml?r=1.25">1.25</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.24 -r1.25
--- package.xml        20 Apr 2005 04:06:18 -0000        1.24
+++ package.xml        21 Apr 2005 03:39:49 -0000        1.25
@@ -26,7 +26,7 @@
</small></pre><pre class="diff" id="context"> <email>davey@php.net</email>
<active>yes</active>
</lead>
</pre><pre class="diff" id="removed">- <date>2005-04-<span id="removedchars">18</span></date>
</pre><pre class="diff" id="added">+ <date>2005-04-<span id="addedchars">20</span></date>
</pre><pre class="diff" id="context"> <version>
<release>0.18.0</release>
<api>0.18.0</api>
</pre><pre class="diff"><small id="info">@@ -39,6 +39,8 @@
</small></pre><pre class="diff" id="context"> <notes>
Implement REST support
fix subpackage support
</pre><pre class="diff" id="added">+ fix package.info
+ fix PHP5 issue with visibility of Xmlrpc5 server contructor
</pre><pre class="diff" id="context"> </notes>
<contents>
<dir name="/" baseinstalldir="Chiara/PEAR">
</pre><pre class="diff"><small id="info">@@ -581,6 +583,8 @@
</small></pre><pre class="diff" id="context"> <notes>
Implement REST support
fix subpackage support
</pre><pre class="diff" id="added">+ fix package.info
+ fix PHP5 issue with visibility of Xmlrpc5 server contructor
</pre><pre class="diff" id="context"> </notes>
</release>
</changelog>
</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>Backend.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.6">1.6</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend.php?r1=1.6&r2=1.7">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.7">1.7</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.6 -r1.7
--- Backend.php        19 Apr 2005 04:04:26 -0000        1.6
+++ Backend.php        21 Apr 2005 03:39:50 -0000        1.7
@@ -26,12 +26,20 @@
</small></pre><pre class="diff" id="context">
abstract public function saveReleaseREST($package, $version);
</pre><pre class="diff" id="added">+ abstract public function saveAllReleasesREST($package);
+
</pre><pre class="diff" id="context"> abstract public function savePackageREST($package);
</pre><pre class="diff" id="added">+ abstract public function deletePackageREST($package);
+
</pre><pre class="diff" id="context"> abstract public function saveCategoryREST($category);
</pre><pre class="diff" id="added">+ abstract public function deleteCategoryREST($category);
+
</pre><pre class="diff" id="context"> abstract public function deleteRelease($packagename, $version);
</pre><pre class="diff" id="added">+ abstract public function deleteReleaseREST($packagename, $version);
+
</pre><pre class="diff" id="context"> abstract public function getReleasePath($packagename, $version);
/**
</pre><pre class="diff"><small id="info">@@ -87,6 +95,8 @@
</small></pre><pre class="diff" id="context"> */
abstract public function addPackage($package);
</pre><pre class="diff" id="added">+ abstract public function deletePackage($packagename, $category);
+
</pre><pre class="diff" id="context"> /**
* @param Chiara_PEAR_Server_Package
*/
</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>Exception.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.5">1.5</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.5&r2=1.6">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.6">1.6</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.5 -r1.6
--- Exception.php        19 Apr 2005 04:04:26 -0000        1.5
+++ Exception.php        21 Apr 2005 03:39:50 -0000        1.6
@@ -226,12 +226,12 @@
</small></pre><pre class="diff" id="context">
class Chiara_PEAR_Server_ExceptionInvalidRelease extends Chiara_PEAR_Server_Exception
{
</pre><pre class="diff" id="removed">- protected $_message = 'Invalid release uploaded';
</pre><pre class="diff" id="added">+ protected $_message = 'Invalid release uploaded<span id="addedchars">: "%info%"</span>';
</pre><pre class="diff" id="context">
public function __construct($packagefile, $msg = false)
{
</pre><pre class="diff" id="removed">- $this->_data = array();
- parent::__construct($msg ? $msg : $this->_message, $packagefile->getUserInfo());
</pre><pre class="diff" id="added">+ $this->_data = array('info' => $packagefile->getUserInfo());
+ parent::__construct($msg ? $msg : $this->_message);
</pre><pre class="diff" id="context"> }
}
</pre><pre class="diff"><small id="info">@@ -242,7 +242,18 @@
</small></pre><pre class="diff" id="context"> public function __construct($package, $version, $msg = false)
{
$this->_data = array('p' => $package, 'v' => $version);
</pre><pre class="diff" id="removed">- parent::__construct($msg ? $msg : $this->_message<span id="removedchars">, $packagefile->getUserInfo()</span>);
</pre><pre class="diff" id="added">+ parent::__construct($msg ? $msg : $this->_message);
+ }
+}
+
+class Chiara_PEAR_Server_ExceptionCannotDeleteHasReleases extends Chiara_PEAR_Server_Exception
+{
+ protected $_message = 'Package %p% in channel %c cannot be deleted, delete all releases first';
+
+ public function __construct($package, $channel)
+ {
+ $this->_data = array('p' => $package, 'c' => $channel);
+ parent::__construct($msg ? $msg : $this->_message);
</pre><pre class="diff" id="context"> }
}
?>
</pre><pre class="diff"><small id="info">\ No newline at end of file
</small></pre></div>
<hr /><a name="file5" /><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>Backend.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.6">1.6</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend.php?r1=1.6&r2=1.7">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend.php?r=1.7">1.7</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.6 -r1.7
--- Backend.php        19 Apr 2005 04:04:26 -0000        1.6
+++ Backend.php        21 Apr 2005 03:39:50 -0000        1.7
@@ -26,12 +26,20 @@
</small></pre><pre class="diff" id="context">
abstract public function saveReleaseREST($package, $version);
</pre><pre class="diff" id="added">+ abstract public function saveAllReleasesREST($package);
+
</pre><pre class="diff" id="context"> abstract public function savePackageREST($package);
</pre><pre class="diff" id="added">+ abstract public function deletePackageREST($package);
+
</pre><pre class="diff" id="context"> abstract public function saveCategoryREST($category);
</pre><pre class="diff" id="added">+ abstract public function deleteCategoryREST($category);
+
</pre><pre class="diff" id="context"> abstract public function deleteRelease($packagename, $version);
</pre><pre class="diff" id="added">+ abstract public function deleteReleaseREST($packagename, $version);
+
</pre><pre class="diff" id="context"> abstract public function getReleasePath($packagename, $version);
/**
</pre><pre class="diff"><small id="info">@@ -87,6 +95,8 @@
</small></pre><pre class="diff" id="context"> */
abstract public function addPackage($package);
</pre><pre class="diff" id="added">+ abstract public function deletePackage($packagename, $category);
+
</pre><pre class="diff" id="context"> /**
* @param Chiara_PEAR_Server_Package
*/
</pre></div>
<hr /><a name="file6" /><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.5">1.5</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.5&r2=1.6">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.6">1.6</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.5 -r1.6
--- Exception.php        19 Apr 2005 04:04:26 -0000        1.5
+++ Exception.php        21 Apr 2005 03:39:50 -0000        1.6
@@ -226,12 +226,12 @@
</small></pre><pre class="diff" id="context">
class Chiara_PEAR_Server_ExceptionInvalidRelease extends Chiara_PEAR_Server_Exception
{
</pre><pre class="diff" id="removed">- protected $_message = 'Invalid release uploaded';
</pre><pre class="diff" id="added">+ protected $_message = 'Invalid release uploaded<span id="addedchars">: "%info%"</span>';
</pre><pre class="diff" id="context">
public function __construct($packagefile, $msg = false)
{
</pre><pre class="diff" id="removed">- $this->_data = array();
- parent::__construct($msg ? $msg : $this->_message, $packagefile->getUserInfo());
</pre><pre class="diff" id="added">+ $this->_data = array('info' => $packagefile->getUserInfo());
+ parent::__construct($msg ? $msg : $this->_message);
</pre><pre class="diff" id="context"> }
}
</pre><pre class="diff"><small id="info">@@ -242,7 +242,18 @@
</small></pre><pre class="diff" id="context"> public function __construct($package, $version, $msg = false)
{
$this->_data = array('p' => $package, 'v' => $version);
</pre><pre class="diff" id="removed">- parent::__construct($msg ? $msg : $this->_message<span id="removedchars">, $packagefile->getUserInfo()</span>);
</pre><pre class="diff" id="added">+ parent::__construct($msg ? $msg : $this->_message);
+ }
+}
+
+class Chiara_PEAR_Server_ExceptionCannotDeleteHasReleases extends Chiara_PEAR_Server_Exception
+{
+ protected $_message = 'Package %p% in channel %c cannot be deleted, delete all releases first';
+
+ public function __construct($package, $channel)
+ {
+ $this->_data = array('p' => $package, 'c' => $channel);
+ parent::__construct($msg ? $msg : $this->_message);
</pre><pre class="diff" id="context"> }
}
?>
</pre><pre class="diff"><small id="info">\ No newline at end of file
</small></pre></div>
<hr /><a name="file7" /><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.21">1.21</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.21&r2=1.22">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.22">1.22</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.21 -r1.22
--- DBDataObject.php        20 Apr 2005 23:30:22 -0000        1.21
+++ DBDataObject.php        21 Apr 2005 03:39:50 -0000        1.22
@@ -96,7 +96,11 @@
</small></pre><pre class="diff" id="context"> if (!$releases->find()) {
return false;
}
</pre><pre class="diff" id="removed">- return $releases->delete() !== false;
</pre><pre class="diff" id="added">+ $ret = ($releases->delete() !== false);
+ if ($ret) {
+ $this->deleteReleaseREST($packagename, $version);
+ }
+ return $ret;
</pre><pre class="diff" id="context"> }
public function saveRelease(Chiara_PEAR_Server_Release $release)
</pre><pre class="diff"><small id="info">@@ -192,14 +196,27 @@
</small></pre><pre class="diff" id="context"> $releasedata = DB_DataObject::factory('releases');
$releasedata->channel = $this->_channel;
$releasedata->package = $package;
</pre><pre class="diff" id="added">+ $releasedata->orderby('releasedate');
</pre><pre class="diff" id="context"> if (!$releasedata->find(false)) {
</pre><pre class="diff" id="removed">- throw new Chiara_PEAR_Server_ExceptionPackageDoesntExist($package, $this->_channel);
</pre><pre class="diff" id="added">+ return;
</pre><pre class="diff" id="context"> }
$info = '<a>
<p>' . $package . '</p>
<c>' . $this->_channel . '</c>
';
while ($releasedata->fetch()) {
</pre><pre class="diff" id="added">+ if (!isset($latest)) {
+ $latest = $releasedata->version;
+ }
+ if ($releasedata->state == 'stable' && !isset($stable)) {
+ $stable = $releasedata->version;
+ }
+ if ($releasedata->state == 'beta' && !isset($beta)) {
+ $beta = $releasedata->version;
+ }
+ if ($releasedata->state == 'alpha' && !isset($alpha)) {
+ $alpha = $releasedata->version;
+ }
</pre><pre class="diff" id="context"> $info .= ' <r><v>' . $releasedata->version . '</v><s>' . $releasedata->state . '</s></r>
';
}
</pre><pre class="diff"><small id="info">@@ -209,10 +226,56 @@
</small></pre><pre class="diff" id="context"> System::mkdir(array('-p', $rdir . DIRECTORY_SEPARATOR . $package));
@chmod($rdir . DIRECTORY_SEPARATOR . $package, 0777);
}
</pre><pre class="diff" id="removed">- file_put_contents($rdir . DIRECTORY_SEPARATOR . $<span id="removedchars">release['package']</span> .
</pre><pre class="diff" id="added">+ file_put_contents($rdir . DIRECTORY_SEPARATOR . $<span id="addedchars">package</span> .
</pre><pre class="diff" id="context"> DIRECTORY_SEPARATOR . 'allreleases.xml', $info);
</pre><pre class="diff" id="removed">- @chmod($rdir . DIRECTORY_SEPARATOR . $<span id="removedchars">release['package']</span> .
</pre><pre class="diff" id="added">+ @chmod($rdir . DIRECTORY_SEPARATOR . $<span id="addedchars">package</span> .
</pre><pre class="diff" id="context"> DIRECTORY_SEPARATOR . 'allreleases.xml', 0666);
</pre><pre class="diff" id="added">+
+ file_put_contents($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'latest.txt', $version);
+ @chmod($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'latest.txt', 0666);
+ if (isset($stable)) {
+ file_put_contents($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'stable.txt', $stable);
+ @chmod($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'stable.txt', 0666);
+ }
+ if (isset($beta)) {
+ file_put_contents($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'beta.txt', $beta);
+ @chmod($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'beta.txt', 0666);
+ }
+ if (isset($alpha)) {
+ file_put_contents($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'alpha.txt', $alpha);
+ @chmod($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'alpha.txt', 0666);
+ }
+ }
+ }
+
+ public function deleteReleaseREST($package, $version)
+ {
+ $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';
+ }
+ $rdir = $this->_restdir . DIRECTORY_SEPARATOR . 'r';
+ if (!file_exists($rdir . DIRECTORY_SEPARATOR . $package)) {
+ return;
+ }
+ @unlink($rdir . DIRECTORY_SEPARATOR . $version . '.xml');
+ @unlink($rdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'package.' . $version . '.xml');
+ $this->saveAllReleasesREST($package);
</pre><pre class="diff" id="context"> }
}
</pre><pre class="diff"><small id="info">@@ -237,38 +300,11 @@
</small></pre><pre class="diff" id="context"> }
$release = $releasedata->toArray();
$rdir = $this->_restdir . DIRECTORY_SEPARATOR . 'r';
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> if (!file_exists($rdir . DIRECTORY_SEPARATOR . $package)) {
System::mkdir(array('-p', $rdir . DIRECTORY_SEPARATOR . $package));
@chmod($rdir . DIRECTORY_SEPARATOR . $package, 0777);
}
</pre><pre class="diff" id="removed">- if (@file_exists($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . 'latest.txt')) {
- $latest = file_get_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . 'latest.txt', $latest);
- if (version_compare($latest, $version, '<')) {
- file_put_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . 'latest.txt', $version);
- }
- } else {
- file_put_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . 'latest.txt', $version);
- }
- @chmod($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . 'latest.txt', 0666);
- if (@file_exists($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . $release['state'] . '.txt')) {
- $latest = file_get_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . $release['state'] . '.txt', $latest);
- if (version_compare($latest, $version, '<')) {
- file_put_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . $release['state'] . '.txt', $version);
- }
- } else {
- file_put_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . $release['state'] . '.txt', $version);
- }
- @chmod($rdir . DIRECTORY_SEPARATOR . $release['package'] .
- DIRECTORY_SEPARATOR . $release['state'] . '.txt', 0666);
</pre><pre class="diff" id="context">
$info = '<?xml version="1.0"?>
<r>
</pre><pre class="diff"><small id="info">@@ -290,7 +326,7 @@
</small></pre><pre class="diff" id="context"> file_put_contents($rdir . DIRECTORY_SEPARATOR . $release['package'] .
DIRECTORY_SEPARATOR . 'package.' .
$version . '.xml', $this->getPackageXml($release['package'], $version));
</pre><pre class="diff" id="removed">- @chmod($rdir . DIRECTORY_SEPARATOR . $<span id="removedchars">packag</span>e['package'] .
</pre><pre class="diff" id="added">+ @chmod($rdir . DIRECTORY_SEPARATOR . $<span id="addedchars">releas</span>e['package'] .
</pre><pre class="diff" id="context"> DIRECTORY_SEPARATOR . 'package.' . $version . '.xml', 0666);
}
}
</pre><pre class="diff"><small id="info">@@ -371,13 +407,20 @@
</small></pre><pre class="diff" id="context">
public function deleteCategory($category)
{
</pre><pre class="diff" id="added">+ if ($category == 'Default') {
+ return false;
+ }
</pre><pre class="diff" id="context"> $categories = DB_DataObject::factory('categories');
$categories->name = $category;
$categories->channel = $this->_channel;
if (!$categories->find()) {
throw new Chiara_PEAR_Server_ExceptionCategoryDoesntExist($category, $this->_channel);
}
</pre><pre class="diff" id="removed">- return $categories->delete() !== false;
</pre><pre class="diff" id="added">+ $ret = ($categories->delete() !== false);
+ if ($ret) {
+ $this->deleteCategoryREST($category);
+ }
+ return $ret;
</pre><pre class="diff" id="context"> }
public function categoryFromId($id)
</pre><pre class="diff"><small id="info">@@ -468,6 +511,29 @@
</small></pre><pre class="diff" id="context"> return $ret;
}
</pre><pre class="diff" id="added">+ public function deleteCategoryREST($category)
+ {
+ $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';
+ }
+ $cdir = $this->_restdir . DIRECTORY_SEPARATOR . 'c';
+ $category = $this->categoryInfo($category);
+ if (!file_exists($cdir . DIRECTORY_SEPARATOR . urlencode($category['name']))) {
+ return;
+ }
+ // remove all category info
+ System::rm(array('-r', $this->_restdir . DIRECTORY_SEPARATOR . 'c'
+ . DIRECTORY_SEPARATOR . urlencode($category['name'])));
+ }
+ }
+
</pre><pre class="diff" id="context"> public function saveCategoryREST($category)
{
$channel = DB_DataObject::factory('channels');
</pre><pre class="diff"><small id="info">@@ -509,11 +575,34 @@
</small></pre><pre class="diff" id="context"> // list packages in a category
file_put_contents($cdir . DIRECTORY_SEPARATOR . urlencode($category['name']) .
DIRECTORY_SEPARATOR . 'packages.xml', $list);
</pre><pre class="diff" id="removed">- @chmod($cdir . DIRECTORY_SEPARATOR . $category['name'] .
</pre><pre class="diff" id="added">+ @chmod($cdir . DIRECTORY_SEPARATOR . urlencode($category['name']) .
</pre><pre class="diff" id="context"> DIRECTORY_SEPARATOR . 'packages.xml', 0666);
}
}
</pre><pre class="diff" id="added">+ public function deletePackageREST($package, $category)
+ {
+ $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';
+ }
+
+ // remove all package and release info for the package
+ System::rm(array('-r', $this->_restdir . DIRECTORY_SEPARATOR . 'p'
+ . DIRECTORY_SEPARATOR . $package));
+ System::rm(array('-r', $this->_restdir . DIRECTORY_SEPARATOR . 'r'
+ . DIRECTORY_SEPARATOR . $package));
+ // reset categories info
+ $this->saveCategoryREST($category);
+ }
+ }
+
</pre><pre class="diff" id="context"> public function savePackageREST($package)
{
$channel = DB_DataObject::factory('channels');
</pre><pre class="diff"><small id="info">@@ -648,6 +737,31 @@
</small></pre><pre class="diff" id="context"> return $ret;
}
</pre><pre class="diff" id="added">+ public function deletePackage($packagename)
+ {
+ $packages = DB_DataObject::factory('packages');
+ $packages->channel = $this->_channel;
+ $packages->package = $packagename;
+ if (!$packages->find(true)) {
+ throw new Chiara_PEAR_Server_ExceptionPackageDoesntExist($package, $this->_channel);
+ }
+ $categories = DB_DataObject::factory('categories');
+ $categories->channel = $this->_channel;
+ $categories->id = $packages->category_id;
+ $categories->find(true);
+ $releases = DB_DataObject::factory('releases');
+ $releases->channel = $this->_channel;
+ $releases->package = $packagename;
+ if ($releases->find()) {
+ throw new Chiara_PEAR_Server_ExceptionCannotDeleteHasReleases($package, $this->_channel);
+ }
+ $ret = $packages->delete() !== false;
+ if ($ret) {
+ $this->deletePackageREST($packagename, $categories->name);
+ }
+ return $ret;
+ }
+
</pre><pre class="diff" id="context"> public function addPackage($pkg)
{
$package = DB_DataObject::factory('packages');
</pre></div>
</body></html><pre>