Преглед изворни кода

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

Разлика између датотеке није приказан због своје велике величине
+ 501 - 190
resources/classes/database.php


Неке датотеке нису приказане због велике количине промена