Ejemplo n.º 1
0
 protected function setupPaths()
 {
     $basePath = str_finish(get_template_directory(), '/');
     $controllersDirectory = $basePath . 'controllers';
     $modelsDirectory = $basePath . 'models';
     Illuminate\Support\ClassLoader::register();
     Illuminate\Support\ClassLoader::addDirectories(array($controllersDirectory, $modelsDirectory));
 }
Ejemplo n.º 2
0
 /**
  * Create new instance of Bootioc
  */
 public function __construct()
 {
     //Register class loader
     Illuminate\Support\ClassLoader::register();
     //Create the IOC container
     $this->ioc = new Container();
     $this->ioc->bind('app', $this->ioc);
     Illuminate\Support\Facades\Facade::setFacadeApplication($this->ioc);
     //Execute TRegister
     $this->registerRepositories();
     //Add facades to classes
     $this->addFacades();
 }
Ejemplo n.º 3
0
|
| The Patchwork library provides solid handling of UTF-8 strings as well
| as provides replacements for all mb_* and iconv type functions that
| are not available by default in PHP. We'll setup this stuff here.
|
*/
Patchwork\Utf8\Bootup::initMbstring();
/*
|--------------------------------------------------------------------------
| Register The Laravel Auto Loader
|--------------------------------------------------------------------------
|
| We register an auto-loader "behind" the Composer loader that can load
| model classes on the fly, even if the autoload files have not been
| regenerated for the application. We'll add it to the stack here.
|
*/
Illuminate\Support\ClassLoader::register();
/*
|--------------------------------------------------------------------------
| Register The Workbench Loaders
|--------------------------------------------------------------------------
|
| The Laravel workbench provides a convenient place to develop packages
| when working locally. However we will need to load in the Composer
| auto-load files for the packages so that these can be used here.
|
*/
if (is_dir($workbench = __DIR__ . '/../workbench')) {
    Illuminate\Workbench\Starter::start($workbench);
}
Ejemplo n.º 4
0
<?php

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../vendor/illuminate/support/Illuminate/Support/helpers.php';
include __DIR__ . '/../app/Config/database.php';
$basePath = str_finish(dirname(__FILE__), '/');
$controllersDirectory = $basePath . '../app/src/Controllers';
$modelsDirectory = $basePath . '../app/src/Models';
$viewsDirectory = $basePath . '../app/Views';
$cacheDirectory = $basePath . '../app/Cache';
// register the autoloader and add directories
Illuminate\Support\ClassLoader::register();
Illuminate\Support\ClassLoader::addDirectories(array($controllersDirectory, $modelsDirectory));
// Instantiate the container
$app = new Illuminate\Container\Container();
// Tell facade about the application instance
Illuminate\Support\Facades\Facade::setFacadeApplication($app);
// register application instance with container
$app['app'] = $app;
// set environment
$app['env'] = 'production';
with(new Illuminate\Events\EventServiceProvider($app))->register();
with(new Illuminate\Routing\RoutingServiceProvider($app))->register();
include $basePath . '../Routes.php';
// Instantiate the request
$request = Illuminate\Http\Request::createFromGlobals();
if ($app['env'] == 'dev') {
    // Dispatch the router
    $response = $app['router']->dispatch($request);
    // Send the response
    $response->send();
Ejemplo n.º 5
0
| all of the other packages that we require from composer via the
| prepackaged auto-loader which comes with composer.
|
*/
require __DIR__ . '/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Load classes in a global namespace
|--------------------------------------------------------------------------
|
| Load any classes that are not in the PSR-4 namespace that we might be
| needing at some point, this is usually controllers and models.
|
*/
Illuminate\Support\ClassLoader::register();
Illuminate\Support\ClassLoader::addDirectories([__DIR__ . '/../app/controllers/']);
/*
|--------------------------------------------------------------------------
| Register any specified environment variables
|--------------------------------------------------------------------------
*/
if (file_exists(__DIR__ . '/../.env')) {
    Dotenv::load(__DIR__ . '/../');
}
/*
|--------------------------------------------------------------------------
| Create a new Application
|--------------------------------------------------------------------------
|
| Create an instance of our application implementing HttpKernelInterface
| which facilitates the usage of stack-php middleware components.