Exemple #1
0
        /*********************************************************
         * Redirect for short form /sites/mysitename urls
         *********************************************************/
        if (isset($_SERVER['PATH_INFO']) && preg_match('/^\\/sites\\/([\\w_-]+)\\/?/', $_SERVER['PATH_INFO'], $matches)) {
            $harmoni->request->setRequestParam('site', $matches[1]);
            $harmoni->request->setModuleAction('view', 'html');
        }
        $harmoni->execute();
    } catch (UnknownActionException $e) {
        // If we are passed a Segue1-style URL, forward to an appropriate place.
        Segue1UrlResolver::forwardCurrentIfNeeded();
        // If we were not forwarded, re-throw
        throw $e;
    } catch (UnknownIdException $e) {
        // If we are passed a Segue1-style URL, forward to an appropriate place.
        Segue1UrlResolver::forwardCurrentIfNeeded();
        // If we were not forwarded, re-throw
        throw $e;
    }
    // Handle certain types of uncaught exceptions specially. In particular,
    // Send back HTTP Headers indicating that an error has ocurred to help prevent
    // crawlers from continuing to pound invalid urls.
} catch (UnknownActionException $e) {
    SegueErrorPrinter::handleException($e, 404);
} catch (NullArgumentException $e) {
    SegueErrorPrinter::handleException($e, 400);
} catch (PermissionDeniedException $e) {
    SegueErrorPrinter::handleException($e, 403);
} catch (UnknownIdException $e) {
    SegueErrorPrinter::handleException($e, 404);
} catch (Exception $e) {