<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/Backend</tt></b> on <span id="info">MAIN</span></td></tr>
<tr><td><tt><a href="#file1">DBDataObject.php</a></tt></td><td align="right" id="added">+15</td><td align="right" id="removed">-20</td><td nowrap="nowrap" align="center"><a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.16">1.16</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.16&r2=1.17">-&gt;</a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.17">1.17</a></td></tr>
</table>
<pre class="comment">
add default category support (needs tweaking)
</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>/<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.16">1.16</a> <a href="http://cvs.phpdoc.org/diff.php/PEAR_Server/Server/Backend/DBDataObject.php?r1=1.16&r2=1.17">-&gt;</a> <a href="http://cvs.phpdoc.org/co.php/PEAR_Server/Server/Backend/DBDataObject.php?r=1.17">1.17</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.16 -r1.17
--- DBDataObject.php        20 Apr 2005 04:14:03 -0000        1.16
+++ DBDataObject.php        20 Apr 2005 04:19:13 -0000        1.17
@@ -326,13 +326,13 @@
</small></pre><pre class="diff" id="context"> 
     public function deleteCategory($category)
     {
</pre><pre class="diff" id="removed">-        $releases = DB_DataObject::factory('categories');
-        $releases-&gt;name = $category;
-        $releases-&gt;channel = $this-&gt;_channel;
-        if (!$releases-&gt;find()) {
</pre><pre class="diff" id="added">+        $categories = DB_DataObject::factory('categories');
+        $categories-&gt;name = $category;
+        $categories-&gt;channel = $this-&gt;_channel;
+        if (!$categories-&gt;find()) {
</pre><pre class="diff" id="context">             throw new Chiara_PEAR_Server_ExceptionCategoryDoesntExist($category, $this-&gt;_channel);
         }
</pre><pre class="diff" id="removed">-        return $<span id="removedchars">releas</span>es-&gt;delete() !== false;
</pre><pre class="diff" id="added">+        return $<span id="addedchars">categori</span>es-&gt;delete() !== false;
</pre><pre class="diff" id="context">     }
 
     public function categoryFromId($id)
</pre><pre class="diff"><small id="info">@@ -370,15 +370,10 @@
</small></pre><pre class="diff" id="context"> 
     public function listPackagesInCategory($category)
     {
</pre><pre class="diff" id="removed">-        $categories = DB_DataObject::factory('categories');
-        $categories-&gt;channel = $this-&gt;_channel;
-        $categories-&gt;name = $category;
-        if (!$categories-&gt;find(true)) {
-            throw new Chiara_PEAR_Server_ExceptionCategoryDoesntExist($category, $this-&gt;_channel);
-        }
</pre><pre class="diff" id="added">+        $info = $this-&gt;categoryInfo($category);
</pre><pre class="diff" id="context">         $packages = DB_DataObject::factory('packages');
         $packages-&gt;channel = $this-&gt;_channel;
</pre><pre class="diff" id="removed">-        $packages-&gt;category_id = $<span id="removedchars">categories-&gt;id</span>;
</pre><pre class="diff" id="added">+        $packages-&gt;category_id = $<span id="addedchars">info['id']</span>;
</pre><pre class="diff" id="context">         $packages-&gt;find(false);
         $ret = array();
         while ($packages-&gt;fetch()) {
</pre><pre class="diff"><small id="info">@@ -393,7 +388,7 @@
</small></pre><pre class="diff" id="context">         $categories-&gt;channel = $this-&gt;_channel;
         $categories-&gt;orderby('name');
         $categories-&gt;find(false);
</pre><pre class="diff" id="removed">-        $ret = array();
</pre><pre class="diff" id="added">+        $ret = array(<span id="addedchars">'Default'</span>);
</pre><pre class="diff" id="context">         while ($categories-&gt;fetch()) {
             $ret[] = $categories-&gt;toArray();
         }
</pre><pre class="diff"><small id="info">@@ -402,6 +397,9 @@
</small></pre><pre class="diff" id="context"> 
     public function addCategory($cat)
     {
</pre><pre class="diff" id="added">+        if ($cat-&gt;name == 'Default') {
+            throw new Chiara_PEAR_Server_ExceptionCategoryExists($cat-&gt;name, $this-&gt;_channel);
+        }
</pre><pre class="diff" id="context">         $category = DB_DataObject::factory('categories');
         $category-&gt;channel = $this-&gt;_channel;
         $save = clone $category;
</pre><pre class="diff"><small id="info">@@ -430,13 +428,7 @@
</small></pre><pre class="diff" id="context">                 $extra = '/';
             }
             $cdir = $this-&gt;_restdir . DIRECTORY_SEPARATOR . 'c';
</pre><pre class="diff" id="removed">-            $categories = DB_DataObject::factory('categories');
-            $categories-&gt;channel = $this-&gt;_channel;
-            $categories-&gt;name = $category;
-            if (!$categories-&gt;find(true)) {
-                throw new Chiara_PEAR_Server_ExceptionCategoryDoesntExist($category, $this-&gt;_channel);
-            }
-            $category = $categories-&gt;toArray();
</pre><pre class="diff" id="added">+            $category = $this-&gt;categoryInfo($category);
</pre><pre class="diff" id="context">             if (!file_exists($cdir . DIRECTORY_SEPARATOR . urlencode($category['name']))) {
                 System::mkdir(array('-p', $cdir . DIRECTORY_SEPARATOR . urlencode($category['name'])));
                 @chmod($cdir . DIRECTORY_SEPARATOR . urlencode($category['name']), 0777);
</pre><pre class="diff"><small id="info">@@ -539,6 +531,9 @@
</small></pre><pre class="diff" id="context"> 
     public function updateCategory($cat)
     {
</pre><pre class="diff" id="added">+        if ($cat-&gt;name == 'Default') {
+            return true;
+        }
</pre><pre class="diff" id="context">         $category = DB_DataObject::factory('categories');
         $category-&gt;channel = $this-&gt;_channel;
         $category-&gt;name = $cat-&gt;managecategory;
</pre></div>
</body></html><pre>