Пример #1
0
function Version()
{
    $config = array("server" => array('short' => 's', 'max' => 1, 'min' => 1, 'desc' => "server URL", 'default' => ""), "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";
    $client = new FedoraPkgdb(array('debug' => intval($args->getValue('debug')), 'server' => $args->getValue('server')));
    echo "pkgdb version " . $client->getVersion() . "\n";
}
Пример #2
0
 * @package   RPMPHP
 *
 * @author    Remi Collet <*****@*****.**>
 * @author    Johan Cwiklinski <*****@*****.**>
 * @copyright 2010-2014 Remi Collet
 * @license   http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version
 * @link      http://github.com/remicollet/rpmphp/
 * @since     The begining of times.
*/
header('Content-Type: application/json;charset=utf-8');
require 'include/main.php';
$name = $_GET['name'];
if (!isset($name) || !$name) {
    $fedpkg = array('error' => 'No name provided');
} else {
    $fedcli = new FedoraPkgdb();
    $fedpkg = $fedcli->getPackageInfo($name);
    if ($fedpkg === false) {
        $fedpkg = array('error' => 'Unknown package');
    } else {
        //let's clean all little to avoid heavy json
        foreach (array_keys($fedpkg) as $k) {
            unset($fedpkg[$k]['specfile']);
            unset($fedpkg[$k]['groups']);
            unset($fedpkg[$k]['collection']);
            unset($fedpkg[$k]['collectionid']);
            unset($fedpkg[$k]['critpath']);
            unset($fedpkg[$k]['qacontact']);
            unset($fedpkg[$k]['statuschange']);
            unset($fedpkg[$k]['statuscode']);
            unset($fedpkg[$k]['id']);
Пример #3
0
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with rpmphp.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  Main
 * @package   RPMPHP
 *
 * @author    Remi Collet <*****@*****.**>
 * @author    Johan Cwiklinski <*****@*****.**>
 * @copyright 2010-2014 Remi Collet
 * @license   http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version
 * @link      http://github.com/remicollet/rpmphp/
 * @since     The begining of times.
*/
require 'include/main.php';
$fedcli = new FedoraPkgdb();
$name = $_GET['rpm'];
$type = isset($_GET['type']) ? $_GET['type'] : "html";
$smarty->assign('name_required', true);
$smarty->assign('name', $name);
$ariane[] = array('url' => '#', 'text' => 'Package: ' . $name);
$ajax_infos = '<span class="ajax">(wait for ajax or <a href="' . $_SERVER['PHP_SELF'] . '?rpm=' . $name . '&amp;pkgdb=1">reload with pkgdb</a>)</span>';
$smarty->assign('ajax_infos', $ajax_infos);
$smarty->assign('ariane', $ariane);
$smarty->assign('page_title', 'Package: ' . $name);
/**
* Retrieve people informations for a specific branch
*
* @param array $params Array of parameters
*
* @return string