Last active
August 29, 2015 14:07
-
-
Save bubach/84de88ebb85495d53df7 to your computer and use it in GitHub Desktop.
Pure magic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* main method of execution | |
* | |
* @access public | |
*/ | |
public function run() { | |
// minimum to load rest | |
$this->setupAutoload(); | |
$this->setupErrorHandling(); | |
$this->config = new Core_Plugin_Config; | |
$this->load = new Core_Plugin_Load; | |
// profiling set asap | |
$this->load->getClass('Core_Plugin_Profiling', 'profiler'); | |
$this->profiler->initProfiling(); | |
// load events & setup classes | |
$this->load->getClass('Core_Plugin_Event', 'event'); | |
$this->load->getClass('Core_Plugin_Setup', 'setup'); | |
// our very first event | |
wmvc::app()->event->triggerEvent("wmvc_run_start", array("eventObject" => $this)); | |
// setup Request & Routing | |
$this->setupRequest(); | |
$this->setupRouting(); | |
// setup & run controller->action | |
$this->setupControllerAction(); | |
wmvc::app()->event->triggerEvent("wmvc_run_controller", array("eventObject" => $this)); | |
$this->controller->{$this->action}(); | |
// let profiling & events manipulate body before response | |
$this->profiler->stopProfiling(); | |
wmvc::app()->event->triggerEvent("wmvc_run_end", array("eventObject" => $this)); | |
// output the final product! | |
$this->controller->getResponse()->sendResponse(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment