![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| cellog Thu May 24 01:39:27 2007 UTC Modified files: /pearweb/include pear-database-category.php Log: fix REST handling for categories # thank you unit tests! http://cvs.php.net/viewvc.cgi/pearwe...&diff_format=u Index: pearweb/include/pear-database-category.php diff -u pearweb/include/pear-database-category.php:1.2 pearweb/include/pear-database-category.php:1.3 --- pearweb/include/pear-database-category.php:1.2 Mon Apr 23 04:21:41 2007 +++ pearweb/include/pear-database-category.php Thu May 24 01:39:27 2007 @@ -18,7 +18,7 @@ | Martin Jansen <mj@php.net> | | Richard Heyes <richard@php.net> | +----------------------------------------------------------------------+ - $Id: pear-database-category.php,v 1.2 2007/04/23 04:21:41 cellog Exp $ + $Id: pear-database-category.php,v 1.3 2007/05/24 01:39:27 cellog Exp $ */ // These classes correspond to tables and methods define operations on @@ -74,6 +74,7 @@ } $GLOBALS['pear_rest']->saveCategoryREST($name); $GLOBALS['pear_rest']->saveAllCategoriesREST(); + $GLOBALS['pear_rest']->savePackagesCategoryREST($name); return $id; } @@ -87,10 +88,12 @@ */ static function update($id, $name, $desc = '') { - return $GLOBALS['dbh']->query(sprintf('UPDATE categories SET name = %s, description = %s WHERE id = %d', - $GLOBALS['dbh']->quote($name), - $GLOBALS['dbh']->quote($desc), - $id)); + $GLOBALS['pear_rest']->deleteCategoryREST($GLOBALS['dbh']->getOne('SELECT name FROM categories WHERE id = ?', array($id))); + $ret = $GLOBALS['dbh']->query('UPDATE categories SET name = ?, description = ? WHERE id = ?', array($name, $desc, $id)); + $GLOBALS['pear_rest']->saveCategoryREST($name); + $GLOBALS['pear_rest']->saveAllCategoriesREST(); + $GLOBALS['pear_rest']->savePackagesCategoryREST($name); + return $ret; } /** @@ -131,6 +134,7 @@ $GLOBALS['dbh']->query(sprintf('UPDATE categories SET parent = %s WHERE parent = %d', ($parentID ? $parentID : 'NULL'), $id)); $GLOBALS['pear_rest']->deleteCategoryREST($name); + $GLOBALS['pear_rest']->saveAllCategoriesREST(); return true; } | |||
| Featured Websites | ||||
|
![]() |
| Tags: cvs, include, pearweb |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cvs: pearweb /include pear-rest.php | Greg Beaver | Pear | 0 | 05-27-2007 7:46 PM |
| cvs: pearweb /include pear-database-package.php /public_html account-request-newpackage.php | Arnaud Limbourg | Pear | 0 | 05-27-2007 7:46 PM |
| cvs: pearweb /include pear-rest.php | Greg Beaver | Pear | 0 | 05-27-2007 7:46 PM |
| cvs: pearweb /include pear-database-package.php | Mark Wiesemann | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pearweb /include pear-database-user.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| Featured Websites | ||||
|