]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBA.php
Use ISO-639-1 for the language detection
[friendica.git] / src / Database / DBA.php
index d609f108ebf0626506b28d251b99dabfb2de7706..0c0fd0f80d30839cf94261d08dfee5a0f9a63334 100644 (file)
@@ -42,6 +42,11 @@ class DBA
         */
        const NULL_DATETIME = '0001-01-01 00:00:00';
 
+       /**
+        * Lowest possible datetime(6) value
+        */
+       const NULL_DATETIME6 = '0001-01-01 00:00:00.000000';
+
        public static function connect(): bool
        {
                return DI::dba()->connect();
@@ -821,6 +826,27 @@ class DBA
                return DI::dba()->processlist();
        }
 
+       /**
+        * Optimizes tables
+        *
+        * @param string $table a given table
+        *
+        * @return bool True, if successfully optimized, otherwise false
+        * @throws \Exception
+        */
+       public static function optimizeTable(string $table): bool
+       {
+               return DI::dba()->optimizeTable($table);
+       }
+
+       /**
+        * Kill sleeping database processes
+        */
+       public static function deleteSleepingProcesses()
+       {
+               DI::dba()->deleteSleepingProcesses();
+       }
+
        /**
         * Fetch a database variable
         *