core: move message() method to parent class BridgeAbstract

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-07-08 19:07:30 +02:00
parent 3c0d13c1bb
commit d74beb6c6a

View file

@ -105,6 +105,18 @@ abstract class BridgeAbstract implements BridgeInterface{
return $this; return $this;
} }
public function message($text) {
if(!file_exists('DEBUG')){
return;
}
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
$calling = $backtrace[2];
$message = $calling["file"].":".$calling["line"]
." class ".get_class($this)."->".$calling["function"]
." - ".$text;
error_log($message);
}
protected function getContents($url,$use_include_path=false,$context=null,$offset=0,$maxlen=null){ protected function getContents($url,$use_include_path=false,$context=null,$offset=0,$maxlen=null){
$contextOptions = array( $contextOptions = array(
'http' => array( 'http' => array(
@ -234,14 +246,6 @@ abstract class HttpCachingBridgeAbstract extends BridgeAbstract {
// unlink($filename); // unlink($filename);
} }
public function message($text) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
$calling = $backtrace[2];
$message = $calling["file"].":".$calling["line"]
." class ".get_class($this)."->".$calling["function"]
." - ".$text;
error_log($message);
}
} }
class Bridge{ class Bridge{