<?php // Error Levels: E_ERROR, E_WARNING, E_PARSE, E_NOTICE, E_ALL, E_STRICT error_reporting(E_ALL); ini_set('display_errors', '1');
/** * RuneWiki Wiki Engine * * * ChangeLog: * <dl> * <dt></dt><dd></dd> * <dt>1.0.0 2009-03-21</dt><dd>Initial Class Creation.</dd> * </dl> * @author RuneImp <runeimp@gmail.com> * @version 1.0.0 */
class WikiEngine { // CLASS INFO CONSTANTS // const CLASS_AUTHOR = 'RuneImp <runeimp@gmail.com>'; const CLASS_NAME = __CLASS__; const CLASS_NAMESPACE = 'runeimp.runewiki'; const CLASS_FQN = 'runeimp.runewiki.WikiEngine'; const CLASS_VERSION = '1.0.0';
// CLASS CONSTANTS // const PARSER_DEFAULT = 'rune';//'WikiRune'; const RENDERER_DEFAULT = 'xhtml';//'WikiXhtml';
// CLASS VARIABLES // private $_parser; private $_parserName; private $_renderer; private $_rendererName;
public function __construct($parser=self::PARSER_DEFAULT, $renderer=self::RENDERER_DEFAULT) { $this->init($parser, $renderer); }
private function init($parser=NULL, $renderer=NULL) { $this->setParser($parser); $this->setRenderer($renderer); }
public function parse($text, $parser=NULL) { $this->setParser($parser); return $this->_parser->parse($text); }
public function render($parsed, $renderer=NULL) { $this->setRenderer($renderer); return $this->_renderer->render($parsed); }
private function setParser($parser=NULL) { if($parser != NULL) { // Set New Parser If Valid // $this->_parserName = 'Wiki'.ucfirst(strtolower($parser)); $classFile = CLASS_PATH.'/runeimp/runewiki/parsers/'.$this->_parserName.'.php'; include_once $classFile; $this->_parser = new $this->_parserName(); } }
private function setRenderer($renderer=NULL) { if($renderer != NULL) { // Set New Renderer If Valid // $this->_rendererName = 'Wiki'.ucfirst(strtolower($renderer)); $classFile = CLASS_PATH.'/runeimp/runewiki/renderers/'.$this->_rendererName.'.php'; include_once $classFile; $this->_renderer = new $this->_rendererName(); } }
public function transform($text, $parser=NULL, $renderer=NULL) { $this->setParser($parser); $this->setRenderer($renderer);
$parsed = $this->parse($text); $return = $this->render($parsed, $renderer); return $return; } } ?>
Blitz Agency Labs
Search Engine Optimization for Flash Websites. We did it, here’s how.
Guidelines for Project Directory Structure and Naming Conventions
Article: Version Control your Flash Development with SubVersion | a Step by Step How To Guide
.o0O0O0o0O0Q
--------------
POOP (Preternatural Object Oriented Programing): Code which makes you shit yourself.
Whole Screen: Shift + Cmd + 3
Drag and Grab: Shift + Cmd + 4