浏览代码

Move database methods to static and document database class (#6474)

* Add new static method to created newly connected database object

* Document database class and clean up and document some of the methods.
This removes the methods that should not be in each instance and places
them in the single instance class as to occupy less resources and be
able to create database objects more efficiently.

* More docs & removed the ability to set any value within the object.

Co-authored-by: Tim Fry <[email protected]>
frytimo 3 年之前
父节点
当前提交
fc294595ea
共有 2 个文件被更改,包括 504 次插入191 次删除
  1. 3 1
      core/user_logs/resources/classes/user_logs.php
  2. 501 190
      resources/classes/database.php

+ 3 - 1
core/user_logs/resources/classes/user_logs.php

@@ -73,6 +73,7 @@ if (!class_exists('user_logs')) {
 		 * add user_logs
 		 */
 		public static function add($result) {
+				$array = [];
 			//prepare the array
 				$array['user_logs'][0]["timestamp"] = 'now()';
 				$array['user_logs'][0]["domain_uuid"] = $result['domain_uuid'];
@@ -97,7 +98,8 @@ if (!class_exists('user_logs')) {
 				$database = new database;
 				$database->app_name = 'authentication';
 				$database->app_uuid = 'a8a12918-69a4-4ece-a1ae-3932be0e41f1';
-				$database->uuid($user_log_uuid);
+				if (strlen($user_log_uuid)>0)
+					$database->uuid($user_log_uuid);
 				$database->save($array, false);
 				$message = $database->message;
 

文件差异内容过多而无法显示
+ 501 - 190
resources/classes/database.php


部分文件因为文件数量过多而无法显示