示例#1
0
// The register function will prepend
// the psr4 loader.
$loader->register();
/*
 * ------------------------------------------------------
 *  Load the global functions
 * ------------------------------------------------------
 */
require_once BASEPATH . 'Common.php';
/*
 * ------------------------------------------------------
 *  Set custom exception handling
 * ------------------------------------------------------
 */
$config = new \Config\App();
CodeIgniter\Services::exceptions($config, true)->initialize();
//--------------------------------------------------------------------
// Should we use a Composer autoloader?
//--------------------------------------------------------------------
if ($composer_autoload = $config->composerAutoload) {
    if ($composer_autoload === TRUE) {
        file_exists(APPPATH . 'vendor/autoload.php') ? require_once APPPATH . 'vendor/autoload.php' : log_message('error', '$config->\'composerAutoload\' is set to TRUE but ' . APPPATH . 'vendor/autoload.php was not found.');
    } elseif (file_exists($composer_autoload)) {
        require_once $composer_autoload;
    } else {
        log_message('error', 'Could not find the specified $config->\'composerAutoload\' path: ' . $composer_autoload);
    }
}
/*
 * --------------------------------------------------------------------
 * LOAD THE BOOTSTRAP FILE
示例#2
0
}
require_once APPPATH . 'Config/Constants.php';
/*
 * ------------------------------------------------------
 *  Setup the autoloader
 * ------------------------------------------------------
 */
// The autoloader isn't initialized yet, so load the file manually.
require BASEPATH . 'Autoloader/Autoloader.php';
require APPPATH . 'Config/Autoload.php';
require APPPATH . 'Config/Services.php';
// Use special Services for testing.
require SUPPORTPATH . 'Services.php';
// The Autoloader class only handles namespaces
// and "legacy" support.
$loader = CodeIgniter\Services::autoloader();
$loader->initialize(new Config\Autoload());
// The register function will prepend
// the psr4 loader.
$loader->register();
// Add namespace paths to autoload mocks for testing.
$loader->addNamespace('CodeIgniter', SUPPORTPATH);
$loader->addNamespace('Config', SUPPORTPATH . 'Config');
/*
 * ------------------------------------------------------
 *  Load the global functions
 * ------------------------------------------------------
 */
// Use special global functions for testing.
require_once SUPPORTPATH . 'MockCommon.php';
require_once BASEPATH . 'Common.php';