mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- Moved spl_autoload_register from application/config/config.php to application/config/core_includes.php
- application/config/core_includes.php is included by index.ci.php - Renamed the prefix of the helpers from "fhc_" to "hlp_" - Adapted the helpers includes
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Autoload custom controllers, models, etc that are present in the application/core directory
|
||||
*/
|
||||
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;
|
||||
});
|
||||
@@ -14,7 +14,7 @@ class Test extends REST_Controller
|
||||
parent::__construct();
|
||||
|
||||
// Loads helper message to manage returning messages
|
||||
$this->load->helper('fhc_message');
|
||||
$this->load->helper('hlp_message');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user