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); }
/** * Register the service provider. * * @return void */ public function register() { $this->app['xero'] = $this->app->share(function ($app) { ClassLoader::addDirectories(array(__DIR__ . '/PHP-Xero')); $config = $this->app['config']['xero']; return new PHPXero($config['key'], $config['secret'], $config['publicPath'], $config['privatePath'], $config['format']); }); }
/** * Register the service provider. * * @return void */ public function register() { $this->app->bindShared('prez.commands.presenter', function ($app) { return new PresenterCommand($app['files']); }); $this->commands('prez.commands.presenter'); ClassLoader::addDirectories([app_path() . '/presenters']); }
protected static function bootClasses() { if (self::$config->get('app.autoload')) { $dirs = self::$config->get('app.autoload'); ClassLoader::register(); ClassLoader::addDirectories($dirs); } }
/** * Register any application services. * * This service provider is a great spot to register your various container * bindings with the application. As you can see, we are registering our * "Registrar" implementation here. You can add your own bindings too! * * @return void */ public function register() { $this->app->bind('Illuminate\\Contracts\\Auth\\Registrar', 'App\\Services\\Registrar'); ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/services', app_path() . '/services/Validation', app_path() . '/database/seeds')); // Autoload all components $components = array('posts', 'MediaManager', 'theme_manager'); foreach ($components as $component) { ClassLoader::addDirectories(array(app_path() . '/Components/' . $component, app_path() . '/Components/' . $component . '/controllers', app_path() . '/Components/' . $component . '/controllers/backend', app_path() . '/Components/' . $component . '/database/migrations', app_path() . '/Components/' . $component . '/database/seeds', app_path() . '/Components/' . $component . '/models', app_path() . '/Components/' . $component . '/presenters', app_path() . '/Components/' . $component . '/services', app_path() . '/Components/' . $component . '/validation', app_path() . '/Components/' . $component . '/views')); } }
/** * Bootstrap the application events. * * @return void */ public function boot() { // Autoload for widget factory. ClassLoader::addDirectories(array(app_path() . '/widgets')); $this->package('teepluss/theme'); // Temp to use in closure. $app = $this->app; // Add view extension. $this->app['view']->addExtension('twig.php', 'twig', function () use($app) { return new Engines\TwigEngine($app); }); }
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'); }); }
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(); }
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); } }
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(); }
| | 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); }
/** * Prüft ob der Global Bereich in der module.json existiert * wenn ja, dann wird dieser durchlaufen und alle benötigten * Ordner dem ClassLoader hinzugefügt. * * * @param string $files * @param string $module * @return void */ private function registerGlobalNamespace($files, $module) { $directories = array(); if(property_exists($files, 'global')) { foreach ($files->global as $global) { $directories[] = $this->getPath($module).$global; } ClassLoader::addDirectories($directories); } }
/** * 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); } }
/** * Register Laravel autoloaders. */ protected function registerAutoloaders() { require $this->config['project_dir'] . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; \Illuminate\Support\ClassLoader::register(); }
/** * @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; }
/** * 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; }
/** * Autoload * * Autoloads files and adds specified directories into the * global class autoloader. * * @return void */ protected function autoload() { $directory = $this->config('directory'); // Load files if ($files = $this->config('autoload.files', false)) { foreach ($files as $file) { include_once $directory . '/' . $file; } } // Register directories with the ClassLoader if ($classmap = $this->config('autoload.classmap', false)) { ClassLoader::addDirectories(array_map(function ($dir) use($directory) { return $directory . '/' . $dir; }, $classmap)); } }
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; }