core: Add separate Debug class

Replaces 'debugMessage' by specialized debug function 'Debug::log'.
This function takes the same arguments as the previous 'debugMessage'.

A separate Debug class allows for further optimization and separation
of concern.
This commit is contained in:
logmanoriginal 2018-11-10 20:03:03 +01:00
parent 9379854f7a
commit c63af2e7ad
8 changed files with 44 additions and 40 deletions

View file

@ -132,7 +132,7 @@ class JustETFBridge extends BridgeAbstract {
date_time_set($df, 0, 0);
// debugMessage(date_format($df, 'U'));
// Debug::log(date_format($df, 'U'));
return date_format($df, 'U');
}
@ -210,7 +210,7 @@ class JustETFBridge extends BridgeAbstract {
$element = $article->find('div.subheadline', 0)
or returnServerError('Date not found!');
// debugMessage($element->plaintext);
// Debug::log($element->plaintext);
$date = trim(explode('|', $element->plaintext)[0]);
@ -223,7 +223,7 @@ class JustETFBridge extends BridgeAbstract {
$element->find('a', 0)->onclick = '';
// debugMessage($element->innertext);
// Debug::log($element->innertext);
return $element->innertext;
}
@ -288,7 +288,7 @@ class JustETFBridge extends BridgeAbstract {
$element = $html->find('div.infobox div.vallabel', 0)
or returnServerError('Date not found!');
// debugMessage($element->plaintext);
// Debug::log($element->plaintext);
$date = trim(explode("\r\n", $element->plaintext)[1]);

View file

@ -74,7 +74,7 @@ class WordPressPluginUpdateBridge extends BridgeAbstract {
}
private function getCachedDate($url){
debugMessage('getting pubdate from url ' . $url . '');
Debug::log('getting pubdate from url ' . $url . '');
// Initialize cache
$cache = Cache::create('FileCache');
$cache->setPath(PATH_CACHE . 'pages/');

View file

@ -453,7 +453,7 @@ class XenForoBridge extends BridgeAbstract {
}
// debugMessage(date_format($df, 'U'));
// Debug::log(date_format($df, 'U'));
return date_format($df, 'U');