Initial commit.

This is to be the new HashRU website based on the Aaronweb.net/Kabuki CMS.
This commit is contained in:
Aaron committed 2017-11-09 17:00:22 +01:00
commit ab0e4efbcb
68 files changed
+8054

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
<?php
/*****************************************************************************
* ErrorLog.php
* Contains key class ErrorLog.
*
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/
class ErrorLog
{
public static function log(array $data)
{
if (!Registry::has('db'))
return false;
return Registry::get('db')->query('
INSERT INTO log_errors
(id_user, message, debug_info, file, line, request_uri, time, ip_address)
VALUES
({int:id_user}, {string:message}, {string:debug_info}, {string:file}, {int:line},
{string:request_uri}, CURRENT_TIMESTAMP, {string:ip_address})',
$data);
}
public static function flush()
{
return Registry::get('db')->query('TRUNCATE log_errors');
}
public static function getCount()
{
return Registry::get('db')->queryValue('
SELECT COUNT(*)
FROM log_errors');
}
}