Example #1
0
 /**
  * Configures this class as well as the shutdown class and the $debug global
  */
 public function __construct()
 {
     // Setup globals and query vars
     global $debug;
     $debug = $this;
     set_query_var('debug', $this);
     // Setup the shutdown class
     $this->shutdown = new shutdown();
     $this->runtime_checkpoints = array();
     $this->active = FALSE;
     if (is_user_logged_in() && current_user_can('manage_options')) {
         $this->active = TRUE;
     }
     if (!empty($_SERVER['REQUEST_TIME_FLOAT'])) {
         $this->runtime_checkpoints[] = array('name' => '[PHP] Sent Request To Server', 'time' => $_SERVER['REQUEST_TIME_FLOAT']);
     }
     if (defined('PHP_START_TIME')) {
         $this->runtime_checkpoints[] = array('name' => '[PHP] Started Server-Side Execution', 'time' => PHP_START_TIME);
     }
     // Shutdown Actions
     $this->shutdown->register('debug_output', array($this, '_runtime_on_shutdown'));
     $this->shutdown->register('usage_tracker', array($this, 'usage_tracker'));
     parent::__construct();
 }
Example #2
0
 /**
  * Configure this class and the function to run on PHP shutdown
  * 
  * @return void
  */
 public function __construct()
 {
     $this->jobs = array();
     register_shutdown_function(array($this, '_run_shutdown'));
     parent::__construct();
 }
 /**
  * For whatever reason, we need to make sure it grabs the "right" theme global
  */
 public function __construct()
 {
     $this->theme = $GLOBALS['theme'];
     parent::__construct();
 }
 /**
  * Sets class vars and calls various setup functions
  */
 public function __construct()
 {
     // Setup debug before everything else
     new debug();
     // Setup globals and query vars
     global $theme;
     $theme = $this;
     set_query_var('theme', $this);
     // Base path/uri
     $this->path = realpath(get_template_directory());
     $this->uri = get_template_directory_uri();
     // Build Path Variables
     $this->generate_paths(array('asset' => 'asset', 'font' => 'asset/font', 'image' => 'asset/image', 'script' => 'asset/script', 'style' => 'asset/style', 'content' => 'content', 'include' => 'include', 'template' => 'template'));
     // Theme Options
     $this->options = $this->fetch_options();
     $this->template_queue = array();
     $this->used_templates = array();
     // This is only populated if debug is active
     $this->inc_var_list = array();
     // Check POST for options update (nonce & user are verified)
     $this->update_options_via_post();
     /*** Functions (1 per file) ***/
     $this->get_functions();
     /*** Initialize all the WordPress integrations ***/
     $this->do_integrations();
     /*** Handle First Run ***/
     if ($this->get_option('first_run')) {
         // This is the first run, greet them
         template_use_part($theme->template_sub_path . '/default', $theme->template_sub_path . '/first-run');
     }
     parent::__construct();
 }