moodle_local_treestudyplan/classes/debug.php
2023-05-17 21:19:14 +02:00

30 lines
No EOL
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);
}
}
}