changed package to Panacea, initial bootstrapper and landing page
This commit is contained in:
		
							parent
							
								
									64379360f0
								
							
						
					
					
						commit
						a4eef39058
					
				
							
								
								
									
										4
									
								
								src/.htaccess
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/.htaccess
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | ||||
| RewriteEngine On | ||||
| 
 | ||||
| RewriteCond %{REQUEST_URI} !.*index\.php | ||||
| RewriteRule .+ /wiki/index.php [L] | ||||
							
								
								
									
										48
									
								
								src/bootstrap.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/bootstrap.php
									
									
									
									
									
										Normal 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'); | ||||
| 	} | ||||
| 	 | ||||
| 
 | ||||
| ?>
 | ||||
| @ -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 | ||||
| 	 */ | ||||
|  | ||||
| @ -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 | ||||
| 	 */ | ||||
|  | ||||
| @ -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 | ||||
| 	 */ | ||||
|  | ||||
| @ -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
									
								
							
							
						
						
									
										15
									
								
								src/index.php
									
									
									
									
									
										Normal 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']); | ||||
| 
 | ||||
| ?>
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user