/**
  * 
  * @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;
 }
示例#2
0
 protected function getDnaConfiguration()
 {
     return parent::getDnaConfiguration()->setDebug(true)->setCachePath(realpath(dirname(__DIR__) . '/cache'));
 }