这个 $last cron 变量是否被正确评估?
Is this $lastcron variable being evaluated correcty?
第 182 行使用 $DB 对象从 sql 数据库中获取数据,然后将结果放入 $lastcron 变量中。
下一行像这样评估 $lastcron 变量:
if (!$lastcron and ($lastcron + $this->cron < time()) )
请向我解释这段代码!
if() 语句是否应该在 if() 语句的开头使用 !$lastcron 或 $lastcron?也就是说,应该是:
if (!$lastcron and ($lastcron + $this->cron < time()) )
或
if ($lastcron and ($lastcron + $this->cron < time()) )
你是对的,在我看来像是一个错误。
$DB->get_field()
returns 如果记录不存在则为 false,如果存在则为值。
在这种情况下,integer
值为 lastcron
应该是or
if (!$lastcron || ($lastcron + $this->cron < time()) )
第 182 行使用 $DB 对象从 sql 数据库中获取数据,然后将结果放入 $lastcron 变量中。
下一行像这样评估 $lastcron 变量:
if (!$lastcron and ($lastcron + $this->cron < time()) )
请向我解释这段代码!
if() 语句是否应该在 if() 语句的开头使用 !$lastcron 或 $lastcron?也就是说,应该是:
if (!$lastcron and ($lastcron + $this->cron < time()) )
或
if ($lastcron and ($lastcron + $this->cron < time()) )
你是对的,在我看来像是一个错误。
$DB->get_field()
returns 如果记录不存在则为 false,如果存在则为值。
在这种情况下,integer
值为 lastcron
应该是or
if (!$lastcron || ($lastcron + $this->cron < time()) )