diff options
author | Remi Collet <fedora@famillecollet.com> | 2010-06-06 18:08:06 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2010-06-06 18:08:06 +0200 |
commit | eadf625a51b23a8f62505949df863bdc8b2d0546 (patch) | |
tree | 23a4967280fcf9830c84be44d6e287de38ecb17c | |
parent | c0f065e6bddad3c69fd802749608f05b9351ba4f (diff) |
create a class folder and move FedoraClient
-rw-r--r-- | class/FedoraClient.php (renamed from FedoraClient.php) | 0 | ||||
-rwxr-xr-x | fedcli.php | 43 | ||||
-rw-r--r-- | main.inc.php | 2 |
3 files changed, 23 insertions, 22 deletions
diff --git a/FedoraClient.php b/class/FedoraClient.php index e003a03..e003a03 100644 --- a/FedoraClient.php +++ b/class/FedoraClient.php @@ -2,33 +2,34 @@ <?php /* * FedoraClient is a PHP classe to interact with web services - * + * * fedcli.php is a command line tools to test FedoraClient clmsses - * + * * Copyright (C) 2010 Remi Collet * http://github.com/remicollet/rpmphp. - * + * * Inspired from python-fedora - * + * * FedoraClient is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * python-fedora is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * See <http://www.gnu.org/licenses/> */ - + + 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(); } ?> diff --git a/main.inc.php b/main.inc.php index a846e16..c9ec889 100644 --- a/main.inc.php +++ b/main.inc.php @@ -37,7 +37,7 @@ define('RPMPHP_VERSION', '1.0.0-dev'); require 'config.inc.php'; require '/usr/share/php/Smarty/Smarty.class.php'; -require 'FedoraClient.php'; +require 'class/FedoraClient.php'; $smarty = new Smarty(); |