system/engine/loader.php
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* @package OpenCart
* @author Daniel Kerr
* @copyright Copyright (c) 2005 - 2017, OpenCart, Ltd. (https://www.opencart.com/)
* @license https://opensource.org/licenses/GPL-3.0
* @link https://www.opencart.com
*/
/**
* Loader class
*/
final class Loader {
protected $registry;
/**
* Constructor
*
* @param object $registry
*/
public function __construct($registry) {
$this->registry = $registry;
}
/**
*
*
* @param string $route
* @param array $data
*
* @return mixed
*/
public function controller($route) {
$args = func_get_args();
array_shift($args);
// Sanitize the call
$route = preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route);
// Keep the original trigger
$trigger = $route;
// Trigger the pre events
$result = $this->registry->get('event')->trigger('controller/' . $trigger . '/before', array(&$route, &$args));
// Make sure its only the last event that returns an output if required.
if ($result != null && !$result instanceof Exception) {
$output = $result;
} else {
$action = new Action($route);
$output = $action->execute($this->registry, $args);
}
// Trigger the post events
$result = $this->registry->get('event')->trigger('controller/' . $trigger . '/after', array(&$route, &$args, &$output));
if ($result && !$result instanceof Exception) {
$output = $result;
}
后面还有 212 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
