From eadf625a51b23a8f62505949df863bdc8b2d0546 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 6 Jun 2010 18:08:06 +0200 Subject: create a class folder and move FedoraClient --- fedcli.php | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'fedcli.php') diff --git a/fedcli.php b/fedcli.php index ce9c31a..eb897c4 100755 --- a/fedcli.php +++ b/fedcli.php @@ -2,33 +2,34 @@ */ - + + require 'Console/Getargs.php'; -require 'FedoraClient.php'; +require 'class/FedoraClient.php'; function Help() { echo "\nFedora Client Command Line usage\n\n"; - + echo "fdcli command options\n"; echo "\tbranch: branch info\n"; echo "\tbranches: list branches\n"; @@ -43,11 +44,11 @@ function Branches() { "debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0") ); $args =& Console_Getargs::factory($config); - + if (PEAR::isError($args)) { die (Console_Getargs::getHelp($config)); } - + $client = new FedoraPkgdb(array('debug' => intval($args->getValue('debug')))); $branches = $client->getBranches(); foreach ($branches as $name => $branch) { @@ -62,11 +63,11 @@ function Branch() { "debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0") ); $args =& Console_Getargs::factory($config); - + if (PEAR::isError($args)) { die (Console_Getargs::getHelp($config)); } - + $client = new FedoraPkgdb(array('debug' => intval($args->getValue('debug')))); $branch = $client->getBranch($args->getValue('branch')); print_r($branch); @@ -78,11 +79,11 @@ function CritPath() { "debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0") ); $args =& Console_Getargs::factory($config); - + if (PEAR::isError($args)) { die (Console_Getargs::getHelp($config)); } - + $client = new FedoraPkgdb(array('debug' => intval($args->getValue('debug')))); $branch = $client->getCritPath(); print_r($branch); @@ -94,7 +95,7 @@ function Package() { "debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0") ); $args =& Console_Getargs::factory($config); - + if (PEAR::isError($args)) { die (Console_Getargs::getHelp($config)); } @@ -104,7 +105,7 @@ function Package() { if (!$rep) { die("Package not found\n"); } - + $first = true; foreach ($rep as $branch => $pack) { if ($first) { @@ -114,7 +115,7 @@ function Package() { echo "Description:\n".$pack['package']['description']."\n"; } echo $branch.":\t".$pack['owner']; - + $i=0; foreach ($pack['people'] as $user) { if (isset($user['aclOrder']['commit']['statuscode']) && $user['aclOrder']['commit']['statuscode']==3) { @@ -130,11 +131,11 @@ function Version() { "debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0") ); $args =& Console_Getargs::factory($config); - + if (PEAR::isError($args)) { die (Console_Getargs::getHelp($config)."\n"); } - + echo "PHP Fedora Client class version ".FEDORACLIENT_VERSION."\n"; } @@ -147,6 +148,6 @@ switch ($cmd) { case 'critpath': CritPath(); break; case 'package': Package(); break; case 'version': Version(); break; - default: Help(); + default: Help(); } ?> -- cgit