Beispiel #1
0
 /**
  * @param ConfiguratorInterface $configurator
  */
 public function __construct(ConfiguratorInterface $configurator)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->setKey($this->config['key']);
     if (!empty($this->config['cipher'])) {
         $this->cipher = $this->config['cipher'];
     }
 }
Beispiel #2
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  * @param FilesInterface        $files
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container, FilesInterface $files)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->container = $container;
     $this->files = $files;
     //Namespaces can be edited in runtime
     $this->namespaces = $this->config['namespaces'];
 }
Beispiel #3
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ReflectionEntity[]    $entities Schemas to be inspected.
  */
 public function __construct(ConfiguratorInterface $configurator, array $entities = [])
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     foreach ($entities as $entity) {
         if (!$entity->isAbstract()) {
             $this->inspections[$entity->getName()] = new EntityInspection($this, $entity);
         }
     }
 }
Beispiel #4
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  * @param TokenizerInterface    $tokenizer
  * @param FilesInterface        $files
  * @param DatabaseManager       $databases
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container, TokenizerInterface $tokenizer, FilesInterface $files, DatabaseManager $databases)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->container = $container;
     $this->tokenizer = $tokenizer;
     $this->files = $files;
     $this->databases = $databases;
     //To generate unique filenames in any scenario
     $this->chunkID = count($this->files->getFiles($this->config['directory']));
 }
Beispiel #5
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->container = $container;
     //Loading buckets
     foreach ($this->config['buckets'] as $name => $bucket) {
         //Using default implementation
         $this->buckets[$name] = $this->container->construct(StorageBucket::class, ['storage' => $this] + $bucket);
     }
 }
Beispiel #6
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container)
 {
     $this->modules = $configurator->getConfig('modules');
     $this->container = $container;
     foreach ($this->modules as $module) {
         foreach ($module['bindings'] as $alias => $resolver) {
             $this->container->bind($alias, $resolver);
         }
         //Some modules may request initialization
         if ($module['bootstrap']) {
             $this->container->get($module['class'])->bootstrap();
         }
     }
 }
Beispiel #7
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->container = $container;
 }
Beispiel #8
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  * @param HippocampusInterface  $memory
  * @param DatabaseManager       $databases
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container, HippocampusInterface $memory, DatabaseManager $databases)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->schema = (array) $memory->loadData(static::SCHEMA_SECTION);
     $this->databases = $databases;
     $this->memory = $memory;
     $this->container = $container;
 }
Beispiel #9
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  * @param HippocampusInterface  $memory
  * @param TokenizerInterface    $tokenizer
  * @param Loader                $loader
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container, HippocampusInterface $memory, TokenizerInterface $tokenizer, Loader $loader)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->container = $container;
     $this->memory = $memory;
     $this->tokenizer = $tokenizer;
     $this->loader = $loader;
     //Trying to load list of commands from memory cache
     $this->commands = $memory->loadData('commands');
     if (!is_array($this->commands)) {
         $this->commands = [];
     }
 }
Beispiel #10
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param ContainerInterface    $container
  */
 public function __construct(ConfiguratorInterface $configurator, ContainerInterface $container)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     parent::__construct($container, $this->config['middlewares'], !empty($this->config['endpoint']) ? $this->config['endpoint'] : null);
 }
Beispiel #11
0
 /**
  * @param ConfiguratorInterface $configurator
  * @param HippocampusInterface  $memory
  * @throws LanguageException
  */
 public function __construct(ConfiguratorInterface $configurator, HippocampusInterface $memory)
 {
     $this->config = $configurator->getConfig(static::CONFIG);
     $this->memory = $memory;
     $this->setLanguage($this->config['default']);
 }