| | Colin Viebrock | | Tomas V.V.Cox | | Martin Jansen | | Richard Heyes | | Ferenc Kovacs | | Pierre Joye | | Wez Furlong | | Peter Kokot | +----------------------------------------------------------------------+ */ use App\BorderBox; use App\Utils\ImageSize; use \PEAR as PEAR; // Send charset header("Content-Type: text/html; charset=utf-8"); PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "error_handler"); $extra_styles = []; $GLOBALS['main_menu'] = [ '/index.php' => 'Home', '/news/' => 'News' ]; $GLOBALS['docu_menu'] = [ '/support.php' => 'Support' ]; $GLOBALS['downloads_menu'] = [ '/packages.php' => 'Browse Packages', '/package-search.php' => 'Search Packages', '/package-stats.php' => 'Download Statistics' ]; $GLOBALS['developer_menu'] = [ '/accounts.php' => 'Account Browser', '/release-upload.php' => 'Upload Release', '/package-new.php' => 'New Package' ]; $GLOBALS['admin_menu'] = [ '/admin/' => 'Overview', '/admin/package-maintainers.php' => 'Maintainers', '/admin/category-manager.php' => 'Categories' ]; $GLOBALS['_style'] = ''; function response_header($title = 'The PHP Extension Community Library', $style = false) { global $_style, $_header_done, $SIDEBAR_DATA, $extra_styles, $auth_user, $container, $auth; if ($_header_done) { return; } $_header_done = true; $_style = $style; $rts = rtrim($SIDEBAR_DATA); if (substr($rts, -1) == '-') { $SIDEBAR_DATA = substr($rts, 0, -1); } else { global $main_menu, $docu_menu, $downloads_menu; $SIDEBAR_DATA .= draw_navigation($main_menu); $SIDEBAR_DATA .= draw_navigation($docu_menu, 'Documentation:'); $SIDEBAR_DATA .= draw_navigation($downloads_menu, 'Downloads:'); if ($auth->isLoggedIn()) { global $developer_menu; $SIDEBAR_DATA .= draw_navigation($developer_menu, 'Developers:'); if ($auth_user->isAdmin()) { global $admin_menu; $SIDEBAR_DATA .= draw_navigation($admin_menu, 'Administrators:'); } } } ?> PECL :: <?php echo $title; ?> \n"; } ?> >
Login'; } else { print ''; print 'Logged in as ' . strtoupper($auth_user->handle) . ' ('; print 'Info | '; print 'Profile | '; print 'Bugs'; print ")
\n"; echo 'Logout'; } echo ' | '; echo 'Packages'; echo ' | '; echo 'Support'; echo ' | '; echo 'Bugs'; ?>
PRIVACY POLICY  |  CREDITS
Copyright © 2001- The PHP Group
All rights reserved.
Last updated: get('last_updated'); ?>
Bandwidth and hardware provided by: pair Networks
$menu_title\n"; } $html .= '
    ' . "\n"; foreach ($data as $url => $tit) { $html .= '
  • '; if ($url == $_SERVER['PHP_SELF']) { $html .= '' . $tit . ''; } else { $html .= '' . $tit . ''; } $html .= "
  • \n"; } $html .= "
\n\n"; return $html; } /** * Display errors or warnings as a
    inside a
    * * Here's what happens depending on $in: * + string: value is printed * + array: looped through and each value is printed. * If array is empty, nothing is displayed. * If a value contains a PEAR_Error object, * + PEAR_Error: prints the value of getMessage() and getUserInfo() * if development environment is set, otherwise prints data from getMessage(). * * @param string|array|PEAR_Error $in see long description * @param string $class name of the HTML class for the
    tag. * ("errors", "warnings") * @param string $head string to be put above the message * * @return bool true if errors were submitted, false if not */ function report_error($in, $class = 'errors', $head = 'ERROR:') { global $config; if (PEAR::isError($in)) { if ($config->get('env') === 'dev') { $in = [$in->getMessage() . '... ' . $in->getUserInfo()]; } else { $in = [$in->getMessage()]; } } elseif (!is_array($in)) { $in = [$in]; } elseif (!count($in)) { return false; } echo '
    ' . $head . '
      '; foreach ($in as $msg) { if (PEAR::isError($msg)) { if ($config->get('env') === 'dev') { $msg = $msg->getMessage() . '... ' . $msg->getUserInfo(); } else { $msg = $msg->getMessage(); } } echo '
    • ' . htmlspecialchars($msg) . "
    • \n"; } echo "
    \n"; return true; } /** * Forwards warnings to report_error() * * For use with PEAR_ERROR_CALLBACK to get messages to be formatted as warnings * rather than errors. * * @param string|array|PEAR_Error $in see report_error() for more info * * @return bool true if errors were submitted, false if not * * @see report_error() */ function report_warning($in) { return report_error($in, 'warnings', 'WARNING:'); } /** * Generates a complete PECL web page with an error message in it then calls * exit. * * For use with PEAR_ERROR_CALLBACK error handling mode to print fatal errors * and die. * * @param string|array|PEAR_Error $in see report_error() for more info * @param string $title string to be put above the message * * @return void * * @see report_error() */ function error_handler($errobj, $title = 'Error') { response_header($title); report_error($errobj); response_footer(); exit; } /** * Redirects to the given full or partial URL. This function does not return. * * @param string $url Full/partial url to redirect to */ function localRedirect($url) { header('Location: '.$url); exit; }