diff --git a/application/config/config.php b/application/config/config.php index 152bda403..2602c12cf 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -502,16 +502,3 @@ $config['rewrite_short_tags'] = FALSE; | Array: array('10.0.1.200', '192.168.5.0/24') */ $config['proxy_ips'] = ''; - -/* -|-------------------------------------------------------------------------- -| Autoload Custom Controllers -|-------------------------------------------------------------------------- -| -| It's working, so don't delete this :D -*/ -spl_autoload_register(function ($class) { - if (substr($class,0,3) !== 'CI_' && substr($class,0,4) !== 'FHC_') - if (file_exists($file = APPPATH . 'core/' . $class . '.php')) - require_once $file; -}); diff --git a/application/config/core_includes.php b/application/config/core_includes.php new file mode 100644 index 000000000..734686471 --- /dev/null +++ b/application/config/core_includes.php @@ -0,0 +1,12 @@ +load->helper('fhc_message'); + $this->load->helper('hlp_message'); } /** diff --git a/application/controllers/jobs/AmpelMail.php b/application/controllers/jobs/AmpelMail.php index b88c5536b..e27bd5f82 100644 --- a/application/controllers/jobs/AmpelMail.php +++ b/application/controllers/jobs/AmpelMail.php @@ -44,7 +44,7 @@ class AmpelMail extends FHC_Controller $this->load->model('person/Person_model', 'PersonModel'); // Load helpers - $this->load->helper('fhc_sancho'); + $this->load->helper('hlp_sancho'); } /** diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 11ed9fc98..b2cd98051 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -12,10 +12,10 @@ class APIv1_Controller extends REST_Controller parent::__construct(); // Loads helper message to manage returning messages - $this->load->helper('fhc_message'); + $this->load->helper('hlp_message'); // Loads helper with generic utility function - $this->load->helper('fhc_common'); + $this->load->helper('hlp_common'); // Loads permission lib $this->load->library('PermissionLib'); diff --git a/application/core/Auth_Controller.php b/application/core/Auth_Controller.php index 3cdde3e0e..5a3986c90 100644 --- a/application/core/Auth_Controller.php +++ b/application/core/Auth_Controller.php @@ -12,7 +12,7 @@ class Auth_Controller extends FHC_Controller parent::__construct(); // Loads authentication helper - $this->load->helper('fhc_authentication'); + $this->load->helper('hlp_authentication'); // Checks if the caller is allowed to access to this content $this->_isAllowed($requiredPermissions); diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 14acc1ca0..5b6901f52 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -21,19 +21,19 @@ class FHC_Controller extends CI_Controller $this->_controllerId = null; // set _controllerId as null by default // Loads helper message to manage returning messages - $this->load->helper('fhc_message'); + $this->load->helper('hlp_message'); // Loads helper with generic utility function - $this->load->helper('fhc_common'); + $this->load->helper('hlp_common'); // Loads helper session to manage the php session - $this->load->helper('fhc_session'); + $this->load->helper('hlp_session'); // Loads language helper - $this->load->helper('fhc_language'); + $this->load->helper('hlp_language'); // Loads header helper - $this->load->helper('fhc_header'); + $this->load->helper('hlp_header'); } //------------------------------------------------------------------------------------------------------------------ diff --git a/application/helpers/fhc_authentication_helper.php b/application/helpers/hlp_authentication_helper.php similarity index 100% rename from application/helpers/fhc_authentication_helper.php rename to application/helpers/hlp_authentication_helper.php diff --git a/application/helpers/fhc_common_helper.php b/application/helpers/hlp_common_helper.php similarity index 100% rename from application/helpers/fhc_common_helper.php rename to application/helpers/hlp_common_helper.php diff --git a/application/helpers/fhc_header_helper.php b/application/helpers/hlp_header_helper.php similarity index 100% rename from application/helpers/fhc_header_helper.php rename to application/helpers/hlp_header_helper.php diff --git a/application/helpers/fhc_language_helper.php b/application/helpers/hlp_language_helper.php similarity index 100% rename from application/helpers/fhc_language_helper.php rename to application/helpers/hlp_language_helper.php diff --git a/application/helpers/fhc_message_helper.php b/application/helpers/hlp_message_helper.php similarity index 100% rename from application/helpers/fhc_message_helper.php rename to application/helpers/hlp_message_helper.php diff --git a/application/helpers/fhc_sancho_helper.php b/application/helpers/hlp_sancho_helper.php similarity index 100% rename from application/helpers/fhc_sancho_helper.php rename to application/helpers/hlp_sancho_helper.php diff --git a/application/helpers/fhc_session_helper.php b/application/helpers/hlp_session_helper.php similarity index 100% rename from application/helpers/fhc_session_helper.php rename to application/helpers/hlp_session_helper.php diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 22fd77d4b..51c399f29 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -87,7 +87,7 @@ class FiltersLib $this->_ci =& get_instance(); // get code igniter instance // Loads authentication helper - $this->_ci->load->helper('fhc_authentication'); // NOTE: needed to load custom filters do not remove! + $this->_ci->load->helper('hlp_authentication'); // NOTE: needed to load custom filters do not remove! $this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget } diff --git a/application/models/system/MessageToken_model.php b/application/models/system/MessageToken_model.php index 04f23382d..64cfe4996 100644 --- a/application/models/system/MessageToken_model.php +++ b/application/models/system/MessageToken_model.php @@ -18,7 +18,7 @@ class MessageToken_model extends CI_Model $this->config->load('message'); // Load return message helper - $this->load->helper('fhc_message'); + $this->load->helper('hlp_message'); // Loads the database object $this->load->database(); diff --git a/index.ci.php b/index.ci.php index 043acb111..5514d9450 100644 --- a/index.ci.php +++ b/index.ci.php @@ -306,5 +306,8 @@ require_once 'config/vilesci.config.inc.php'; // ... and the vendor autoload include_once 'vendor/autoload.php'; +// Autoload custom controllers, models, etc that are present in the application/core directory +require_once 'application/config/core_includes.php'; + // Now the bootstrap file require_once BASEPATH.'core/CodeIgniter.php';