Zaregistruje config soubor(y) daného modulu
@param Configurator $configurator
513852
protected function registerConfig(Configurator $configurator)
	{
		parent::registerConfig($configurator);
		$configurator->addConfig(__DIR__ . DIRECTORY_SEPARATOR . "config/configuration.neon");
	}
513861
public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/../config/config.yml');

        foreach ($this->extraConfigFiles as $configFile) {
            $loader->load($configFile);
        }
    }
237497
public function withValidator($validator)
    {
        if ($validator->passes()) {
            $validator->after(function ($validator) {

                try {
                    // get validated data
                    $data = $this->validated();

                    // 1 Copy theme
                    if (empty($data['original_theme'])) {
                        $theme = string_slug($data['APP_NAME']);
                        $dest = app()->resourcePath('themes' . DS . $theme);
                        if (is_dir($dest)) {
                            throw new InstallerFailed(str_replace(':theme', $theme, __('msg.theme_exists')));
                        }
                        $files = new \RecursiveIteratorIterator(
                            new \RecursiveDirectoryIterator(
                                app()->resourcePath('themes' . DS . $data['APP_THEME']),
                                \RecursiveDirectoryIterator::SKIP_DOTS
                            ),
                            \RecursiveIteratorIterator::SELF_FIRST
                        );
                        foreach ($files as $file) {
                            $pathname = $dest . DS . $files->getSubPathName();
                            $file->isDir() ? mkdir($pathname, 0755, true) : copy($file, $pathname);
                        }
                    }

                    // 2 Creat symlink to uploads dir
                    clearstatcache(true, $uploads_path = app()->basePath('uploads'));
                    if (! file_exists($uploads_path)) {
                        symlink(
                            app()->basePath('storage' . DS . 'app' . DS . 'uploads'),
                            $uploads_path
                        );
                    }

                    // 3 Manipulation of the database
                    \DB::beginTransaction();

                    // 3.1 Seed DB
                    $exitCode = \Artisan::call('db:seed', ['--force' => true]);
                    $outputSeed = \Artisan::output();
                    session()->flash('flash_output_seed', $outputSeed);

                    // 3.2 Creat user
                    \DB::table('users')->insert([
                        'name' => $data['name'],
                        'email' => $data['email'],
                        'password' => bcrypt($data['password']),
                        'role' => 'owner',
                        'last_ip' => request()->ip(),
                        'created_at' => date('Y-m-d H:i:s'),
                    ]);

                    // 3.3 Seed test content DB
                    if (! empty($data['test_seed'])) {
                        $exitCode = \Artisan::call('db:seed', ['--force' => true, '--class' => 'TestContentSeeder']);
                        $outputTestSeed = \Artisan::output();
                        session()->flash('flash_output_test_seed', $outputTestSeed);
                    }

                    // 4 Save config files

                    // Finaly set to `.env` variables
                    $this->merge([
                        // Set to new copied theme
                        'APP_THEME' => $theme ?? $data['APP_THEME'],
                        // Set to BBCMS is install complete
                        'APP_SET' => 'true',
                        'APP_DEBUG' => 'false',
                        // Mail settings
                        'MAIL_FROM_NAME' => $data['name'],
                        'MAIL_FROM_ADDRESS' => $data['email'],
                    ]);

                    \DB::commit();
                }
                catch (\InstallerFailed $e) {
                    \DB::rollback();
                    $validator->errors()->add('common', $e->getMessage());
                }

            });
        }

        return $validator;
    }
647475
public function createEiPropConfigurator(): EiPropConfigurator {
		$eiPropConfigurator = parent::createEiPropConfigurator();
		IllegalStateException::assertTrue($eiPropConfigurator instanceof AdaptableEiPropConfigurator);
		$eiPropConfigurator->registerDraftConfigurable($this);
		return $eiPropConfigurator;
	}
1280067
public function injectConfigurationManager(
        \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
    ) {
        $this->configurationManager = $configurationManager;
        $this->cObj = $this->configurationManager->getContentObject();
    }
56101
public function withValidator($validator)
    {
        if ($validator->passes()) {
            $validator->after(function ($validator) {

                try {
                    // get validated data
                    $data = $this->validated();

                    // Set temporary DB connection
                    config(['database.connections.mysql' => [
                        'driver' => 'mysql',
                        'host' =>  $data['DB_HOST'],
                        'database' => $data['DB_DATABASE'],
                        'prefix' => $data['DB_PREFIX'],
                        'username' => $data['DB_USERNAME'],
                        'password' => $data['DB_PASSWORD'],
                        'charset' => 'utf8',
                        'collation' => 'utf8_unicode_ci',
                        'strict' => true,
                        'engine' => 'InnoDB',
                    ]]);

                    // Check DB connection and exists table
                    \DB::purge('mysql');
                    \DB::reconnect('mysql');
                    \DB::setTablePrefix($data['DB_PREFIX']);
                    \DB::connection()->getPdo();
                    if (is_null(\DB::connection('mysql')->getDatabaseName())) {
                        throw new InstallerFailed(__('msg.not_dbconnect'));
                    }

                    // 3 Manipulation of the database
                    \DB::beginTransaction();

                    // Make migrate
                    $exitCode = \Artisan::call('migrate', ['--force' => true]);
                    $outputMigrate = \Artisan::output();
                    session()->flash('flash_output_migrate', $outputMigrate);

                    \DB::commit();
                } catch (\InstallerFailed $e) {
                    $validator->errors()->add('database', $e->getMessage());
                } catch (\PDOException $e) {
                    $validator->errors()->add('database', $e->getMessage());
                } finally {
                    \DB::rollback();
                }

            });
        }

        return $validator;
    }
638935
public function configure()
  {
    $tokenGenerator = new DefaultToken(94, DefaultToken::FORMAT_BASE64);

    $expire = strtotime(Remember::$expire, 0);
    $cookie = new PHPCookie("application_session", $expire, "/", "", true, true);

    Remember::$storage = new FileStorage(Remember::$tokensDir);
    Remember::$rememberMe = new Authenticator(Remember::$storage, $tokenGenerator, $cookie);
  }
443024
public function configureServiceManager(ServiceManager $serviceManager)
    {
        foreach ($this->config as $key => $value) {
            switch ($key) {
                case 'factories':
                    $this->configureFactories($serviceManager, $value);
                    break;
            }
        }
    }
1264748
public function handle(ConfigurationProvider $provider, Migrator $migrator)
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        $configuration = $provider->getForConnection(
            $this->option('connection')
        );

        $version   = $this->argument('version');
        $direction = $this->option('down') ? 'down' : 'up';

        $version = $configuration->getVersion($version);

        if ($path = $this->option('write-sql')) {
            $migrator->executeToFile($version, $direction, $path);
        } else {
            $migrator->execute($version, $direction, $this->option('dry-run'), $this->option('query-time'));
        }

        foreach ($migrator->getNotes() as $note) {
            $this->line($note);
        }
    }
711908
public static function init($config = [], $loader = null)
    {
        /**
         * Определение пути запуска скрипта
         */
        if (!defined('PUBLIC_PATH')) {
            $debug = debug_backtrace();
            define('PUBLIC_PATH', realpath(dirname($debug[0]['file'])) . DS);
        }

        if (!defined('BASE_PATH')) {
            define('BASE_PATH', realpath(dirname(PUBLIC_PATH)) . DS);
        }

        if (getenv('SOFI_DEVELOPER_MACHINE') === 'TRUE') {
            define('SOFI_MODE', 4);
            self::$dev = new Dev();
        } else {
            define('SOFI_MODE', 0);
        }
        
        register_shutdown_function([Sofi::class,'done']);

        self::addConfig(self::getConfigFile('sofi', BASE_PATH));
        self::addConfig($config);

        if (self::$general['project'] == '') {
            echo 'Empty Project name';
            die();
        }

        if (is_object($loader)) {
            self::$Loader = $loader;
            foreach (self::$general['paths'] as $name => $path) {
                self::$Loader->addPsr4($name, BASE_PATH . $path);
            }
        }

        /*
         * General init
         */
        foreach (self::$general['ini'] as $ini => $val) {
            if (is_int($ini)) {
                ini_set($val, true);
            } else {
                ini_set($ini, $val);
            }
        }

        if (self::$general['session']) {
            session_start();
        }

        ignore_user_abort(self::$general['ignore_user_abort']);

        set_time_limit(self::$general['time-limit']);
        date_default_timezone_set(self::$general['time-zone']);
        mb_internal_encoding(self::$general['charset']);
        mb_regex_encoding(self::$general['charset']);
    }
1266750
public function addValidation(Validator $validator) {
		$fields = (array)$this->getConfig('dummyField');
		foreach ($fields as $field) {
			$validator->requirePresence($field);
			$validator->allowEmpty($field);
			$validator->add($field, [
				$field => [
					'rule' => function ($value, $context) {
						return $value === '';
					},
					'last' => true
				],
			]);
		}
	}
925890
public function setValidator($validator)
    {
        if (!($validator instanceof AnDomainValidatorAbstract)) {
            if (is_string($validator) && strpos($validator, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->path = array('domain','validator');
                $identifier->name = $validator;
            } else {
                $identifier = $this->getIdentifier($validator);
            }

            register_default(array('identifier' => $identifier, 'prefix' => $this->_repository->getClone()));

            $validator = $identifier;
        }

        $this->_validator = $validator;

        return $this;
    }
518346
public function setConfigurator($configurator)
    {
        $this->changes['configurator'] = true;

        if (is_string($configurator) && false !== strpos($configurator, '::')) {
            $configurator = explode('::', $configurator, 2);
        }

        $this->configurator = $configurator;

        return $this;
    }
191253
public function loadConfiguration(): void
	{
		$config = $this->validateConfig($this->defaults, $this->config);

		foreach ($config as $bridge => $enabled) {
			// Don't register sub extension
			if ($enabled === false) {
				continue;
			}

			// Security check
			Validators::assertField($config, $bridge, 'array');

			// Register sub extension a.k.a CompilerPass
			$this->passes[$bridge] = new $this->map[$bridge]();
			$this->passes[$bridge]->setCompiler($this->compiler, $this->prefix($bridge));
			$this->passes[$bridge]->setConfig($this->config[$bridge] ?? []);
			$this->passes[$bridge]->loadConfiguration();
		}
	}
364364
public static function register(Nette\Configurator $configurator, $name = self::DEFAULT_EXTENSION_NAME)
    {
        $class = get_called_class();
        $configurator->onCompile[] = function (Nette\Configurator $configurator, Nette\DI\Compiler $compiler) use ($class, $name) {
            $compiler->addExtension($name, new $class);
        };
    }
800014
public function validateValidatorConfiguration($validatorConfiguration)
    {
        $validationErrors = [];

        if (!is_array($validatorConfiguration)) {
            $validationErrors[] = new ValidationError('Validator configuration must be in form of an array');

            return $validationErrors;
        }

        foreach ($validatorConfiguration as $validatorIdentifier => $constraints) {
            if ($validatorIdentifier !== 'TagsValueValidator') {
                $validationErrors[] = new ValidationError(
                    "Validator '%validator%' is unknown",
                    null,
                    [
                        '%validator%' => $validatorIdentifier,
                    ],
                    "[${validatorIdentifier}]"
                );

                continue;
            }

            if (!is_array($constraints)) {
                $validationErrors[] = new ValidationError('TagsValueValidator constraints must be in form of an array');

                return $validationErrors;
            }

            foreach ($constraints as $name => $value) {
                switch ($name) {
                    case 'subTreeLimit':
                        if (!is_numeric($value)) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be of numeric type",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        if ($value < 0) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be equal or larger than 0",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        if ($value > 0 && !$this->tagsService->loadTagList([$value])) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be an existing tag ID",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        break;
                    case 'maxTags':
                        if (!is_int($value)) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be of integer type",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        if ($value < 0) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be equal or larger than 0",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        break;
                    default:
                        $validationErrors[] = new ValidationError(
                            "Validator parameter '%parameter%' is unknown",
                            null,
                            [
                                '%parameter%' => $name,
                            ],
                            "[${validatorIdentifier}][${name}]"
                        );
                }
            }
        }

        return $validationErrors;
    }
455637
static public void addConfigurator(ClientConfigurator<?> configurator) {
    if (!HttpClientConfigurator.class.isInstance(configurator) && !OkHttpClientConfigurator.class.isInstance(configurator)) {
      throw new IllegalArgumentException(
        "Configurator must implement OkHttpClientConfigurator"
      );
    }

    clientConfigurator = configurator;
  }