Add my template project

This commit is contained in:
2024-08-09 21:30:13 +05:00
parent 0e0ac4f094
commit 832bf929dc
19 changed files with 243 additions and 0 deletions

View 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();