Местонахождение sqlite-базы тянется из конфига.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
namespace Battles;
|
||||
use Config;
|
||||
use SQLite3;
|
||||
|
||||
class GameLogs
|
||||
@@ -16,7 +17,7 @@ class GameLogs
|
||||
*/
|
||||
public static function addBankLog(int $senderId, int $receiverId, int $amount, string $type, string $text)
|
||||
{
|
||||
$db = new SQLite3('databases/logs.sqlite');
|
||||
$db = new SQLite3(Config::$db_sqlite);
|
||||
$row = $db->prepare("INSERT INTO bank_logs (sender_id, receiver_id, amount, type, text) VALUES (?, ?, ?, ?, ?)");
|
||||
$row->bindParam(1, $senderId, SQLITE3_INTEGER);
|
||||
$row->bindParam(2, $receiverId, SQLITE3_INTEGER);
|
||||
@@ -42,7 +43,7 @@ class GameLogs
|
||||
if (empty($type)) {
|
||||
$type = "system";
|
||||
}
|
||||
$db = new SQLite3('databases/logs.sqlite');
|
||||
$db = new SQLite3(Config::$db_sqlite);
|
||||
$row = $db->prepare("INSERT INTO users_logs (user_id, author_id, type, text) VALUES (?,?,?,?)");
|
||||
$row->bindParam(1, $userId, SQLITE3_INTEGER);
|
||||
$row->bindParam(2, $authorId, SQLITE3_INTEGER);
|
||||
|
||||
Reference in New Issue
Block a user