mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 01:25:21 +02:00
core: Add Debug::isEnabled() and Debug::isSecure()
Also adds documentation to Debug.php! * Debug::isEnabled() Checks if the DEBUG file exists on disk on the first call (stored in memory for the duration of the instance). Returns true if debug mode is enabled for the client. This function also sets the internal flag for Debug::isSecure()! * Debug::isSecure() Returns true if debuging is enabled for specific IP addresses, false otherwise. This is checked on the first call of Debug::isEnabled(). If you call this function before Debug::isEnabled(), the default value is false.
This commit is contained in:
parent
c63af2e7ad
commit
a0490e3673
5 changed files with 87 additions and 36 deletions
|
@ -123,7 +123,7 @@ $defaultSpanText = DEFAULT_SPAN_TEXT){
|
|||
$time = $cache->getTime();
|
||||
if($time !== false
|
||||
&& (time() - $duration < $time)
|
||||
&& (!defined('DEBUG') || DEBUG !== true)) { // Contents within duration
|
||||
&& Debug::isEnabled()) { // Contents within duration
|
||||
$content = $cache->loadData();
|
||||
} else { // Content not within duration
|
||||
$content = getContents($url, $header, $opts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue