Permalink
Browse files

Pass pear directory per parameter

  • Loading branch information...
1 parent 0b76a10 commit 25deb785f60ce953a7ed5b1b6efb92c95bb2988e @cweiske cweiske committed Nov 16, 2006
Showing with 39 additions and 3 deletions.
  1. +13 −1 examples/dumpStats.php
  2. +13 −1 examples/genSimple.php
  3. +13 −1 examples/listPackages.php
View
14 examples/dumpStats.php
@@ -1,7 +1,19 @@
<?php
require_once 'QA/Pear/PackageStatus.php';
-$ps = new QA_Pear_PackageStatus('/data/cvs/pear/pear/');
+if ($argc < 2) {
+ echo <<<EOD
+Dumps statistics to the console.
+Usage:
+ php dumpStats.php path/to/pearcvs/
+
+EOD;
+ exit(1);
+}
+
+$strPearDir = $argv[1];
+
+$ps = new QA_Pear_PackageStatus($strPearDir);
$ps->gatherStats();
var_dump($ps->getStats());
?>
View
14 examples/genSimple.php
@@ -2,7 +2,19 @@
require_once 'QA/Pear/PackageStatus.php';
require_once 'QA/Pear/PackageStatus/Renderer/Simple.php';
-$ps = new QA_Pear_PackageStatus('/data/cvs/pear/pear/');
+if ($argc < 2) {
+ echo <<<EOD
+Generates simple PEAR package stats.
+Usage:
+ php genSimple.php path/to/pearcvs/
+
+EOD;
+ exit(1);
+}
+
+$strPearDir = $argv[1];
+
+$ps = new QA_Pear_PackageStatus($strPearDir);
$ps->gatherStats();
$rs = new QA_Pear_PackageStatus_Renderer_Simple();
echo $rs->render($ps->getStats());
View
14 examples/listPackages.php
@@ -1,8 +1,20 @@
<?php
require_once 'QA/Pear/PackageStatus/PackageXmlFinder.php';
+if ($argc < 2) {
+ echo <<<EOD
+Lists all packages found.
+Usage:
+ php listPackages.php path/to/pearcvs/
+
+EOD;
+ exit(1);
+}
+
+$strPearDir = $argv[1];
+
foreach (QA_Pear_PackageStatus_PackageXmlFinder::findPackageXmlFiles(
- '/data/cvs/pear/pear/'
+ $strPearDir
)
as $strPackageName => $strPackageFile)
{

0 comments on commit 25deb78

Please sign in to comment.