Ejemplo n.º 1
0
 function __construct()
 {
     if (!defined('SPARKPATH')) {
         define('SPARKPATH', 'sparks/');
     }
     parent::__construct();
 }
Ejemplo n.º 2
0
 /**
  *	Overloading this method so that if a view is supplied with the prefix of '/' then we
  *	load that view directly rather than try and do anythign clever with the path
  *
  **/
 public function view($view, $vars = array(), $return = FALSE)
 {
     if (strpos($view, '/') === 0) {
         //	The supplied view is an absolute path, so use it.
         //	Add on EXT if it's not there (so pathinfo() works as expected)
         if (substr($view, -4) != EXT) {
             $view .= EXT;
         }
         //	Get path information about the view
         $_pathinfo = pathinfo($view);
         $_path = $_pathinfo['dirname'] . '/';
         $_view = $_pathinfo['filename'];
         //	Set the view path so the loader knows where to look
         $this->_ci_view_paths = array($_path => TRUE) + $this->_ci_view_paths;
         //	Load the view
         return $this->_ci_load(array('_ci_view' => $_view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
     } else {
         //	Try looking in the application folder second - prevents Nails views being loaded
         //	over an application view.
         $_view = FCPATH . APPPATH . 'views/' . $view;
         if (substr($_view, -4) != EXT) {
             $_view .= EXT;
         }
         if (file_exists($_view)) {
             //	Try again with this view
             return $this->view($_view, $vars, $return);
         } else {
             //	Fall back to the old method
             return parent::view($view, $vars, $return);
         }
     }
 }
Ejemplo n.º 3
0
 function plugin($plugin)
 {
     if (!is_array($plugin)) {
         self::define_module($plugin);
     }
     return parent::plugin($plugin);
 }
Ejemplo n.º 4
0
 /**
  * To accomodate CI 2.1.0, we override the initialize() method instead of
  *  the ci_autoloader() method. Once sparks is integrated into CI, we
  *  can avoid the awkward version-specific logic.
  * @return Loader
  */
 function initialize()
 {
     parent::initialize();
     if (!$this->_is_lt_210) {
         $this->ci_autoloader();
     }
     return $this;
 }
 /**
  * CORE LOAD CONSTRUCTOR
  * 
  * Assigns all CI paths to allos common functionality
  * 
  */
 public function __construct()
 {
     parent::__construct();
     $this->_ci_library_paths = array(APPPATH, COMMONPATH, BASEPATH);
     $this->_ci_helper_paths = array(APPPATH, COMMONPATH, BASEPATH);
     $this->_ci_model_paths = array(APPPATH, COMMONPATH);
     $this->_ci_view_paths = array(APPPATH . 'views/' => TRUE, COMMONPATH . 'views/' => TRUE);
     $this->config->_config_paths = array(APPPATH, COMMONPATH);
 }
Ejemplo n.º 6
0
 /**
  * [[Description]]
  */
 public function __construct()
 {
     $this->_ci_ob_level = ob_get_level();
     $this->_ci_library_paths = array(APPPATH, IGOPATH, BASEPATH);
     $this->_ci_helper_paths = array(APPPATH, IGOPATH, BASEPATH);
     $this->_ci_model_paths = array(APPPATH, IGOPATH);
     $this->_ci_view_paths = array(APPPATH . 'views/' => true, IGOPATH . 'views/' => true);
     log_message('debug', 'IGO_Loader Class Initialized');
     parent::__construct();
 }
Ejemplo n.º 7
0
 /**
  * Load a helper contained within a module.
  *
  * Copied from MX_Loader, modified to check the /bonfire/helpers directory for
  * a 'BF_' prefixed helper.
  *
  * @param string $helper The helper to load.
  *
  * @return void;
  **/
 public function helper($helper = array())
 {
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     if (isset($this->_ci_helpers[$helper])) {
         return;
     }
     list($path, $_helper) = Modules::find($helper . '_helper', $this->_module, 'helpers/');
     if ($path === false) {
         if (file_exists(BFPATH . "helpers/BF_{$helper}_helper.php")) {
             include_once BFPATH . "helpers/BF_{$helper}_helper.php";
         }
         return parent::helper($helper);
     }
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = TRUE;
 }
Ejemplo n.º 8
0
 /**
  * Load a helper contained within a module.
  *
  * Copied from MX_Loader, modified to check the /bonfire/helpers directory for
  * a 'BF_' prefixed helper.
  *
  * @param string $helper The helper to load.
  *
  * @return $this
  **/
 public function helper($helper = array())
 {
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     if (isset($this->_ci_helpers[$helper])) {
         return;
     }
     list($path, $_helper) = Modules::find("{$helper}_helper", $this->_module, 'helpers/');
     if ($path === false) {
         // If the helper was not found in a module, check the traditional locations.
         parent::helper($helper);
         return $this;
     }
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = true;
     return $this;
 }
Ejemplo n.º 9
0
 /** Load a module model **/
 public function model($model, $object_name = NULL, $connect = FALSE)
 {
     if (is_array($model)) {
         return $this->models($model);
     }
     $_alias = $object_name or $_alias = basename($model);
     if (in_array($_alias, $this->_ci_models, TRUE)) {
         return CI::$APP->{$_alias};
     }
     /* check module */
     list($path, $_model) = Modules::find(strtolower($model), $this->_module, 'models/');
     //AG_ ***************************
     if ($path == FALSE) {
         $model_e = explode('/', $model, 2);
         if (count($model_e) > 1) {
             list($path, $_model) = Modules::find(strtolower($model_e[1]), $model_e[0], 'models/');
         }
     }
     //AG_ ----------------------------
     if ($path == FALSE) {
         /* check application & packages */
         parent::model($model, $object_name);
     } else {
         class_exists('CI_Model', FALSE) or load_class('Model', 'core');
         if ($connect !== FALSE and !class_exists('CI_DB', FALSE)) {
             if ($connect === TRUE) {
                 $connect = '';
             }
             $this->database($connect, FALSE, TRUE);
         }
         Modules::load_file($_model, $path);
         $model = ucfirst($_model);
         if (class_exists(users_class_prefix . $model)) {
             $model = users_class_prefix . $model;
         }
         CI::$APP->{$_alias} = new $model();
         $this->_ci_models[] = $_alias;
     }
     return CI::$APP->{$_alias};
 }
Ejemplo n.º 10
0
 /**
  * Load a helper contained within a module.
  *
  * Copied from MX_Loader, modified to check the /bonfire/helpers directory for
  * a 'BF_' prefixed helper.
  *
  * @param string $helper The helper to load.
  *
  * @return $this
  **/
 public function helper($helper = array())
 {
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     if (isset($this->_ci_helpers[$helper])) {
         return;
     }
     list($path, $_helper) = Modules::find("{$helper}_helper", $this->_module, 'helpers/');
     if ($path === false) {
         // If the helper was not found in a module, check for a BF_ prefixed
         // helper in the Bonfire helpers directory.
         if (file_exists(BFPATH . "helpers/BF_{$helper}_helper.php")) {
             include_once BFPATH . "helpers/BF_{$helper}_helper.php";
         }
         parent::helper($helper);
         return $this;
     }
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = true;
     return $this;
 }
Ejemplo n.º 11
0
 function __construct()
 {
     //Call the Model constructor
     parent::__construct();
 }
Ejemplo n.º 12
0
 /** Load a module helper **/
 public function helper($helper, $module = NULL)
 {
     if (!isset($module)) {
         $module = $this->_module;
     }
     // FUEL
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     if (isset($this->_ci_helpers[$helper])) {
         return;
     }
     list($path, $_helper) = Modules::find($helper . '_helper', $module, 'helpers/');
     if ($path === FALSE) {
         return parent::helper($helper);
     }
     Modules::load_file($_helper, $path);
     $this->_ci_helpers[$_helper] = TRUE;
 }
Ejemplo n.º 13
0
 /**
  * To accomodate CI 2.1.0, we override the initialize() method instead of
  * the ci_autoloader() method. Once sparks is integrated into CI, we can
  * avoid the awkward version-specific logic.
  *
  * @return \MY_Loader
  */
 public function initialize($controller = null)
 {
     parent::initialize();
     $this->ci_autoloader();
     return $this;
 }
Ejemplo n.º 14
0
 function MY_Loader()
 {
     parent::__construct();
     $this->_module = CI::$APP->router->fetch_module();
 }
Ejemplo n.º 15
0
 function __construct()
 {
     parent::__construct();
     $this->_ci_events_paths = array(APPPATH);
     log_message('debug', "MY_Loader Class Initialized");
 }
Ejemplo n.º 16
0
 /**
  * Prep filename
  * Override from parent
  *
  * This function preps the name of various items to make loading them more reliable.
  *
  * @param	mixed
  * @param 	string
  * @param   bool
  * @return	array
  */
 protected function _ci_prep_filename($filename, $extension, $opposite = false)
 {
     if ($opposite == false) {
         return parent::_ci_prep_filename($filename, $extension);
     }
     // opposite prep in front
     if (!is_array($filename)) {
         return array($extension . ucfirst(str_replace('.php', '', str_replace($extension, '', $filename))));
     } else {
         foreach ($filename as $key => $val) {
             $filename[$key] = $extension . ucfirst(str_replace('.php', '', str_replace($extension, '', $val)));
         }
         return $filename;
     }
 }
 public function initialize()
 {
     parent::initialize();
 }
Ejemplo n.º 18
0
 /**
  * To accomodate CI 2.1.0, we override the initialize() method instead of
  * the ci_autoloader() method. Once sparks is integrated into CI, we can
  * avoid the awkward version-specific logic.
  *
  * @return \MY_Loader
  */
 function initialize()
 {
     parent::initialize();
     $this->ci_autoloader();
     return $this;
 }
Ejemplo n.º 19
0
 /**
  * Initializer
  *
  * @param null $controller
  */
 public function initialize($controller = NULL)
 {
     // Load system configuration from database
     $this->_load_db_config();
     parent::initialize($controller);
 }
Ejemplo n.º 20
0
 public function __construct()
 {
     parent::__construct();
     $this->add_package_path(SHARED_ADDONPATH);
 }
Ejemplo n.º 21
0
 public function __construct()
 {
     parent::__construct();
 }
Ejemplo n.º 22
0
 public function __construct()
 {
     parent::__construct();
     require_once FCPATH . 'public/php_function_common/php_function.php';
 }
Ejemplo n.º 23
0
 public function __construct()
 {
     parent::__construct();
     $this->add_package_path(NTS_SYSTEM_APPPATH);
 }
Ejemplo n.º 24
0
 /**
  * Load helper, check TrafficTower core helpers.
  *
  * @param array $helper Helper name (or list of helpers)
  */
 public function helper($helper = array())
 {
     if (is_array($helper)) {
         return $this->helpers($helper);
     }
     $tt_helpers = $this->_tt_helpers();
     // Check if is TT helper
     $helper = trim($helper, '/');
     if (in_array(strtolower($helper), $tt_helpers)) {
         // Check for app helper
         if (strpos('/', $helper) === FALSE && $this->_app_helper_exists($helper)) {
             // Manual add (due to lowerize capitals in CI core)
             $app_helper = strpos($helper, '.php') === FALSE ? $helper . '_helper.php' : $helper;
             include_once APPPATH . 'helpers/' . $this->app_prefix . $app_helper;
         }
         $helper = '../../traffictower/helpers/' . $helper;
     }
     parent::helper($helper);
 }
Ejemplo n.º 25
0
 function __construct()
 {
     parent::__construct();
     //
     $this->CI =& get_instance();
 }