From 5330ba05cafe0c33ea7f6d0e0a0b7117117f246f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 6 Jun 2010 20:35:36 +0200 Subject: Introduce CommonTable, TableIterator, TablePearRepo classes (and use it in refresh) --- refresh.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'refresh.php') diff --git a/refresh.php b/refresh.php index 3be354f..cc56e84 100644 --- a/refresh.php +++ b/refresh.php @@ -44,6 +44,7 @@ if (isset($_SERVER["SERVER_NAME"])) { die("This script is launched twice a day, be patient"); } require "config.inc.php"; +require "class/CommonTable.php"; /** * To document @@ -306,18 +307,8 @@ try { // ------------------------------------------------------------------- if ($_SERVER['argc']==1 || in_array('pear', $_SERVER['argv'])) { echo date("r : ") . "PEAR reading channels\n"; - $channels=array( - "pear" => "pear.php.net" - ,"doctrine" => "pear.phpdoctrine.org" - ,"ezc" => "components.ez.no" - ,"pdepend" => "pear.pdepend.org" - ,"phing" => "pear.phing.info" - ,"phpdb" => "pear.phpdb.org" - ,"phpmd" => "pear.phpmd.org" - ,"phpunit" => "pear.phpunit.de" - ,"swift" => "pear.swiftmailer.org" - ,"symphony" => "pear.symfony-project.com" - ); + $pear = new TablePearRepo($db); + $channels = $pear->getAllRepo(); try { $nbtot=0; -- cgit From 3c22a10c40837b1695ae04d120bbfc68da01059c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 8 Jun 2010 20:04:48 +0200 Subject: add TableRRepo class and use it --- refresh.php | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) (limited to 'refresh.php') diff --git a/refresh.php b/refresh.php index 53aef84..7547883 100644 --- a/refresh.php +++ b/refresh.php @@ -508,47 +508,10 @@ try { // ------------------------------------------------------------------- if ($_SERVER['argc']==1 || in_array('R', $_SERVER['argv'])) { - - $repos = array( - array( - "name" => "R", - "state" => "stable", - "url" => "http://cran.at.r-project.org/src/contrib/PACKAGES" - ), - //array("name"=>"R-forge","state"=>"unstable", "url" => "http://r-forge.r-project.org/src/contrib/PACKAGES"), - array( - "name" => "biocp", - "state" => "stable", - "url" => "http://www.bioconductor.org/packages/release/bioc/src/contrib/PACKAGES" - ), - array( - "name" => "biocp", - "state" => "unstable", - "url" => "http://www.bioconductor.org/packages/devel/bioc/src/contrib/PACKAGES" - ), - array( - "name" => "bioca", - "state" => "stable", - "url" => "http://www.bioconductor.org/packages/release/data/annotation/src/contrib/PACKAGES" - ), - array( - "name" => "bioca", - "state" => "unstable", - "url" => "http://www.bioconductor.org/packages/devel/data/annotation/src/contrib/PACKAGES" - ), - array( - "name" => "bioce", - "state" => "stable", - "url" => "http://www.bioconductor.org/packages/release/data/experiment/src/contrib/PACKAGES" - ), - array( - "name" => "bioce", - "state" => "unstable", - "url" => "http://www.bioconductor.org/packages/devel/data/experiment/src/contrib/PACKAGES" - ) - ); +// $tottot=0; - foreach ($repos as $repo) { + $pear = new TableRRepo($db); + foreach ($pear->request() as $repo) { echo date("r : ") . "Reading " . $repo["name"] . " (" . $repo["state"] . ")\n"; $index = @file_get_contents($repo["url"]); -- cgit From 825c4679551854f48c6c6b67e5c5b7f7322d24d2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 8 Jun 2010 20:25:59 +0200 Subject: improves previous, add active field to pearrepo table --- refresh.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'refresh.php') diff --git a/refresh.php b/refresh.php index 7547883..e839e93 100644 --- a/refresh.php +++ b/refresh.php @@ -510,8 +510,8 @@ try { if ($_SERVER['argc']==1 || in_array('R', $_SERVER['argv'])) { // $tottot=0; - $pear = new TableRRepo($db); - foreach ($pear->request() as $repo) { + $rrepo = new TableRRepo($db); + foreach ($rrepo->request() as $repo) { echo date("r : ") . "Reading " . $repo["name"] . " (" . $repo["state"] . ")\n"; $index = @file_get_contents($repo["url"]); -- cgit