diff options
author | Marcin Juszkiewicz <hrw@openembedded.org> | 2006-08-25 10:22:29 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openembedded.org> | 2006-08-25 10:22:29 +0000 |
commit | 219969bfd684be1d202d581830107b98dd1c9165 (patch) | |
tree | da3a3a77f2360fd6a38bcce641f6ad980d78d7be /contrib/feed-browser/includes | |
parent | 18c800d7eca93e36f914679391a8a7961dad4f8b (diff) | |
parent | a4d66865597b43a26875dd649bedf0ca25099e8f (diff) |
merge of '20692657869f7a733266d5313f4932a7ff336fb4'
and 'df229e8fdb521adfc364395363401a190529731c'
Diffstat (limited to 'contrib/feed-browser/includes')
-rw-r--r-- | contrib/feed-browser/includes/config.inc | 118 | ||||
-rw-r--r-- | contrib/feed-browser/includes/functions.inc | 101 |
2 files changed, 135 insertions, 84 deletions
diff --git a/contrib/feed-browser/includes/config.inc b/contrib/feed-browser/includes/config.inc new file mode 100644 index 0000000000..1397d2c947 --- /dev/null +++ b/contrib/feed-browser/includes/config.inc @@ -0,0 +1,118 @@ +<?php + +define('DB_FILENAME', './feeds2.db'); + +$feeds = array( + array( + 'distro_name'=>'OpenZaurus', + 'distro_version'=>'3.5.4', + 'feed_base_url'=>'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4/feed/', + 'feeds'=>array( + array( + 'name'=>'base', + 'url'=>'base', + ), + array( + 'name'=>'opie', + 'url'=>'opie', + ), + array( + 'name'=>'x11', + 'url'=>'x11', + ), + array( + 'name'=>'upgrades', + 'url'=>'upgrades', + ), + array( + 'name'=>'perl', + 'url'=>'perl', + ), + array( + 'name'=>'python', + 'url'=>'python', + ), + array( + 'name'=>'Collie upgrades', + 'url'=>'upgrades/machine/collie', + ), + array( + 'name'=>'Tosa upgrades', + 'url'=>'upgrades/machine/tosa', + ), + array( + 'name'=>'Poodle upgrades', + 'url'=>'upgrades/machine/poodle', + ), + array( + 'name'=>'Poodle', + 'url'=>'machine/poodle', + ), + array( + 'name'=>'Collie', + 'url'=>'machine/collie', + ), + array( + 'name'=>'Tosa', + 'url'=>'machine/tosa', + ) + ) + ), + array( + 'distro_name'=>'OpenZaurus', + 'distro_version'=>'3.5.4.1', + 'feed_base_url'=>'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/', + 'feeds'=>array( + array( + 'name'=>'base', + 'url'=>'base', + ), + array( + 'name'=>'opie', + 'url'=>'opie', + ), + array( + 'name'=>'perl', + 'url'=>'perl', + ), + array( + 'name'=>'python', + 'url'=>'python', + ), + array( + 'name'=>'upgrades', + 'url'=>'upgrades', + ), + array( + 'name'=>'x11', + 'url'=>'x11', + ), + array( + 'name'=>'C7x0', + 'url'=>'machine/c7x0', + ), + array( + 'name'=>'Spitz', + 'url'=>'machine/spitz', + ), + array( + 'name'=>'Akita', + 'url'=>'machine/akita', + ), + array( + 'name'=>'Akita upgrades', + 'url'=>'upgrades/machine/akita', + ), + array( + 'name'=>'C7x0 upgrades', + 'url'=>'upgrades/machine/c7x0', + ), + array( + 'name'=>'Spitz upgrades', + 'url'=>'upgrades/machine/spitz', + ) + ) + ) +); + +?> diff --git a/contrib/feed-browser/includes/functions.inc b/contrib/feed-browser/includes/functions.inc index d18b129650..4edf3f4369 100644 --- a/contrib/feed-browser/includes/functions.inc +++ b/contrib/feed-browser/includes/functions.inc @@ -20,8 +20,6 @@ error_reporting(E_ALL); -define('DB_FILENAME', './feeds.db'); - function db_query($query) { $result = FALSE; @@ -36,7 +34,6 @@ function db_query($query) return $result; } - function db_query_n($query) { $result = FALSE; @@ -76,88 +73,24 @@ function db_table_exists ($db, $mytable) return FALSE; } -function test_insert_ipkgs ($db) +function insert_feeds ($db) { + global $feeds; - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-base', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/base') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-opie', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/opie') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-perl', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/perl') - "); - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-python', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/python') - "); - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-upgrades', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/upgrades') - "); - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-x11', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/x11') - "); - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-machine-c7x0', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/machine/c7x0') - "); - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-machine-spitz', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/machine/spitz') - "); - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-machine-akita', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/machine/akita') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-upgrades-machine-akita', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/upgrades/machine/akita') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-upgrades-machine-c7x0', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/upgrades/machine/c7x0') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-upgrades-machine-spitz', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/upgrades/machine/spitz') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('3541-upgrades-machine-tosa', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4.1/feed/upgrades/machine/tosa') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('354-base', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4/feed/base') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('354-opie', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4/feed/opie') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('354-x11', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4/feed/x11') - "); - - sqlite_query($db, - "INSERT INTO feeds (f_name, f_uri) - VALUES ('354-upgrades', 'http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/3.5.4/feed/upgrades') - "); - + if(isset($feeds)) + { + foreach($feeds as $distro) + { + foreach($distro['feeds'] as $feed) + { + sqlite_query($db, "INSERT INTO feeds (f_name, f_uri) VALUES + ( + '{$distro['distro_name']} {$distro['distro_version']} {$feed['name']}', + '{$distro['feed_base_url']}{$feed['url']}' + )"); + } + } + } } function searchletter($searchletter = '') @@ -492,7 +425,7 @@ function check_database() f_uri varchar(100), f_comments varchar(500))"); - test_insert_ipkgs ($db) ; + insert_feeds ($db) ; } sqlite_close($db); |