Example #1
0
}
if (!defined('JPROFILE')) {
    define('JPROFILE', $app['config']->get('debug') || $app['config']->get('profile'));
}
/*
|--------------------------------------------------------------------------
| Register The Core Service Providers
|--------------------------------------------------------------------------
|
| Register all of the core pieces of the framework.
|
*/
$providers = PATH_CORE . DS . 'bootstrap' . DS . 'Cli' . DS . 'services.php';
$services = file_exists($providers) ? require $providers : array();
foreach ($services as $service) {
    $app->register($service);
}
/*
|--------------------------------------------------------------------------
| Load The Aliases
|--------------------------------------------------------------------------
|
| The alias loader is responsible for lazy loading the class aliases setup
| for the application.
|
*/
$facades = PATH_CORE . DS . 'bootstrap' . DS . 'Cli' . DS . 'aliases.php';
$aliases = file_exists($facades) ? require $facades : array();
$app->registerFacades($aliases);
/*
|--------------------------------------------------------------------------
Example #2
0
| The configuration repository is used to lazily load in the options for
| this application from the configuration files. The files are easily
| separated by their concerns so they do not become really crowded.
|
*/
$app['config'] = new \Hubzero\Config\Repository('test', new \Hubzero\Config\FileLoader('config'));
/*
|--------------------------------------------------------------------------
| Register The Core Service Providers
|--------------------------------------------------------------------------
|
| Register all of the core pieces of the framework including session, 
| caching, and more. First, we'll load the core bootstrap list of services
| and then we'll give the app a chance to modify that list.
|
*/
$services = ['JoomlaServiceProvider', 'EventServiceProvider', 'TranslationServiceProvider', 'DatabaseServiceProvider', 'PluginServiceProvider', 'ProfilerServiceProvider', 'LogServiceProvider', 'RouterServiceProvider', 'FilesystemServiceProvider'];
foreach ($services as $service) {
    require_once __DIR__ . '/providers/' . $service . '.php';
    $app->register('Framework\\Providers\\' . $service);
}
/*
|--------------------------------------------------------------------------
| Load The Aliases
|--------------------------------------------------------------------------
|
| The alias loader is responsible for lazy loading the class aliases setup
| for the application.
|
*/
$app->registerFacades(['App' => 'Hubzero\\Facades\\App', 'Config' => 'Hubzero\\Facades\\Config', 'Request' => 'Hubzero\\Facades\\Request', 'Response' => 'Hubzero\\Facades\\Response', 'Event' => 'Hubzero\\Facades\\Event', 'Route' => 'Hubzero\\Facades\\Route', 'User' => 'Hubzero\\Facades\\User', 'Lang' => 'Hubzero\\Facades\\Lang', 'Log' => 'Hubzero\\Facades\\Log', 'Date' => 'Hubzero\\Facades\\Date', 'Plugin' => 'Hubzero\\Facades\\Plugin', 'Filesystem' => 'Hubzero\\Facades\\Filesystem']);