public function __construct($app)
 {
     ClassLoader::addDirectories(array(base_path() . DIRECTORY_SEPARATOR . 'userfiles' . DIRECTORY_SEPARATOR . 'modules', __DIR__));
     ClassLoader::register();
     spl_autoload_register(array($this, 'autoloadModules'));
     parent::__construct($app);
 }
Exemplo n.º 2
0
 protected static function bootClasses()
 {
     if (self::$config->get('app.autoload')) {
         $dirs = self::$config->get('app.autoload');
         ClassLoader::register();
         ClassLoader::addDirectories($dirs);
     }
 }
 public function register()
 {
     // Register The Laravel Auto Loader for 5.0
     // Since it is not registered by default
     \Illuminate\Support\ClassLoader::register();
     $this->app['suitetea.modules'] = $this->app->share(function ($app) {
         return new Manager(new Collection(), $app['view'], new ClassLoader(), $app['events'], $app['config']);
     });
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('ModularLaravel', 'SuiteTea\\ModularLaravel\\Facade');
     });
 }
Exemplo n.º 4
0
 public function _initialize()
 {
     $projectDir = \Codeception\Configuration::projectDir();
     require $projectDir . '/vendor/autoload.php';
     \Illuminate\Support\ClassLoader::register();
     if (is_dir($workbench = $projectDir . 'workbench')) {
         \Illuminate\Workbench\Starter::start($workbench);
     }
     $unitTesting = true;
     $testEnvironment = 'testing';
     $app = (require $projectDir . 'bootstrap/start.php');
     $this->kernel = $app;
     $this->revertErrorHandler();
 }
Exemplo n.º 5
0
 public function register()
 {
     //setup autoloader to save plugins having to do it every time
     ClassLoader::register();
     ClassLoader::addDirectories(array($this->items->path . '/src', $this->items->path . '/src/migrations'));
     //require autoload files - not advised really, plugins should make full use of service providers to add functionality
     if (isset($this->items->autoload->files)) {
         foreach ((array) $this->items->autoload->files as $file) {
             $this->app['files']->requireOnce($this->items->path . '/' . $file);
         }
     }
     //register providers
     foreach ((array) $this->items->providers as $provider) {
         $this->app->register($provider);
     }
 }
Exemplo n.º 6
0
 public static function bootstrap($errorCallbacks)
 {
     // Only bootstrap once.
     if (static::$bootstrapped) {
         return;
     }
     // Load helper functions.
     require_once __DIR__ . '/../../../illuminate/support/Illuminate/Support/helpers.php';
     // Directories.
     $basePath = str_finish(realpath(__DIR__ . '/..'), '/');
     $controllersDirectory = $basePath . 'Controllers';
     $modelsDirectory = $basePath . 'Models';
     // Register the autoloader and add directories.
     ClassLoader::register();
     ClassLoader::addDirectories(array($controllersDirectory, $modelsDirectory));
     // Instantiate the container.
     $app = new Container();
     static::$container = $app;
     // Tell facade about the application instance.
     Facade::setFacadeApplication($app);
     // Register application instance with container
     $app['app'] = $app;
     // Set environment.
     $app['env'] = 'production';
     // Enable HTTP Method Override.
     Request::enableHttpMethodParameterOverride();
     // Create the request.
     $app['request'] = Request::createFromGlobals();
     // Register services.
     with(new EventServiceProvider($app))->register();
     with(new RoutingServiceProvider($app))->register();
     // Register aliases.
     foreach (static::$aliases as $alias => $class) {
         class_alias($class, $alias);
     }
     // Load the routes file if it exists.
     if (file_exists($basePath . 'routes.php')) {
         require_once $basePath . 'routes.php';
     }
     // Dispatch on shutdown.
     register_shutdown_function('Seytar\\Routing\\Router::dispatch', $errorCallbacks);
     // Mark bootstrapped.
     static::$bootstrapped = true;
 }
Exemplo n.º 7
0
 public function _initialize()
 {
     $projectDir = \Codeception\Configuration::projectDir();
     require $projectDir . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
     \Illuminate\Support\ClassLoader::register();
     if (is_dir($workbench = $projectDir . 'workbench')) {
         \Illuminate\Workbench\Starter::start($workbench);
     }
     $unitTesting = true;
     $testEnvironment = 'testing';
     $startFile = $projectDir . $this->config['start'];
     if (!file_exists($startFile)) {
         throw new ModuleConfig($this, "Laravel start.php file not found in {$startFile}.\nPlease provide a valid path to it using 'start' config param. ");
     }
     $app = (require $startFile);
     $app->boot();
     $this->kernel = $app;
     $this->revertErrorHandler();
 }
Exemplo n.º 8
0
 /**
  * Register Laravel autoloaders.
  */
 protected function registerAutoloaders()
 {
     require $this->config['project_dir'] . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
     ClassLoader::register();
     if (is_dir($workbench = $this->config['project_dir'] . 'workbench')) {
         Starter::start($workbench);
     }
 }
Exemplo n.º 9
0
 /**
  * Register Laravel autoloaders.
  */
 protected function registerAutoloaders()
 {
     require $this->config['project_dir'] . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
     \Illuminate\Support\ClassLoader::register();
 }
Exemplo n.º 10
0
 /**
  * @return \Illuminate\Foundation\Application
  * @throws \Codeception\Exception\ModuleConfig
  */
 protected function getApplication()
 {
     $projectDir = explode('workbench', \Codeception\Configuration::projectDir())[0];
     $projectDir .= $this->config['root'];
     require $projectDir . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
     \Illuminate\Support\ClassLoader::register();
     if (is_dir($workbench = $projectDir . 'workbench')) {
         \Illuminate\Workbench\Starter::start($workbench);
     }
     $startFile = $projectDir . $this->config['start'];
     if (!file_exists($startFile)) {
         throw new ModuleConfig($this, "Laravel start.php file not found in {$startFile}.\nPlease provide a valid path to it using 'start' config param. ");
     }
     $unitTesting = $this->config['unit'];
     $testEnvironment = $this->config['environment'];
     $app = (require $startFile);
     return $app;
 }
Exemplo n.º 11
0
 /**
  * Boot the Laravel application object.
  *
  * @return \Illuminate\Foundation\Application
  * @throws \Codeception\Exception\ModuleConfig
  */
 protected function bootApplication()
 {
     $projectDir = \Codeception\Configuration::projectDir();
     $projectDir .= $this->config['root'];
     require $projectDir . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
     \Illuminate\Support\ClassLoader::register();
     $bootstrapFile = $projectDir . $this->config['bootstrap'];
     if (!file_exists($bootstrapFile)) {
         throw new ModuleConfig($this, "Laravel bootstrap file not found in {$bootstrapFile}.\nPlease provide a valid path to it using 'bootstrap' config param. ");
     }
     $app = (require $bootstrapFile);
     $app->loadEnvironmentFrom($this->config['environment_file']);
     return $app;
 }
Exemplo n.º 12
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);
}