Adjust php.ini settings.

@throws RuntimeException
490573
protected function defineIniSettings(): void
    {
        $this->setTimezone();
        ini_set('memory_limit', '-1');

        if (extension_loaded('Zend OPcache') && ini_get('opcache.enable') && ini_get('opcache.enable_cli')) {
            if (ini_get('opcache.save_comments')) {
                ini_set('opcache.load_comments', '1');
            } else {
                ini_set('opcache.enable', '0');
            }
        }

        if (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.save_comments') === 0) {
            throw new RuntimeException('Please enable zend_optimizerplus.save_comments in php.ini.');
        }
    }
1356929
protected function _initEnvironment()
    {
        if (!$this->_bootstrap()) {
            $message = "Unable to load CakePHP core.\nMake sure Cake exists in " . CAKE_CORE_INCLUDE_PATH;
            throw new Exception($message);
        }

        if (function_exists('ini_set')) {
            ini_set('html_errors', '0');
            ini_set('implicit_flush', '1');
            ini_set('max_execution_time', '0');
        }

        $this->shiftArgs();
    }
844766
protected function initialize()
    {
        parent::initialize();

        // unless already configured, set default options to include exceptions
        $options = $this->defaults->getOptions() ?: [];

        foreach ($this->soapOptionDefaults as $option => $value) {

            if ( ! array_key_exists($option, $options)) {

                $options[ $option ] = $value;
            }
        }

        $this->defaults->setOptions($options);
    }
634356
private static function restoreIni()
    {
        foreach (self::$origIniSettings as $settingName => $settingValue) {
            switch ($settingName) {
                case 'error_reporting':
                    error_reporting($settingValue);
                    break;
                default:
                    ini_set($settingName, $settingValue);
            }
        }
    }
1225072
protected function _initSettings()
    {
        try {

            $this->setAttributes($this->settings);
            $this->_oldAttributes = $this->toArray($this->safeAttributes());
        } catch (\Exception $e) {
            \Yii::error(\Yii::t('skeeks/cms', '{cms} component error load defaul settings',
                    ['cms' => 'Cms']).': '.$e->getMessage());
        }

        return $this;
    }
1208377
private function run_initializers()
    {
        $method_name = 'init';
        $cn = get_called_class();
        
        # Run ApplicationController's init method.
        if ($inits = $this->getAppControllersMethod($method_name)) {
            foreach ($inits as $init) {
                $init = $init->bindTo($this);
                $init();
            }
        }
        
        $method = $this->selfRefl->getMethod($method_name);
        if ($method->getDeclaringClass()->getName() == $cn) {
            $this->$method_name();
        }
    }
828647
private function initialize()
    {
        if (null === $this->layout) {
            $this->layout = [
                // Control bar 1
                Config::T110  => ['s' => 84, 'x' => 28, 'y' => 155],
                Config::T310  => ['s' => 84, 'x' => 545, 'y' => 155, 'c' => 'white'],
                Config::T100  => ['s' => 84, 'x' => 662, 'y' => 155],
                Config::T105  => ['s' => 84, 'x' => 662, 'y' => 155],
                Config::T101  => ['s' => 84, 'x' => 877, 'y' => 155, 'c' => 'white'],
                // Control bar 2
                Config::T320  => ['s' => 72, 'x' => 28, 'y' => 305],
                Config::T8951 => ['s' => 32, 'x' => 387, 'y' => 245],
                Config::T8952 => ['s' => 32, 'x' => 622, 'y' => 245],
                Config::T330  => ['s' => 48, 'x' => 370, 'y' => 320],
                Config::T8913 => ['s' => 48, 'x' => 622, 'y' => 320],
                Config::T200  => ['s' => 52, 'x' => 962, 'y' => 297, 'f' => 'swiss_bold'],
                // Control bar 3 (barcodes)
                // Control bar 4
                Config::T500  => ['s' => 40, 'x' => 20, 'y' => 780],
                Config::T540  => ['s' => 20, 'x' => 255, 'y' => 780],
                Config::T541  => ['s' => 20, 'x' => 390, 'y' => 780],
                Config::T530  => ['s' => 32, 'x' => 520, 'y' => 780, 'append' => 'KG'],
                // Bloc 1
                Config::T751  => ['s' => 38, 'x' => 30, 'y' => 965],
                Config::T752  => ['s' => 38, 'x' => 30, 'y' => 1070],
                // Bloc 2
                Config::T860  => ['s' => 30, 'x' => 30, 'y' => 1290],
                Config::T861  => ['s' => 30, 'x' => 30, 'y' => 1347],
                Config::T862  => ['s' => 30, 'x' => 30, 'y' => 1404],
                Config::T863  => ['s' => 30, 'x' => 30, 'y' => 1461],
                // Bloc 3

                // Bloc 4
                Config::T8915 => ['s' => 28, 'x' => 1110, 'y' => 1020, 'a' => 270, 'prepend' => 'Client '],
                Config::T8914 => ['s' => 28, 'x' => 1110, 'y' => 1350, 'a' => 270, 'prepend' => 'ContactId '],
                Config::T810  => ['s' => 24, 'x' => 1060, 'y' => 830, 'a' => 270],
                Config::T820  => ['s' => 24, 'x' => 1015, 'y' => 830, 'a' => 270],
            ];

            $this->fonts = [
                'swiss_normal' => __DIR__ . '/../Resources/font/Swiss721CondensedBT.ttf',
                'swiss_bold'   => __DIR__ . '/../Resources/font/Swiss721BoldCondensedBT.ttf',
            ];
        }

        $this->image = imagecreatefromgif(__DIR__ . '/../Resources/img/gls-label.gif');

        $this->colors = [
            'black' => imagecolorallocate($this->image, 0, 0, 0),
            'white' => imagecolorallocate($this->image, 255, 255, 255),
        ];
    }
355829
public function initSettingsData()
    {
        $config = App::make('config');
        $this->locale = $config->get('app.locale', 'en');
        $this->fallback_locale = $this->getFallbackLocale($this->locale);
        $this->timezone = $config->get('cms.backendTimezone', $config->get('app.timezone'));

        $this->editor_font_size = $config->get('editor.font_size', 12);
        $this->editor_word_wrap = $config->get('editor.word_wrap', 'fluid');
        $this->editor_code_folding = $config->get('editor.code_folding', 'manual');
        $this->editor_tab_size = $config->get('editor.tab_size', 4);
        $this->editor_theme = $config->get('editor.theme', static::DEFAULT_THEME);
        $this->editor_show_invisibles = $config->get('editor.show_invisibles', false);
        $this->editor_highlight_active_line = $config->get('editor.highlight_active_line', true);
        $this->editor_use_hard_tabs = $config->get('editor.use_hard_tabs', false);
        $this->editor_show_gutter = $config->get('editor.show_gutter', true);
        $this->editor_auto_closing = $config->get('editor.auto_closing', false);
        $this->editor_autocompletion = $config->get('editor.editor_autocompletion', 'manual');
        $this->editor_enable_snippets = $config->get('editor.enable_snippets', false);
        $this->editor_display_indent_guides = $config->get('editor.display_indent_guides', false);
        $this->editor_show_print_margin = $config->get('editor.show_print_margin', false);
    }
264847
public function run(): void
    {
        if (!$this->config->isLoadedFromFile()) {
            throw new \RuntimeException('No configuration to edit');
        }

        $this->checkHook();
        $this->checkChange();

        $change = $this->createChange();
        $change->applyTo($this->config);
        Config\Util::writeToDisk($this->config);

        $this->io->write('Configuration successfully updated');
    }
695144
public function clearImiRuntime()
    {
        $file = \Imi\Util\Imi::getRuntimePath('imi-runtime.cache');
        if(is_file($file))
        {
            unlink($file);
            echo 'Clear imi runtime complete', PHP_EOL;
        }
        else
        {
            echo 'Imi runtime does not exists', PHP_EOL;
        }
    }
115689
protected function _initItems()
    {
        if (!$this->_itemsXmlPath) {
            throw new RuntimeException('XML Path for facade items is not specified');
        }
        
        $config = Mage::getConfig()->getNode($this->_itemsXmlPath)->children();
        
        foreach ($config as $class) {
            $this->add(Mage::getModel($class));
        }
        
        return $this;
    }
403683
private void applySettings() {
		container.reset();
		// Now show an example of the number of different columns

		WPanel gridLayoutPanel = new WPanel();

		if (cbResponsive.isSelected()) {
			gridLayoutPanel.setHtmlClass(HtmlClassProperties.RESPOND);
		}

		GridLayout layout = new GridLayout(rowCount.getValue().intValue(), columnCount.getValue()
				.intValue(),
				hGap.getValue().intValue(),
				vGap.getValue().intValue()
		);

		gridLayoutPanel.setLayout(layout);

		addBoxes(gridLayoutPanel, boxCount.getValue().intValue()); // give approx 3 rows, with a different number
		// of boxes on the final row
		container.add(gridLayoutPanel);

		gridLayoutPanel.setVisible(cbVisible.isSelected());
	}
1093567
protected function configureCache()
    {
        if (!isset($this['cache'])) {
            $this['cache'] = [
                'type' => 'array'
            ];
        }
        if (!isset($this['cache']['type'])) {
            throw new RuntimeException("cache type not configured correctly");
        }
        switch ($this['cache']['type']) {
            case 'array':
                $cache = new \Symfony\Component\Cache\Adapter\ArrayAdapter();
                break;
            case 'filesystem':
                $directory = $this['cache']['directory'];
                if (!$directory) {
                    throw new RuntimeException("cache directory not configured (please check doc/cache.md)");
                }
                if (!file_exists($directory)) {
                    mkdir($directory, 0777, true);
                }
                $cache = new \Symfony\Component\Cache\Adapter\FilesystemAdapter('', 0, $directory);
                break;
            default:
                throw new RuntimeException("Unsupported cache.type:" . $this['cache']['type']);

        }
        $this['cache'] = $cache;
    }
1046173
public static function ini()
    {
        $lang = config('lang.default');

        self::$langFolder = dirname(dirname(__DIR__)).'/app/lang/'.$lang;
        self::$langFile = self::$langFolder.'/validator.php';
        if (is_file(self::$langFile)) {
            V::langDir(self::$langFolder);
            V::lang('validator');
        }
    }
602342
public function init() {
        if (VERBOSE) echo 'INIT:' ,PHP_EOL;
        if (VERBOSE) echo ' CONNECTING API' ,PHP_EOL;
        $this->api->auth();
        if (VERBOSE) echo ' API CONNECTED' ,PHP_EOL;
        if (VERBOSE) echo ' CONNECTING SQL' ,PHP_EOL;
        $this->db->connect();
        if (VERBOSE) echo ' SQL CONNECTED' ,PHP_EOL;
        if (VERBOSE) echo ' CHECKING PATHS' ,PHP_EOL;
        if (DEBUG) echo '  CHECKING TMP DIR AT : '.$this->tmp_dir ,PHP_EOL;
        if (!file_exists($this->tmp_dir)) {
            throw new Exception("Path for 'tmp_dir' not found at '".$this->tmp_dir."'!");
        }
        if (DEBUG) echo '  CHECKING DUMP DIR AT : '.$this->dumps_dir ,PHP_EOL;
        if (!file_exists($this->dumps_dir)) {
            throw new Exception("Path for 'dumps_dir' not found at '".$this->dumps_dir."'!");
        }
        if (VERBOSE) echo ' PATHS FOUND' ,PHP_EOL;
    }
1243578
private function setPhpConfig()
    {
        if (function_exists('ini_set')) {
            if ($this->config->error->log) {
                ini_set('log_errors', true);
                ini_set('error_log', Rails::config()->log_file);
            }
        }
        
        if ($this->config['date']['timezone']) {
            date_default_timezone_set($this->config['date']['timezone']);
        } elseif (function_exists('ini_get')) {
            if (!ini_get('date.timezone') && !date_default_timezone_get()) {
                throw new Exception\RuntimeException(
                    "date.timezone directive doesn't seem to have a value. " .
                    "You are requested to either set a value in your php.ini or in your application's configuration (date->timezone)"
                );
            }
        }
        
        if ($this->config()->session->start && !Rails::cli()) {
            if ($session_name = $this->config()->session->name) {
                session_name($session_name);
            }
            session_start();
        }
        
        if ($paths = $this->config()->eager_load_paths->toArray()) {
            Rails::loader()->addPaths($paths);
            set_include_path(get_include_path() . PATH_SEPARATOR . implode(PATH_SEPARATOR, $paths));
        }
        
        set_error_handler('Rails::errorHandler', $this->config()->error->report_types);
    }
318662
public function handleInitialSettings()
    {
        $sessionClass = ReporticoSession();

        if (!$this->framework_parent && !$sessionClass::getReporticoSessionParam("awaiting_initial_defaults")) {
            $this->initial_project = false;
            $this->initial_sql = false;
            $this->initial_execute_mode = false;
            $this->initial_report = false;
            $this->initial_project_password = false;
            $this->initial_output_style = false;
            $this->initial_output_format = false;
            $this->initial_show_detail = false;
            $this->initial_show_graph = false;
            $this->initial_show_group_headers = false;
            $this->initial_show_group_trailers = false;
            $this->initial_showColumnHeaders = false;
            $this->initial_show_criteria = false;
            $this->initial_execution_parameters = false;
            $this->access_mode = false;
        }
    }