svn: /pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/ CLI.php REST/Category.php

From: Date: Mon, 09 Nov 2009 02:27:11 +0000
Subject: svn: /pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/ CLI.php REST/Category.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9018@lists.php.net to get a copy of this message
saltybeagle Mon, 09 Nov 2009 02:27:11 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=290405 Log: Get categorize command working. Changed paths: U pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/CLI.php U pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/REST/Category.php Modified: pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/CLI.php =================================================================== --- pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/CLI.php 2009-11-09 01:54:23 UTC (rev 290404) +++ pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/CLI.php 2009-11-09 02:27:11 UTC (rev 290405) @@ -71,11 +71,14 @@ $args['package'] = $_SERVER['argv'][2]; $args['category'] = $_SERVER['argv'][3]; $categories = new Categories($this->channel); + if (!$categories->exists($args['category'])) { + echo 'That category doesn\'t exist yet. Use add-category first' . PHP_EOL; + } $categories->linkPackageToCategory($args['package'], $args['category']); $category = new REST\Category($this->dir . '/rest', $this->channel->name, 'rest/', $categories); $category->saveAllCategories(); $category->savePackagesInfo($args['category']); - echo "Added {$args['package']} to {$args['category']} \n"; + echo "Added {$args['package']} to {$args['category']} \n"; } function printCategorizeUsage() Modified: pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/REST/Category.php =================================================================== --- pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/REST/Category.php 2009-11-09 01:54:23 UTC (rev 290404) +++ pear2/sandbox/SimpleChannelServer/trunk/src/SimpleChannelServer/REST/Category.php 2009-11-09 02:27:11 UTC (rev 290405) @@ -124,9 +124,8 @@ function savePackagesInfo($category) { $xml = array(); - $pdir = $this->rest . 'p'; - $rdir = $this->rest . 'r'; - + $pdir = $this->rest . DIRECTORY_SEPARATOR . 'p'; + $rdir = $this->rest . DIRECTORY_SEPARATOR . 'r'; $packages = $this->_categories->packagesInCategory($category); $reader = new \pear2\Pyrus\XMLParser; clearstatcache();

« previous php.pear.core (#9018) next »