<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">Exception.php</a></tt></td><td align="right" id="added">+11</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.7">1.7</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.7&r2=1.8">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.8">1.8</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.4">1.4</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.4&r2=1.5">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.5">1.5</a></td></tr>
<tr><td><tt><a href="#file3">Exception.php</a></tt></td><td align="right" id="added">+11</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.7">1.7</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.7&r2=1.8">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.8">1.8</a></td></tr>
<tr class="alt"><td><tt><a href="#file4">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.4">1.4</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.4&r2=1.5">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.5">1.5</a></td></tr>
<tr><td><tt>Backend/<a href="#file5">DBDataObject.php</a></tt></td><td align="right" id="added">+119</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.25">1.25</a></td></tr>
<tr class="alt"><td><tt> /<a href="#file6">DBDataObject.php</a></tt></td><td align="right" id="added">+119</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.25">1.25</a></td></tr>
<tr><td><tt>Frontend/<a href="#file7">HTMLQuickForm.php</a></tt></td><td align="right" id="added">+9</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Frontend/HTMLQuickForm.php?r=1.8">1.8</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Frontend/HTMLQuickForm.php?r1=1.8&r2=1.9">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Frontend/HTMLQuickForm.php?r=1.9">1.9</a></td></tr>
<tr><td></td><td align="right" id="added">+271</td><td align="right" id="removed">-4</td><td></td></tr>
</table>
<small id="info">7 modified files</small><br />
<pre class="comment">
won't be used in the installer, but add maintainers REST
for completeness (no email/password is shown)
</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>Exception.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.7">1.7</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.7&r2=1.8">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.8">1.8</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.7 -r1.8
--- Exception.php        22 Apr 2005 02:31:14 -0000        1.7
+++ Exception.php        22 Apr 2005 23:15:34 -0000        1.8
@@ -256,4 +256,15 @@
</small></pre><pre class="diff" id="context"> parent::__construct($msg ? $msg : $this->_message);
}
}
</pre><pre class="diff" id="added">+
+class Chiara_PEAR_Server_ExceptionMaintainerManagesPackages extends Chiara_PEAR_Server_Exception
+{
+ protected $_message = 'Maintainer %m% cannot be deleted, this maintainer maintains packages';
+
+ public function __construct($maintainer, $msg = false)
+ {
+ $this->_data = array('m' => $maintainer);
+ 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="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.4">1.4</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.4&r2=1.5">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.5">1.5</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.4 -r1.5
--- restsetup.php        20 Apr 2005 23:25:39 -0000        1.4
+++ restsetup.php        22 Apr 2005 23:15:34 -0000        1.5
@@ -118,6 +118,7 @@
</small></pre><pre class="diff" id="context"> foreach ($packages as $package) {
$this->_ui->outputData(' Package ' . $package['package']);
$backend->savePackageREST($package['package']);
</pre><pre class="diff" id="added">+ $backend->savePackageMaintainersREST($package['package']);
</pre><pre class="diff" id="context"> $releases = $backend->listReleases($package['package']);
if (count($releases)) {
$backend->saveAllReleasesREST($package['package']);
</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.7">1.7</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Exception.php?r1=1.7&r2=1.8">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Exception.php?r=1.8">1.8</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.7 -r1.8
--- Exception.php        22 Apr 2005 02:31:14 -0000        1.7
+++ Exception.php        22 Apr 2005 23:15:34 -0000        1.8
@@ -256,4 +256,15 @@
</small></pre><pre class="diff" id="context"> parent::__construct($msg ? $msg : $this->_message);
}
}
</pre><pre class="diff" id="added">+
+class Chiara_PEAR_Server_ExceptionMaintainerManagesPackages extends Chiara_PEAR_Server_Exception
+{
+ protected $_message = 'Maintainer %m% cannot be deleted, this maintainer maintains packages';
+
+ public function __construct($maintainer, $msg = false)
+ {
+ $this->_data = array('m' => $maintainer);
+ 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="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>restsetup.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.4">1.4</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/restsetup.php?r1=1.4&r2=1.5">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/restsetup.php?r=1.5">1.5</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.4 -r1.5
--- restsetup.php        20 Apr 2005 23:25:39 -0000        1.4
+++ restsetup.php        22 Apr 2005 23:15:34 -0000        1.5
@@ -118,6 +118,7 @@
</small></pre><pre class="diff" id="context"> foreach ($packages as $package) {
$this->_ui->outputData(' Package ' . $package['package']);
$backend->savePackageREST($package['package']);
</pre><pre class="diff" id="added">+ $backend->savePackageMaintainersREST($package['package']);
</pre><pre class="diff" id="context"> $releases = $backend->listReleases($package['package']);
if (count($releases)) {
$backend->saveAllReleasesREST($package['package']);
</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>/<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.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.25">1.25</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.24 -r1.25
--- DBDataObject.php        22 Apr 2005 02:31:15 -0000        1.24
+++ DBDataObject.php        22 Apr 2005 23:15:34 -0000        1.25
@@ -175,12 +175,52 @@
</small></pre><pre class="diff" id="context"> $ret = $releasedata->insert();
if ($ret) {
$this->savePackageREST($releasedata->package);
</pre><pre class="diff" id="added">+ $this->savePackageMaintainersREST($releasedata->package);
</pre><pre class="diff" id="context"> $this->saveReleaseREST($releasedata->package, $releasedata->version);
$this->saveAllReleasesREST($releasedata->package);
}
return $ret;
}
</pre><pre class="diff" id="added">+ public function savePackageMaintainersREST($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/';
+ }
+ $maintainers = DB_DataObject::factory('maintainers');
+ $maintainers->package = $package;
+ $maintainers->channel = $this->_channel;
+ if ($maintainers->find(false)) {
+ $pdir = $this->_restdir . DIRECTORY_SEPARATOR . 'p';
+ if (!file_exists($pdir . DIRECTORY_SEPARATOR . $package)) {
+ System::mkdir(array('-p', $pdir . DIRECTORY_SEPARATOR . $package));
+ @chmod($pdir . DIRECTORY_SEPARATOR . $package, 0777);
+ }
+ $info = '<?xml version="1.0"?>
+<m>
+ <p>' . $package . '</p>
+ <c>' . htmlspecialchars($this->_channel) . '</c>
+';
+ while ($maintainers->fetch()) {
+ $info .= ' <m><h>' . $maintainers->handle . '</h><a>' . $maintainers->active .
+ '</a></h>';
+ }
+ $info .= '</m>';
+ file_put_contents($pdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'maintainers.xml', $info);
+ @chmod($pdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'maintainers.xml', 0666);
+ }
+ }
+ }
+
</pre><pre class="diff" id="context"> public function saveAllReleasesREST($package)
{
$channel = DB_DataObject::factory('channels');
</pre><pre class="diff"><small id="info">@@ -928,6 +968,44 @@
</small></pre><pre class="diff" id="context"> }
}
</pre><pre class="diff" id="added">+ public function deleteMaintainer($maintainer)
+ {
+ $handle = DB_DataObject::factory('handles');
+ $handle->handle = $maintainer->handle;
+ if (!$handle->find(true)) {
+ throw new Chiara_PEAR_Server_ExceptionMaintainerDoesntExist($handle->handle);
+ }
+ $packages = DB_DataObject::factory('maintainers');
+ $packages->handle = $handle->handle;
+ if ($packages->find()) {
+ throw new Chiara_PEAR_Server_ExceptionCannotDeleteMaintainer($handle->handle);
+ }
+ $ret = $packages->delete() !== false;
+ if ($ret) {
+ $this->deleteMaintainerREST($handle->handle);
+ }
+ return $ret;
+ }
+
+ public function deleteMaintainerREST(Chiara_PEAR_Server_Maintainer $maintainer)
+ {
+ $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/';
+ }
+ $mdir = $this->_restdir . DIRECTORY_SEPARATOR . 'm';
+ if (file_exists($mdir . DIRECTORY_SEPARATOR . $maintainer->handle)) {
+ System::rm(array('-r', $mdir . DIRECTORY_SEPARATOR . $maintainer->handle));
+ }
+ }
+ }
+
</pre><pre class="diff" id="context"> /**
* @param Chiara_PEAR_Server_Maintainer
*/
</pre><pre class="diff"><small id="info">@@ -941,7 +1019,42 @@
</small></pre><pre class="diff" id="context"> $handle->email = $maintainer->email;
$handle->name = $maintainer->name;
$handle->password = md5($maintainer->password);
</pre><pre class="diff" id="removed">- <span id="removedchars">return</span> $handle->insert();
</pre><pre class="diff" id="added">+ <span id="addedchars">$ret =</span> $handle->insert();
+ if ($ret) {
+ $this->saveMaintainerREST($maintainer);
+ }
+ return $ret;
+ }
+
+ public function saveMaintainerREST(Chiara_PEAR_Server_Maintainer $maintainer)
+ {
+ $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/';
+ }
+ $mdir = $this->_restdir . DIRECTORY_SEPARATOR . 'm';
+ if (!file_exists($mdir . DIRECTORY_SEPARATOR . $maintainer->handle)) {
+ System::mkdir(array('-p', $mdir . DIRECTORY_SEPARATOR . $maintainer->handle));
+ @chmod($mdir . DIRECTORY_SEPARATOR . $maintainer->handle, 0777);
+ }
+ $info = '<?xml version="1.0"?>
+<m>
+ <h>' . $maintainer->handle . '</h>
+ <n>' . htmlentities($maintainer->name) . '</n>
+ <u>' . htmlspecialchars($uri) . '</u>
+</m>';
+ // package information
+ file_put_contents($mdir . DIRECTORY_SEPARATOR . $maintainer->handle .
+ DIRECTORY_SEPARATOR . 'info.xml', $info);
+ @chmod($mdir . DIRECTORY_SEPARATOR . $maintainer->handle .
+ DIRECTORY_SEPARATOR . 'info.xml', 0666);
+ }
</pre><pre class="diff" id="context"> }
/**
</pre><pre class="diff"><small id="info">@@ -956,7 +1069,11 @@
</small></pre><pre class="diff" id="context"> }
$handle->email = $maintainer->email;
$handle->name = $maintainer->name;
</pre><pre class="diff" id="removed">- return $handle->update();
</pre><pre class="diff" id="added">+ $ret = $handle->update() !== false;
+ if ($ret) {
+ $this->saveMaintainerREST();
+ }
+ return $ret;
</pre><pre class="diff" id="context"> }
/**
</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>/<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.24">1.24</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.24&r2=1.25">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.25">1.25</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.24 -r1.25
--- DBDataObject.php        22 Apr 2005 02:31:15 -0000        1.24
+++ DBDataObject.php        22 Apr 2005 23:15:34 -0000        1.25
@@ -175,12 +175,52 @@
</small></pre><pre class="diff" id="context"> $ret = $releasedata->insert();
if ($ret) {
$this->savePackageREST($releasedata->package);
</pre><pre class="diff" id="added">+ $this->savePackageMaintainersREST($releasedata->package);
</pre><pre class="diff" id="context"> $this->saveReleaseREST($releasedata->package, $releasedata->version);
$this->saveAllReleasesREST($releasedata->package);
}
return $ret;
}
</pre><pre class="diff" id="added">+ public function savePackageMaintainersREST($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/';
+ }
+ $maintainers = DB_DataObject::factory('maintainers');
+ $maintainers->package = $package;
+ $maintainers->channel = $this->_channel;
+ if ($maintainers->find(false)) {
+ $pdir = $this->_restdir . DIRECTORY_SEPARATOR . 'p';
+ if (!file_exists($pdir . DIRECTORY_SEPARATOR . $package)) {
+ System::mkdir(array('-p', $pdir . DIRECTORY_SEPARATOR . $package));
+ @chmod($pdir . DIRECTORY_SEPARATOR . $package, 0777);
+ }
+ $info = '<?xml version="1.0"?>
+<m>
+ <p>' . $package . '</p>
+ <c>' . htmlspecialchars($this->_channel) . '</c>
+';
+ while ($maintainers->fetch()) {
+ $info .= ' <m><h>' . $maintainers->handle . '</h><a>' . $maintainers->active .
+ '</a></h>';
+ }
+ $info .= '</m>';
+ file_put_contents($pdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'maintainers.xml', $info);
+ @chmod($pdir . DIRECTORY_SEPARATOR . $package .
+ DIRECTORY_SEPARATOR . 'maintainers.xml', 0666);
+ }
+ }
+ }
+
</pre><pre class="diff" id="context"> public function saveAllReleasesREST($package)
{
$channel = DB_DataObject::factory('channels');
</pre><pre class="diff"><small id="info">@@ -928,6 +968,44 @@
</small></pre><pre class="diff" id="context"> }
}
</pre><pre class="diff" id="added">+ public function deleteMaintainer($maintainer)
+ {
+ $handle = DB_DataObject::factory('handles');
+ $handle->handle = $maintainer->handle;
+ if (!$handle->find(true)) {
+ throw new Chiara_PEAR_Server_ExceptionMaintainerDoesntExist($handle->handle);
+ }
+ $packages = DB_DataObject::factory('maintainers');
+ $packages->handle = $handle->handle;
+ if ($packages->find()) {
+ throw new Chiara_PEAR_Server_ExceptionCannotDeleteMaintainer($handle->handle);
+ }
+ $ret = $packages->delete() !== false;
+ if ($ret) {
+ $this->deleteMaintainerREST($handle->handle);
+ }
+ return $ret;
+ }
+
+ public function deleteMaintainerREST(Chiara_PEAR_Server_Maintainer $maintainer)
+ {
+ $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/';
+ }
+ $mdir = $this->_restdir . DIRECTORY_SEPARATOR . 'm';
+ if (file_exists($mdir . DIRECTORY_SEPARATOR . $maintainer->handle)) {
+ System::rm(array('-r', $mdir . DIRECTORY_SEPARATOR . $maintainer->handle));
+ }
+ }
+ }
+
</pre><pre class="diff" id="context"> /**
* @param Chiara_PEAR_Server_Maintainer
*/
</pre><pre class="diff"><small id="info">@@ -941,7 +1019,42 @@
</small></pre><pre class="diff" id="context"> $handle->email = $maintainer->email;
$handle->name = $maintainer->name;
$handle->password = md5($maintainer->password);
</pre><pre class="diff" id="removed">- <span id="removedchars">return</span> $handle->insert();
</pre><pre class="diff" id="added">+ <span id="addedchars">$ret =</span> $handle->insert();
+ if ($ret) {
+ $this->saveMaintainerREST($maintainer);
+ }
+ return $ret;
+ }
+
+ public function saveMaintainerREST(Chiara_PEAR_Server_Maintainer $maintainer)
+ {
+ $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/';
+ }
+ $mdir = $this->_restdir . DIRECTORY_SEPARATOR . 'm';
+ if (!file_exists($mdir . DIRECTORY_SEPARATOR . $maintainer->handle)) {
+ System::mkdir(array('-p', $mdir . DIRECTORY_SEPARATOR . $maintainer->handle));
+ @chmod($mdir . DIRECTORY_SEPARATOR . $maintainer->handle, 0777);
+ }
+ $info = '<?xml version="1.0"?>
+<m>
+ <h>' . $maintainer->handle . '</h>
+ <n>' . htmlentities($maintainer->name) . '</n>
+ <u>' . htmlspecialchars($uri) . '</u>
+</m>';
+ // package information
+ file_put_contents($mdir . DIRECTORY_SEPARATOR . $maintainer->handle .
+ DIRECTORY_SEPARATOR . 'info.xml', $info);
+ @chmod($mdir . DIRECTORY_SEPARATOR . $maintainer->handle .
+ DIRECTORY_SEPARATOR . 'info.xml', 0666);
+ }
</pre><pre class="diff" id="context"> }
/**
</pre><pre class="diff"><small id="info">@@ -956,7 +1069,11 @@
</small></pre><pre class="diff" id="context"> }
$handle->email = $maintainer->email;
$handle->name = $maintainer->name;
</pre><pre class="diff" id="removed">- return $handle->update();
</pre><pre class="diff" id="added">+ $ret = $handle->update() !== false;
+ if ($ret) {
+ $this->saveMaintainerREST();
+ }
+ return $ret;
</pre><pre class="diff" id="context"> }
/**
</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/Frontend">Frontend</a><br /></span>
<div class="fileheader"><big><b>HTMLQuickForm.php</b></big> <small id="info"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Frontend/HTMLQuickForm.php?r=1.8">1.8</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Frontend/HTMLQuickForm.php?r1=1.8&r2=1.9">-></a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Frontend/HTMLQuickForm.php?r=1.9">1.9</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.8 -r1.9
--- HTMLQuickForm.php        22 Apr 2005 02:31:15 -0000        1.8
+++ HTMLQuickForm.php        22 Apr 2005 23:15:34 -0000        1.9
@@ -617,6 +617,15 @@
</small></pre><pre class="diff" id="context"> {
try {
$info = $this->_backend->getMaintainer($maintainer);
</pre><pre class="diff" id="added">+ if (isset($_REQUEST['deleteMaintainer'])) {
+ if (!$this->_backend->deleteMaintainer($info)) {
+ throw new Chiara_PEAR_Server_ExceptionMaintainerDoesntExist($maintainer);
+ }
+ $this->_quickForm->addElement('header', '', 'Maintainer "' . $maintainer
+ . '" deleted successfully');
+ echo $this->_quickForm->toHtml();
+ return;
+ }
</pre><pre class="diff" id="context"> if (isset($_REQUEST['submitted'])) {
if ($this->_quickForm->validate()) {
$stuff = $this->_quickForm->getSubmitValues();
</pre></div>
</body></html><pre>