1: | <?php
2: | namespace Opencart\Admin\Controller\Startup;
3: | /**
4: | * Class Setting
5: | *
6: | * @package Opencart\Admin\Controller\Startup
7: | */
8: | class Setting extends \Opencart\System\Engine\Controller {
9: | /**
10: | * Index
11: | *
12: | * @return void
13: | */
14: | public function index(): void {
15: | $this->load->model('setting/setting');
16: |
17: | // Settings
18: | $results = $this->model_setting_setting->getSettings(0);
19: |
20: | foreach ($results as $result) {
21: | if (!$result['serialized']) {
22: | $this->config->set($result['key'], $result['value']);
23: | } else {
24: | $this->config->set($result['key'], json_decode($result['value'], true));
25: | }
26: | }
27: |
28: | // Set time zone
29: | if ($this->config->get('config_timezone')) {
30: | date_default_timezone_set($this->config->get('config_timezone'));
31: |
32: | // Sync PHP and DB time zones.
33: | $this->db->query("SET time_zone = '" . $this->db->escape(date('P')) . "'");
34: | }
35: |
36: | // Response output compression level
37: | if ($this->config->get('config_compression')) {
38: | $this->response->setCompression((int)$this->config->get('config_compression'));
39: | }
40: | }
41: | }
42: |

OpenCart API API documentation generated by ApiGen dev-master