changed package to Panacea, initial bootstrapper and landing page

This commit is contained in:
tmont 2008-10-13 07:57:18 +00:00
parent 64379360f0
commit a4eef39058
7 changed files with 76 additions and 9 deletions

4
src/.htaccess Normal file
View File

@ -0,0 +1,4 @@
RewriteEngine On
RewriteCond %{REQUEST_URI} !.*index\.php
RewriteRule .+ /wiki/index.php [L]

48
src/bootstrap.php Normal file
View File

@ -0,0 +1,48 @@
<?php
/**
* Bootstrapper for <i>Panacea</i>
*
* @package Panacea
* @author Tommy Montgomery
* @since 2008-10-12
*/
/** Bootstraps the NowhereConcave framework */
require_once 'NowhereConcave/bootstrap.php';
/**
* Autoloader for <i>Panacea</i>
*
* @author Tommy Montgomery
* @since 2008-10-12
*
* @param string $className Name of the class to load
*/
function panacea_autoload($className) {
$path = dirname(__FILE__);
$file = '';
switch ($className) {
case 'WikiControllerFactory':
case 'WikiPageController':
case 'WikiViewFactory':
$file = "$path/inc/$className.php";
break;
case 'WikiPageView':
$file = "$path/inc/views/$className.php";
break;
}
if (!empty($file) && is_file($file)) {
require_once $file;
}
}
//registers panacea_autoload() as an autoload function
if (spl_autoload_functions() === false || !in_array('panacea_autoload', spl_autoload_functions())) {
spl_autoload_register('panacea_autoload');
}
?>

View File

@ -3,7 +3,7 @@
/**
* WikiControllerFactory
*
* @package Wiki
* @package Panacea
* @author Tommy Montgomery
* @since 2008-10-05
*/
@ -14,7 +14,7 @@
/**
* Creates a {@link Controller}
*
* @package Wiki
* @package Panacea
* @author Tommy Montgomery
* @since 2008-10-05
*/

View File

@ -3,7 +3,7 @@
/**
* WikiPageController
*
* @package Wiki
* @package Panacea
* @author Tommy Montgomery
* @since 2008-10-05
*/
@ -14,7 +14,7 @@
/**
* Wiki page controller
*
* @package Wiki
* @package Panacea
* @author Tommy Montgomery
* @since 2008-10-05
*/

View File

@ -3,7 +3,7 @@
/**
* WikiViewFactory
*
* @package Wiki
* @package Panacea
* @author Tommy Montgomery
* @since 2008-10-05
*/
@ -14,7 +14,7 @@
/**
* Factory for generating {@link View}s
*
* @package Wiki
* @package Panacea
* @author Tommy Montgomery
* @since 2008-10-05
*/

View File

@ -3,10 +3,10 @@
/**
* WikiPageView
*
* @package Wiki
* @package Panacea
* @subpackage Views
* @author Tommy Montgomery
* @since 2008-07-03
* @since 2008-10-05
*/
/** Bootstraps the NowhereConcave framework */
@ -15,7 +15,7 @@
/**
* View for standard wiki pages
*
* @package Wiki
* @package Panacea
* @subpackage Views
* @author Tommy Montgomery
* @since 2008-10-05

15
src/index.php Normal file
View File

@ -0,0 +1,15 @@
<?php
/** Bootstraps the Panacea framework */
require_once 'bootstrap.php';
$request = Request::create(HttpUtil::HTTP_METHOD_GET);
$request->uri = 'http://www.example.com';
Dispatcher::getInstance()->setUriRegex('^/wiki/(.*)')
->setThrowExceptions(true)
->setControllerFactory(WikiControllerFactory::getInstance())
->setRequest($request)
->dispatch($_SERVER['REQUEST_URI']);
?>