Skip to content

Commit

Permalink
Pass pear directory per parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiske committed Nov 16, 2006
1 parent 0b76a10 commit 25deb78
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
14 changes: 13 additions & 1 deletion examples/dumpStats.php
@@ -1,7 +1,19 @@
<?php <?php
require_once 'QA/Pear/PackageStatus.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(); $ps->gatherStats();
var_dump($ps->getStats()); var_dump($ps->getStats());
?> ?>
14 changes: 13 additions & 1 deletion examples/genSimple.php
Expand Up @@ -2,7 +2,19 @@
require_once 'QA/Pear/PackageStatus.php'; require_once 'QA/Pear/PackageStatus.php';
require_once 'QA/Pear/PackageStatus/Renderer/Simple.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(); $ps->gatherStats();
$rs = new QA_Pear_PackageStatus_Renderer_Simple(); $rs = new QA_Pear_PackageStatus_Renderer_Simple();
echo $rs->render($ps->getStats()); echo $rs->render($ps->getStats());
Expand Down
14 changes: 13 additions & 1 deletion examples/listPackages.php
@@ -1,8 +1,20 @@
<?php <?php
require_once 'QA/Pear/PackageStatus/PackageXmlFinder.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( foreach (QA_Pear_PackageStatus_PackageXmlFinder::findPackageXmlFiles(
'/data/cvs/pear/pear/' $strPearDir
) )
as $strPackageName => $strPackageFile) as $strPackageName => $strPackageFile)
{ {
Expand Down

0 comments on commit 25deb78

Please sign in to comment.