Add my template project
This commit is contained in:
37
engine/class/0002.debug.php
Normal file
37
engine/class/0002.debug.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// REQUIREMENTS:
|
||||
// 0001.db.php
|
||||
|
||||
class Debug {
|
||||
public static function init() {
|
||||
if(!Root::installed())
|
||||
self::createTables();
|
||||
}
|
||||
|
||||
public static function createTables() {
|
||||
DB::getQuery('main',
|
||||
'CREATE TABLE IF NOT EXISTS `debug_log` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`value` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
)
|
||||
ENGINE = InnoDB
|
||||
CHARSET=utf8
|
||||
COLLATE utf8_general_ci'
|
||||
);
|
||||
}
|
||||
|
||||
public static function print($a, $b = false) {
|
||||
echo '<pre>';
|
||||
$b ? var_dump($a) : print_r($a);
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
public static function log($string) {
|
||||
$string = date('H:i:s d.m.Y', time()).' | '.$string;
|
||||
DB::getQuery('main', 'INSERT INTO `debug_log` (`value`) VALUES (?)', $string);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Debug::init();
|
Reference in New Issue
Block a user