示例#1
0
 * See the enclosed file LICENSE for license information (BSD). If you did
 * did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE.
 *
 * @author Ben Klang <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
$jonah = Horde_Registry::appInit('jonah', array('authentication' => 'none', 'session_control' => 'readonly'));
$m = new Horde_Routes_Mapper();
require JONAH_BASE . '/config/routes.php';
if (file_exists(JONAH_BASE . '/config/routes.local.php')) {
    include JONAH_BASE . '/config/routes.local.php';
}
$templates = Horde::loadConfiguration('templates.php', 'templates', 'jonah');
// Grab, and hopefully match, the URL
$request = new Horde_Controller_Request_Http();
$url = $request->getPath();
$args = $request->getGetParams();
$result = $m->match('/' . $url);
$criteria = array();
// @TODO: This should be handled by controller objects, but for now just use
// a switch conditional until we move to Horde_Controller
switch ($result['controller']) {
    case 'admin':
        // TODO:
        exit;
    case 'feed':
        // Default settings
        $defaults = array('format' => 'html', 'feed' => $result['feed']);
        // Check for the format specification
        if ($pos = strrpos($result['feed'], '.')) {
            $criteria['feed'] = substr($result['feed'], 0, $pos);