30 lines
739 B
PHP
30 lines
739 B
PHP
|
<?php
|
||
|
|
||
|
namespace local_treestudyplan;
|
||
|
|
||
|
class debug {
|
||
|
|
||
|
public static function dump($tag,$object)
|
||
|
{
|
||
|
global $CFG;
|
||
|
// assume debug environment if cachejs is false
|
||
|
if(isset($CFG->cachejs) && $CFG->cachejs == false){
|
||
|
$f = fopen("/tmp/log.txt","a");
|
||
|
fwrite($f,$tag . ":\n".print_r($object,true)."\n");
|
||
|
fclose($f);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
public static function msg($tag,$str)
|
||
|
{
|
||
|
global $CFG;
|
||
|
// assume debug environment if cachejs is false
|
||
|
if(isset($CFG->cachejs) && $CFG->cachejs == false){
|
||
|
$f = fopen("/tmp/log.txt","a");
|
||
|
fwrite($f,$tag . ":\n".$str."\n");
|
||
|
fclose($f);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|