From bc6e6c084531cbdf121f15b357e85cc904d8e950 Mon Sep 17 00:00:00 2001 From: mitagmio Date: Thu, 8 Feb 2018 15:14:00 +0300 Subject: [PATCH] Update Loader.php A PHP Error was encountered Severity: Notice Message: Only variables should be passed by reference Filename: MX/Loader.php Line Number: 135 A PHP Error was encountered Severity: Notice Message: Only variables should be passed by reference Filename: MX/Loader.php Line Number: 178 A PHP Error was encountered Severity: Notice Message: Only variables should be passed by reference Filename: MX/Loader.php Line Number: 178 A PHP Error was encountered Severity: Notice Message: Only variables should be passed by reference Filename: MX/Loader.php Line Number: 221 A PHP Error was encountered Severity: Notice Message: Only variables should be passed by reference Filename: MX/Loader.php Line Number: 178 A PHP Error was encountered Severity: Notice Message: Only variables should be passed by reference Filename: MX/Loader.php Line Number: 221 A PHP Error was encountered Severity: Notice Message: Only variables should be passed by reference Filename: MX/Loader.php Line Number: 178 --- application/third_party/MX/Loader.php | 28 +++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/application/third_party/MX/Loader.php b/application/third_party/MX/Loader.php index 8f4435b..134e3f5 100644 --- a/application/third_party/MX/Loader.php +++ b/application/third_party/MX/Loader.php @@ -68,7 +68,7 @@ public function _init($controller) { public function _add_module_paths($module = '') { if (empty($module)) return; - + foreach (Modules::$locations as $location => $offset) { /* only add a module path if it exists */ @@ -99,7 +99,7 @@ public function database($params = '', $return = FALSE, $active_record = NULL) { } /** Load a module helper **/ - public function helper($helper) { + public function helper($helper = array()) { if (is_array($helper)) return $this->helpers($helper); @@ -114,12 +114,12 @@ public function helper($helper) { } /** Load an array of helpers **/ - public function helpers($helpers) { + public function helpers($helpers = array()) { foreach ($helpers as $_helper) $this->helper($_helper); } /** Load a module language file **/ - public function language($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') { + public function language($langfile=array(), $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') { return CI::$APP->lang->load($langfile, $idiom, $return, $add_suffix, $alt_path, $this->_module); } @@ -128,11 +128,12 @@ public function languages($languages) { } /** Load a module library **/ - public function library($library, $params = NULL, $object_name = NULL) { + public function library($library = '', $params = NULL, $object_name = NULL) { - if (is_array($library)) return $this->libraries($library); + if (is_array($library)) return $this->libraries($library); - $class = strtolower(end(explode('/', $library))); + $explode = explode('/', $library); + $class = strtolower(end($explode)); if (isset($this->_ci_classes[$class]) AND $_alias = $this->_ci_classes[$class]) return CI::$APP->$_alias; @@ -174,8 +175,10 @@ public function libraries($libraries) { public function model($model, $object_name = NULL, $connect = FALSE) { if (is_array($model)) return $this->models($model); - - ($_alias = $object_name) OR $_alias = end(explode('/', $model)); + + $explode = explode('/', $model); + + ($_alias = $object_name) OR $_alias = end($explode); if (in_array($_alias, $this->_ci_models, TRUE)) return CI::$APP->$_alias; @@ -218,7 +221,8 @@ public function module($module, $params = NULL) { if (is_array($module)) return $this->modules($module); - $_alias = strtolower(end(explode('/', $module))); + $explode = explode('/', $module); + $_alias = strtolower(end($explode)); CI::$APP->$_alias = Modules::load(array($module => $params)); return CI::$APP->$_alias; } @@ -258,7 +262,7 @@ public function view($view, $vars = array(), $return = FALSE) { public function _ci_is_instance() {} - public function _ci_get_component($component) { + public function &_ci_get_component($component) { return CI::$APP->$component; } @@ -379,4 +383,4 @@ public function _autoloader($autoload) { } /** load the CI class for Modular Separation **/ -(class_exists('CI', FALSE)) OR require dirname(__FILE__).'/Ci.php'; \ No newline at end of file +(class_exists('CI', FALSE)) OR require dirname(__FILE__).'/Ci.php';