Ejemplo n.º 1
0
 /**
  * Create configurator instance with configuration from internal configurator
  *
  * @param ApplicationInterface|Application $application
  * @param ComponentManager $runner
  *
  * @return bool
  *
  */
 public function init(ApplicationInterface $application, ComponentManager $runner)
 {
     $options = ['cache' => false];
     $data = $runner->getData();
     $configuration = isset($data['config']) ? $data['config'] : [];
     $options = $runner->getOptions($this);
     foreach ($configuration as $key => $file) {
         if (is_array($file)) {
             unset($configuration[$key]);
             continue;
         }
         if (!is_file($file)) {
             unset($configuration[$key]);
         }
     }
     $application->getContainer()->share(ConfiguratorInterface::class, $application->getContainer()->get('application.internal.config', [$configuration, $options]));
     return true;
 }