dynamic determination of the needed URI regular expression, plus comments
This commit is contained in:
parent
a4eef39058
commit
d252ef0104
@ -1,12 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Landing page for all requests to the Panacea application
|
||||
*
|
||||
* @package Panacea
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-12
|
||||
*/
|
||||
|
||||
/** Bootstraps the Panacea framework */
|
||||
require_once 'bootstrap.php';
|
||||
|
||||
$request = Request::create(HttpUtil::HTTP_METHOD_GET);
|
||||
$request = Request::create(HttpUtil::HTTP_METHOD_GET);
|
||||
$request->uri = 'http://www.example.com';
|
||||
|
||||
Dispatcher::getInstance()->setUriRegex('^/wiki/(.*)')
|
||||
$uriRegex = str_replace(str_replace('/', DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT']), '', dirname(__FILE__));
|
||||
$uriRegex = str_replace('\\', '/', $uriRegex);
|
||||
$uriRegex = '^' . $uriRegex . '/(.*)';
|
||||
|
||||
Dispatcher::getInstance()->setUriRegex($uriRegex)
|
||||
->setThrowExceptions(true)
|
||||
->setControllerFactory(WikiControllerFactory::getInstance())
|
||||
->setRequest($request)
|
||||
|
Loading…
Reference in New Issue
Block a user