vendor/alipay/lotusphp_runtime/Config.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
class LtConfig
{
public $storeHandle;
protected $conf;
public function __construct()
{
if (!is_object($this->storeHandle))
{
$this->storeHandle = new LtStoreMemory;
}
}
public function init()
{
//don't removeme, I am the placeholder
}
public function get($key)
{
$storedConfig = $this->storeHandle->get($key);
if ($storedConfig instanceof LtConfigExpression)
{
$str = $storedConfig->__toString();
if ($storedConfig->autoRetrived)
{
eval("\$value=$str;");
return $value;
}
else
{
return $str;
}
}
else
{
return $storedConfig;
}
}
/**
* 警告
* 这里会包含两个用户定义的配置文件,为了不和配置文件里的变量名发生重名
* 本方法不定义和使用变量名
*/
public function loadConfigFile($configFile)
{
if (0 == $this->storeHandle->get(".config_total"))
{
if (null === $configFile || !is_file($configFile))
{
trigger_error("no config file specified or invalid config file");
}
$this->conf = include($configFile);
if (!is_array($this->conf))
{
trigger_error("config file do NOT return array: $configFile");
}
elseif (!empty($this->conf))
后面还有 24 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
