コード例 #1
0
 /**
  * @param mixed $configuration
  * @return TwigRenderer
  */
 public static function factory($configuration = null)
 {
     if (is_null($configuration)) {
         $configuration = __DIR__ . '/nucleus.json';
     }
     return Nucleus::serviceFactory($configuration, 'templateRenderer.twig');
 }
コード例 #2
0
ファイル: CommandLine.php プロジェクト: mpoiriert/nucleus
 /**
  * @param mixed $configuration
  * @return ICommandLineService
  */
 public static function factory($configuration = null)
 {
     if (is_null($configuration)) {
         $configuration = __DIR__ . '/nucleus.json';
     }
     return Nucleus::serviceFactory($configuration, ICommandLineService::NUCLEUS_SERVICE_NAME);
 }
コード例 #3
0
 /**
  * 
  * @return SingletonApplicationKernel
  * @throws \RuntimeException
  */
 static function createInstance()
 {
     if (!is_null(self::$instance)) {
         throw new \RuntimeException('Nucleus application kernel instance already created');
     }
     $application = self::$instance = new static();
     $application->preCreation();
     $dnaConfiguration = self::$instance->getDnaConfiguration();
     if (!$dnaConfiguration instanceof DnaConfiguration) {
         throw new UnexpectedValueException("The return value for [getDnaConfiguration] should be a instance of [Nucleus\\Framework\\DnaConfiguration]");
     }
     $application->nucleus = Nucleus::factory($dnaConfiguration);
     $application->postCreation();
     return $application;
 }
コード例 #4
0
ファイル: Manager.php プロジェクト: mpoiriert/nucleus
 /**
  * @param mixed $configuration
  * @return Manager
  */
 public static function factory($configuration = null)
 {
     if (is_null($configuration)) {
         $configuration = __DIR__ . '/nucleus.json';
     }
     return Nucleus::serviceFactory($configuration, 'assetManager');
 }
コード例 #5
0
ファイル: MigratorTest.php プロジェクト: mpoiriert/nucleus
 protected function initializeContext($file)
 {
     $this->serviceContainer = Nucleus::factory(__DIR__ . '/fixtures/' . $file)->getServiceContainer();
     $this->migrator = $this->serviceContainer->getServiceByName('migrator');
 }
コード例 #6
0
 /**
  * @param mixed $configuration
  * @return IServiceContainer
  */
 public static function factory(array $configuration = null)
 {
     if (is_null($configuration)) {
         $configuration = __DIR__ . '/nucleus.json';
     }
     return Nucleus::serviceFactory($configuration, "serviceContainer");
 }
コード例 #7
0
ファイル: CommandLineTest.php プロジェクト: mpoiriert/nucleus
 public function setUp()
 {
     $this->nucleus = Nucleus::factory(__DIR__ . '/nucleus.json');
 }
コード例 #8
0
 public function setUp()
 {
     $this->nucleus = Nucleus::factory(__DIR__ . '/fixtures/integrationTest.json');
 }
コード例 #9
0
 /**
  * @param mixed $configuration
  * @return BusinessRuleEngine
  */
 public static function factory($configuration = null)
 {
     if (is_null($configuration)) {
         $configuration = __DIR__ . '/nucleus.json';
     }
     return Nucleus::serviceFactory($configuration, 'businessRuleEngine');
 }
コード例 #10
0
 public function setUp()
 {
     $this->serviceContainer = Nucleus::factory(array('imports' => array(__DIR__ . '/..', __DIR__ . '/../../Framework/Tests/fixtures/phpunit.json')))->getServiceContainer();
     $this->accessControlService = $this->serviceContainer->getServiceByName(IAccessControlService::NUCLEUS_SERVICE_NAME);
 }