Source for file packages_status_detail.php
Documentation is available at packages_status_detail.php
+----------------------------------------------------------------------+
| PEAR Web site version 1.0 |
+----------------------------------------------------------------------+
| Copyright (c) 2001-2005 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Arnaud Limbourg <arnaud@limbourg.com> |
+----------------------------------------------------------------------+
* This page will show a list of packages with latest
* release information along with bug count and any other info
* that may be used to identify unmaintained packages
require 'HTML/Table.php';
extra_styles ('/css/packages_status.css');
// Sortable tables http://www.kryogenix.org/code/browser/sorttable/
$extra_header = '<script type="text/javascript" src="/javascript/sorttable.js"></script>';
$states = array ('snapshot', 'devel', 'alpha', 'beta', 'stable');
response_header ('Quality Assurance Initiative - Packages status',
report_error ('This is not a valid state');
include_once 'pear-database-package.php';
$packages = $pck->listAll (false , false );
if (PEAR ::isError ($packages)) {
report_error ('Cannot list packages');
$total_packages_nbr = $studied_packages_nbr = 0;
$time_scale = 15552000; // how much time elapsed since last release, in seconds
$tables[$state]['old'] = new HTML_Table (
$tables[$state]['old']->setCaption (
'Packages with state <em>'
. $state . '</em> which have not been released in '
. $time_scale / 86400 . ' days'
$tables[$state]['old']->setHeaderContents (0 , 0 , 'Package');
$tables[$state]['old']->setHeaderContents (0 , 1 , 'Version');
$tables[$state]['old']->setHeaderContents (0 , 2 , 'Date');
$tables[$state]['old']->setHeaderContents (0 , 3 , '# bugs');
$tables[$state]['new'] = new HTML_Table (
$tables[$state]['new']->setCaption (
'Packages with state <em>'
. $state . '</em> with a release in the past '
. $time_scale / 86400 . ' days'
$tables[$state]['new']->setHeaderContents (0 , 0 , 'Package');
$tables[$state]['new']->setHeaderContents (0 , 1 , 'Version');
$tables[$state]['new']->setHeaderContents (0 , 2 , 'Date');
$tables[$state]['new']->setHeaderContents (0 , 3 , '# bugs');
foreach ($packages as $package => $pck_data) {
$latest_release = $pck->getRecent (1 , $package);
if (PEAR ::isError ($latest_release) || count($latest_release) == 0 ) {
// we just want to see the packages for a given state
if ($latest_release[0 ]['state'] != $state) {
$release_date = strtotime($latest_release[0 ]['releasedate']);
if (time() - $time_scale > $release_date) {
$tables[$state][$status]->addRow (
make_link ('/package/' . $package,
$package, '', 'title="' . $package . '"'),
$latest_release[0 ]['version'],
date('Y-m-d', $release_date),
make_link ("/bugs/search.php?cmd=display&package_name%5B%5D=" . urlencode($package),
bugcount($package), '', 'title="Bugs for package ' . $package . '"')
foreach ($tables as $state => $table) {
if ($table['old']->getRowCount () > 1 ) {
$html .= '<p class="old">' . $table['old']->toHtml () . '</p>';
if ($table['new']->getRowCount () > 1 ) {
$html .= '<p id="new">' . $table['new']->toHtml () . '</div>' . "\n";
<h2>Number of packages in PEAR: {{TOTAL_PACKAGES_NUMBER}}</h2>
<h2>Number of packages studied here : {{STUDIED_PACKAGES_NUMBER}}</h2>
Page last updated on: {{UPDATE_DATE}}
'{{TOTAL_PACKAGES_NUMBER}}',
'{{STUDIED_PACKAGES_NUMBER}}',
* Count number of bugs for a package
* @return int number of bugs
package_name=' . $dbh->quoteSmart ($package) . '
AND status IN ("Open", "Critical", "Assigned", "Analyzed")
$count = $dbh->getOne ($query);
if (PEAR ::isError ($count)) {
if ($count > 0 && $count < 10 ) {
Documentation generated on Mon, 11 Mar 2019 15:46:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|