system/library/session.php
(开头部分) 1KB这里只显示每个文件的开头 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
*/
/**
* Session class
*/
class Session {
protected $adaptor;
protected $session_id;
public $data = array();
/**
* Constructor
*
* @param string $adaptor
* @param object $registry
*/
public function __construct($adaptor, $registry = '') {
$class = 'Session\\' . $adaptor;
if (class_exists($class)) {
if ($registry) {
$this->adaptor = new $class($registry);
} else {
$this->adaptor = new $class();
}
register_shutdown_function(array($this, 'close'));
} else {
trigger_error('Error: Could not load cache adaptor ' . $adaptor . ' session!');
exit();
}
}
/**
*
*
* @return string
*/
public function getId() {
return $this->session_id;
}
/**
*
*
* @param string $session_id
*
* @return string
*/
public function start($session_id = '') {
if (!$session_id) {
if (function_exists('random_bytes')) {
$session_id = substr(bin2hex(random_bytes(26)), 0, 26);
后面还有 30 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
