Undefined
By: Guest | Date: Mar 27 2010 12:52 | Format: PHP | Expires: never | Size: 7.4 KB | Hits: 1039
- <?php
- FINAL CLASS ILLI_Constructeur
- {
- private static $SELF = NULL;
- private $INSTANCES = NULL;
- private static $initialized = FALSE;
- private static $executed = FALSE;
- private static $applicationProfile = '';
- private function __construct()
- {
- $this->INSTANCES =& new ILLI_InstanceLoader;
- $this->INSTANCES
- -> setNameMask('ILLI_Sequence')
- -> setReferenceObject($this)
- -> load(Api)
- -> load(Boot)
- -> load(Frontend)
- -> load(Output)
- -> init();
- }
- public function __get($name)
- {
- return $this->INSTANCES->$name;
- }
- public static function init(ILLI $ILLI)
- {
- try
- {
- if(FALSE === self::$initialized)
- self::$initialized = TRUE;
- else throw new ILLI_Constructeur_Exception
- ('ILLI already initialized..');
- if(NULL === self::$SELF)
- self::$SELF =& new self;
- return self::$SELF;
- }
- catch(ILLI_Constructeur_Exception $e){$e->w();}
- }
- public function run(ILLI $ILLI)
- {
- try
- {
- if(FALSE === self::$initialized)
- throw new ILLI_Constructeur_Exception
- ('ILLI not initialized..');
- if(FALSE === self::$executed)
- self::$executed = TRUE;
- else throw new ILLI_Constructeur_Exception
- ('Can not execute ILLI again.');
- $this->defaults();
- $this->INSTANCES->run();
- }
- catch(ILLI_Constructeur_Exception $e){$e->w();}
- return self::$SELF;
- }
- private function defaults()
- {
- $this->setApplicationProfile('localhost');
- }
- public static function shutdown(ILLI_Constructeur $ILLI_Constructeur)
- {
- self::$initialized = FALSE;
- self::$executed = FALSE;
- self::$INSTANCES = NULL;
- self::$SELF = NULL;
- }
- public function setApplicationProfile($name)
- {
- try
- {
- throw new ILLI_Constructeur_Exception
- ('ILLI-applicationprofile is not scalar.');
- self::$applicationProfile = $name;
- }
- catch(ILLI_Constructeur_Exception $e){$e->w();}
- }
- public function getApplicationProfile()
- {
- return self::$applicationProfile;
- }
- public function setApplicationConfiguration($key, $value)
- {
- try
- {
- throw new ILLI_Constructeur_Exception
- ('ILLI-configuration-key is not scalar.');
- }
- catch(ILLI_Constructeur_Exception $e){$e->w();}
- }
- public function getApplicationConfiguration()
- {
- return self::$applicationConfiguration;
- }
- }
- ABSTRACT CLASS ILLI_InstanceConstructeur
- {
- protected $INSTANCES = NULL;
- protected $OWNER = NULL;
- protected $_root = NULL;
- protected $fileLocation = '';
- protected static $childNameMask = '';
- final public function execute()
- {
- $this->INSTANCES->run();
- if(!array_key_exists(get_class($this), self::$executed) || self::$executed[get_class($this)] === FALSE )
- {
- $this->run();
- }
- return $this;
- }
- final public function __get($name)
- {
- return $this->INSTANCES->$name;
- }
- final public function __call($name, $arguments)
- {
- try
- {
- throw new ILLI_Sequence_Exception
- }
- catch(ILLI_Sequence_Exception $e){$e->w();}
- }
- final protected function &setInstanceLoader(&$fileLocation)
- {
- $this->fileLocation =& $fileLocation;
- $this->INSTANCES =& new ILLI_InstanceLoader($this->fileLocation);
- return $this;
- }
- final protected function setInstanceOwner(&$OBJ)
- {
- try
- {
- throw new ILLI_Sequence_Exception
- ('Given variable is not an object');
- }
- catch(ILLI_Sequence_Exception $e){$e->w();}
- $this->OWNER =& $OBJ;
- return $this;
- }
- final protected function setChildNameMask($childNameMask = '')
- {
- $this->childNameMask = $childNameMask;
- return $this;
- }
- final protected function getChildNameMask($childNameMask = '')
- {
- return $this->childNameMask;
- }
- final protected function setRoot(ILLI_Constructeur &$ROOT_OBJ)
- {
- $this->_root =& $ROOT_OBJ;
- return $this;
- }
- final protected function getRoot()
- {
- return $this->_root;
- }
- final protected function getFileLocation()
- {
- return $this->fileLocation;
- }
- final protected function load($class)
- {
- require_once $file;
- return $this;
- }
- abstract public function __construct();
- abstract public function init();
- abstract public function run();
- }
- ABSTRACT CLASS ILLI_ShortcutsPrimary EXTENDS ILLI_InstanceConstructeur
- {
- final protected function set(&$OWNER, $fileLocation)
- {
- $this
- ->setChildNameMask('_Link')
- ->setInstanceOwner($OWNER)
- ->setRoot($OWNER)
- ->setInstanceLoader($fileLocation);
- }
- }
- ABSTRACT CLASS ILLI_Sequence EXTENDS ILLI_ShortcutsPrimary
- {
- final public function __construct(ILLI_Constructeur &$ILLI_Constructeur, $fileLocation)
- {
- $this->set($ILLI_Constructeur, $fileLocation);
- }
- }
- FINAL CLASS ILLI_SequenceFrontend EXTENDS ILLI_Sequence
- {
- public function init()
- {
- $this->INSTANCES
- -> setNameMask(__CLASS__.$this->getChildNameMask())
- -> setReferenceObject($this)
- -> load(Form)
- -> load(View)
- -> init();
- return $this;
- }
- public function run(){}
- }
- ABSTRACT CLASS ILLI_ShortcutsSecondary EXTENDS ILLI_InstanceConstructeur
- {
- final protected function set(&$OWNER, $fileLocation)
- {
- $this
- ->setChildNameMask('_Segment')
- ->setInstanceOwner($OWNER)
- ->setRoot($OWNER->OWNER)
- ->setInstanceLoader($fileLocation);
- }
- }
- ABSTRACT CLASS ILLI_SequenceFrontend_Link EXTENDS ILLI_ShortcutsSecondary
- {
- final public function __construct(ILLI_SequenceFrontend &$ILLI_SequenceFrontend, $fileLocation)
- {
- $this->set($ILLI_SequenceFrontend, $fileLocation);
- }
- }
- FINAL CLASS ILLI_SequenceFrontend_LinkForm EXTENDS ILLI_SequenceFrontend_Link
- {
- private $FORMS = NULL;
- private $CURRENT_FORM = NULL;
- private $CURRENT_FIELD = NULL;
- private $PATTERNS = NULL;
- public function init()
- {
- }
- public function run()
- {
- }
- }
- ABSTRACT CLASS ILLI_ShortcutsTertiary EXTENDS ILLI_InstanceConstructeur
- {
- final protected function set(&$OWNER, $fileLocation)
- {
- $this
- ->setChildNameMask('_Sub')
- ->setInstanceOwner($OWNER)
- ->setRoot($OWNER->OWNER->OWNER)
- ->setInstanceLoader($fileLocation);
- }
- }
- ABSTRACT CLASS ILLI_SequenceFrontend_LinkForm_Segment EXTENDS ILLI_ShortcutsTertiary
- {
- final public function __construct(ILLI_SequenceFrontend_LinkForm &$ILLI_SequenceFrontend_LinkForm, $fileLocation)
- {
- $this->set($ILLI_SequenceFrontend_LinkForm, $fileLocation);
- }
- }
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago