Esempio n. 1
0
//              |    __) \_  __ \  |  \_/ ___\   __\  \   __<   |  |
//              |     \   |  | \/  |  /\  \___|  | |  ||  |  \___  |
//              \___  /   |__|  |____/  \___  >__| |__||__|  / ____|
//                  \/                      \/               \/
// -----------------------------------------------------------------------------
//                          https://github.com/fructify
//
//          Designed and Developed by Brad Jones <brad @="bjc.id.au" />
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
use DI\ContainerBuilder;
use Stringy\Stringy as s;
use Fructify\Contracts\IKernel;
// Install the import function globally.
// see: https://github.com/brad-jones/import/
Brads\Importer::globalise();
/**
 * The Theme IoC Container.
 *
 * Wrap everything up into a closure because the global scope is already pretty
 * crowded being a wordpress environment and all... :) Additonally it stops
 * anyone from cheating and say requesting the IoC Container by using something
 * like ```$GLOBALS['app']```.
 */
call_user_func(function () {
    $builder = new ContainerBuilder();
    // We will enable @Inject annotation support. Between autowiring &
    // annotations I am hoping we won't need to have much in the way of
    // custom definitions in the ```container.php``` file.
    // http://php-di.org/doc/annotations.html
    $builder->useAnnotations(true);