cvs: pearweb /sql addcategories.php
| From: | Stig Bakken | Date: | Sun, 02 Sep 2001 02:21:46 +0000 |
| Subject: | cvs: pearweb /sql addcategories.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-745@lists.php.net to get a copy of this message | ||
ssb Sat Sep 1 22:21:46 2001 EDT
Modified files:
/pearweb/sql addcategories.php
Log:
* rename categories (dissociate from package names)
Index: pearweb/sql/addcategories.php
diff -u pearweb/sql/addcategories.php:1.1 pearweb/sql/addcategories.php:1.2
--- pearweb/sql/addcategories.php:1.1 Sat Sep 1 13:11:52 2001
+++ pearweb/sql/addcategories.php Sat Sep 1 22:21:46 2001
@@ -1,31 +1,37 @@
<?php
+
// Drops all categories and adds sample categories
+
error_reporting(E_ALL);
require_once 'DB.php';
require_once 'DB/storage.php';
require_once '../include/pear-database.php';
-PEAR::setErrorHandling(PEAR_ERROR_DIE);
-$dbh = DB::connect('mysql://pear:pear@localhost/pear');
+
+if (empty($dbh)) {
+ $dbh = DB::connect('mysql://pear:pear@localhost/pear');
+ $dbh->setErrorHandling(PEAR_ERROR_DIE);
+}
+
$dbh->query('DELETE FROM categories');
$categories = array(
- 'Benchmark' => '',
- 'Cache' => '',
- 'Console' => '',
- 'Crypt' => '',
- 'DB' => '',
- 'Date' => '',
- 'File' => '',
- 'HTML' => '',
- 'HTTP' => '',
- 'Image' => '',
- 'Log' => '',
- 'Mail' => '',
- 'Math' => '',
- 'Net' => '',
- 'Numbers' => '',
- 'Payment' => '',
- 'Schedule' => '',
- 'XML' => ''
+ 'Benchmarking' => '',
+ 'Caching' => '',
+ 'Console' => '',
+ 'Encryption' => '',
+ 'Database' => '',
+ 'Date and Time' => '',
+ 'File System' => '',
+ 'HTML' => '',
+ 'HTTP' => '',
+ 'Images' => '',
+ 'Logging' => '',
+ 'Mail' => '',
+ 'Math' => '',
+ 'Networking' => '',
+ 'Numbers' => '',
+ 'Payment' => '',
+ 'Scheduling' => '',
+ 'XML' => ''
);
foreach($categories as $name => $desc) {