illi boot-loader
By: fruffl | Date: Jan 16 2010 21:13 | Format: PHP | Expires: never | Size: 7.48 KB | Hits: 971
- <?php
- FINAL CLASS ILLI_BootSubSection_Exception EXTENDS ILLI_Exception{}
- ABSTRACT CLASS ILLI_BootSubSection
- {
- final private function __clone() {}
- abstract protected function init();
- }
- ABSTRACT CLASS ILLI_BootSubSection_System EXTENDS ILLI_BootSubSection
- {
- final public function __construct(ILLI_BootSection_System $ILLI_BootSection_System)
- {return $this->init();}
- }
- FINAL CLASS ILLI_BootSubSection_SystemErrors EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_SystemRequirements EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_SystemRegistry EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- ABSTRACT CLASS ILLI_BootSubSection_Settings EXTENDS ILLI_BootSubSection
- {
- final public function __construct(ILLI_BootSection_Settings $ILLI_BootSection_System)
- {return $this->init();}
- }
- FINAL CLASS ILLI_BootSubSection_SettingsCore EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_SettingsApplication EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- ABSTRACT CLASS ILLI_BootSubSection_Kernel EXTENDS ILLI_BootSubSection
- {
- final public function __construct(ILLI_BootSection_Kernel $ILLI_BootSection_System)
- {return $this->init();}
- }
- FINAL CLASS ILLI_BootSubSection_KernelTest EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_KernelHeader EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_KernelCore EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_KernelParams EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_KernelForwarder EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSubSection_KernelDispatcher EXTENDS ILLI_BootSubSection_System
- {
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSection_Exception EXTENDS ILLI_Exception{}
- ABSTRACT CLASS ILLI_BootSection
- {
- protected function __clone() {}
- final public function __construct(ILLI_Bootloader $ILLI_Bootloader)
- {return $this->init();}
- abstract protected function init();
- }
- FINAL CLASS ILLI_BootSection_System EXTENDS ILLI_BootSection
- {
- private static $ERRORS = NULL;
- private static $REQUIREMENTS = NULL;
- private static $REGISTRY = NULL;
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSection_Settings EXTENDS ILLI_BootSection
- {
- private static $CORE = NULL;
- private static $APPLICATION = NULL;
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_BootSection_Kernel EXTENDS ILLI_BootSection
- {
- private static $TEST = NULL;
- private static $HEADERS = NULL;
- private static $CORE = NULL;
- private static $PARAMS = NULL;
- private static $FORWARDER = NULL;
- private static $DISPATCHER = NULL;
- protected function init()
- {
- return $this;
- }
- }
- FINAL CLASS ILLI_Bootloader_Exception EXTENDS ILLI_Exception{}
- FINAL CLASS ILLI_Bootloader
- {
- private static $SELF = NULL;
- private static $initialized = FALSE;
- private static $executed = FALSE;
- private function __construct(){}
- private function __clone() {}
- public static function init(ILLI_Constructeur $ILLI_Constructeur)
- {
- try
- {
- if(FALSE === self::$initialized)
- self::$initialized = TRUE;
- else throw new ILLI_Bootloader_Exception('BOOTLOADER already initialized.');
- if(NULL === self::$SELF)
- self::$SELF = new self;
- self::$SELF
- ->boot('System')
- ->boot('Settings')
- ->boot('Kernel');
- return self::$SELF;
- }
- catch(ILLI_Bootloader_Exception $e){$e->w();}
- }
- public static function run(ILLI_Bootloader $ILLI_Bootloader)
- {
- try
- {
- if(FALSE === self::$executed)
- self::$executed = TRUE;
- else throw new ILLI_Bootloader_Exception('Can not execute BOOTLOADER again.');
- }
- catch(ILLI_Bootloader_Exception $e){$e->w();}
- return self::$SELF;
- }
- private static function boot($name = '')
- {
- try
- {
- throw new ILLI_Bootloader_Exception('Illegal instance-name given.');
- $name = 'ILLI_BootSection_'.$name;
- throw new ILLI_Bootloader_Exception('Class not found.');
- }
- catch(ILLI_Bootloader_Exception $e){$e->w();}
- self::$bootsections[$name] = new $name(self::$SELF);
- return self::$SELF;
- }
- }
- FINAL CLASS ILLI_Constructuer_Exception EXTENDS ILLI_Exception{}
- FINAL CLASS ILLI_Constructeur
- {
- private static $SELF = NULL;
- private static $BOOT = NULL;
- private static $API = NULL;
- private static $CTR = NULL;
- private static $OUT = NULL;
- private static $initialized = FALSE;
- private static $executed = FALSE;
- private function __construct() {}
- private function __clone() {}
- public static function init(ILLI $ILLI)
- {
- try
- {
- if(FALSE === self::$initialized)
- {
- if(NULL === self::$SELF)
- self::$SELF = new self;
- self::$initialized = TRUE;
- self::$BOOT =& ILLI_Bootloader::init(self::$SELF);
- return self::$SELF;
- }
- else throw new ILLI_Constructuer_Exception('ILLI already initialized..');
- }
- catch(ILLI_Constructuer_Exception $e){$e->w();}
- }
- public static function run(ILLI_Constructeur $ILLI_Constructeur)
- {
- try
- {
- if(FALSE === self::$initialized)
- throw new ILLI_Constructuer_Exception('BOOTLOADER not initialized.');
- if(FALSE === self::$executed)
- self::$executed = TRUE;
- else throw new ILLI_Constructuer_Exception('Can not execute ILLI again.');
- }
- catch(ILLI_Constructuer_Exception $e){$e->w();}
- return self::$SELF;
- }
- public static function shutdown(ILLI_Constructeur $ILLI_Constructeur)
- {
- /*
- shutdown stuff
- */
- self::$initialized = FALSE;
- self::$executed = FALSE;
- self::$SELF = NULL;
- self::$BOOT = NULL;
- self::$API = NULL;
- self::$CTR = NULL;
- self::$OUT = NULL;
- }
- }
- FINAL CLASS ILLI
- {
- private static $SELF = NULL;
- private static $CONSTRUCTUER = NULL;
- private function __construct()
- {
- self::$CONSTRUCTUER =& ILLI_Constructeur::init($this);
- }
- private function __clone(){}
- public static function init()
- {
- self::$SELF =& new self;
- return self::$SELF;
- }
- public function run()
- {
- self::$CONSTRUCTUER
- -> run(self::$CONSTRUCTUER);
- return $this;
- }
- private function shutdown()
- {
- self::$CONSTRUCTUER->shutdown(self::$CONSTRUCTUER);
- self::$CONSTRUCTUER = NULL;
- self::$SELF = NULL;
- }
- }
Latest pastes
15 hours ago
15 hours ago
1 days ago
2 days ago
4 days ago