示例#1
0
文件: Core.php 项目: vigm/advancedMD
 /**
  * Setup the application with the default provider
  */
 protected function loadApplicationCore()
 {
     $autoloader = Autoloader::getInstance();
     $dependencies = new InjectionContainer();
     $providers = new ProviderRegistry($dependencies);
     $application = new Application($autoloader, $dependencies, $providers);
     $provider = $application->addProvider(SYSPATH . 'ee/EllisLab/ExpressionEngine', 'app.setup.php', 'ee');
     $provider->setConfigPath($this->getConfigPath());
     $dependencies->register('App', function ($di, $prefix = NULL) use($application) {
         if (isset($prefix)) {
             return $application->get($prefix);
         }
         return $application;
     });
     $this->legacy->getFacade()->set('di', $dependencies);
     return $application;
 }
示例#2
0
 /**
  * Register this provider's namespace
  */
 protected function registerNamespace()
 {
     $this->autoloader->addPrefix($this->getNamespace(), $this->path);
 }