1: | <?php
2: | namespace Opencart\Admin\Controller\Startup;
3: | /**
4: | * Class Extension
5: | *
6: | * @package Opencart\Admin\Controller\Startup
7: | */
8: | class Extension extends \Opencart\System\Engine\Controller {
9: | /**
10: | * Index
11: | *
12: | * @return void
13: | */
14: | public function index(): void {
15: | // Add extension paths from the DB
16: | $this->load->model('setting/extension');
17: |
18: | $results = $this->model_setting_extension->getInstalls();
19: |
20: | foreach ($results as $result) {
21: | $extension = str_replace(['_', '/'], ['', '\\'], ucwords($result['code'], '_/'));
22: |
23: | // Register controllers, models and system extension folders
24: | $this->autoloader->register('Opencart\Admin\Controller\Extension\\' . $extension, DIR_EXTENSION . $result['code'] . '/admin/controller/');
25: | $this->autoloader->register('Opencart\Admin\Model\Extension\\' . $extension, DIR_EXTENSION . $result['code'] . '/admin/model/');
26: | $this->autoloader->register('Opencart\System\Library\Extension\\' . $extension, DIR_EXTENSION . $result['code'] . '/system/library/');
27: |
28: | // Template directory
29: | $this->template->addPath('extension/' . $result['code'], DIR_EXTENSION . $result['code'] . '/admin/view/template/');
30: |
31: | // Language directory
32: | $this->language->addPath('extension/' . $result['code'], DIR_EXTENSION . $result['code'] . '/admin/language/');
33: |
34: | // Config directory
35: | $this->config->addPath('extension/' . $result['code'], DIR_EXTENSION . $result['code'] . '/system/config/');
36: | }
37: |
38: | // Register OCMOD
39: | $this->autoloader->register('Opencart\Admin\Controller\Extension\Ocmod', DIR_EXTENSION . 'ocmod/admin/controller/');
40: | $this->autoloader->register('Opencart\Admin\Model\Extension\Ocmod', DIR_EXTENSION . 'ocmod/admin/model/');
41: | $this->autoloader->register('Opencart\System\Library\Extension\Ocmod', DIR_EXTENSION . 'ocmod/system/library/');
42: | $this->template->addPath('extension/ocmod', DIR_EXTENSION . 'ocmod/admin/view/template/');
43: | $this->language->addPath('extension/ocmod', DIR_EXTENSION . 'ocmod/admin/language/');
44: | $this->config->addPath('extension/ocmod', DIR_EXTENSION . 'ocmod/system/config/');
45: | }
46: | }
47: |

OpenCart API API documentation generated by ApiGen dev-master