duplicate code related to catalog/startup/* and framework.php
Author: farshadfmrCreated Sep 13, 2026Updated Sep 13, 2026
I just noticed that we have duplicate code in catalog/startup/* and framework.php which are triggered on both files. for example:
catalog/startup/error.php
$this->registry->set('log', new \Opencart\System\Library\Log($this->config->get('config_error_filename')));
catalog/startup/session.php
$session = new \Opencart\System\Library\Session($this->config->get('session_engine'), $this->registry);
catalog/startup/setting.php
// Url
$this->registry->set('url', new \Opencart\System\Library\Url($this->config->get('config_url')));and
system/framework.php
$log = new \Opencart\System\Library\Log($config->get('error_filename'));
$session = new \Opencart\System\Library\Session($config->get('session_engine'), $registry);
$registry->set('url', new \Opencart\System\Library\Url($config->get('site_url')));Is there a reason for this?
Source: opencart/opencart