CRM-15426 - record SMS errors
[civicrm-core.git] / CRM / Logging / Schema.php
index b7debcb7e1286daac00b5c76334ad6d23dad424c..b67d3af955ba03b2bdf276171bd3d4ad5b9d997e 100644 (file)
@@ -74,10 +74,9 @@ AND    TABLE_NAME LIKE 'civicrm_%'
     $this->tables = preg_grep('/^civicrm_import_job_/', $this->tables, PREG_GREP_INVERT);
     $this->tables = preg_grep('/_cache$/', $this->tables, PREG_GREP_INVERT);
     $this->tables = preg_grep('/_log/', $this->tables, PREG_GREP_INVERT);
-    $this->tables = preg_grep('/^civicrm_task_action_temp_/', $this->tables, PREG_GREP_INVERT);
-    $this->tables = preg_grep('/^civicrm_export_temp_/', $this->tables, PREG_GREP_INVERT);
     $this->tables = preg_grep('/^civicrm_queue_/', $this->tables, PREG_GREP_INVERT);
     $this->tables = preg_grep('/^civicrm_menu/', $this->tables, PREG_GREP_INVERT); //CRM-14672
+    $this->tables = preg_grep('/_temp_/', $this->tables, PREG_GREP_INVERT);
 
     // do not log civicrm_mailing_event* tables, CRM-12300
     $this->tables = preg_grep('/^civicrm_mailing_event_/', $this->tables, PREG_GREP_INVERT);
@@ -261,6 +260,11 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
     return TRUE;
   }
 
+  /**
+   * @param $table
+   *
+   * @return array
+   */
   private function _getCreateQuery($table) {
     $dao = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE {$table}");
     $dao->fetch();
@@ -268,6 +272,12 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
     return $create;
   }
 
+  /**
+   * @param $col
+   * @param $createQuery
+   *
+   * @return array|mixed|string
+   */
   private function _getColumnQuery($col, $createQuery) {
     $line = preg_grep("/^  `$col` /", $createQuery);
     $line = rtrim(array_pop($line), ',');
@@ -276,6 +286,9 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
     return $line;
   }
 
+  /**
+   * @param bool $rebuildTrigger
+   */
   function fixSchemaDifferencesForAll($rebuildTrigger = FALSE) {
     $diffs = array();
     foreach ($this->tables as $table) {
@@ -302,6 +315,11 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
    * so there's no need for a default timestamp and therefore we remove such default timestamps
    * also eliminate the NOT NULL constraint, since we always copy and schema can change down the road)
    */
+  /**
+   * @param $query
+   *
+   * @return mixed
+   */
   function fixTimeStampAndNotNullSQL($query) {
     $query = str_ireplace("TIMESTAMP NOT NULL", "TIMESTAMP NULL", $query);
     $query = str_ireplace("DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", '', $query);
@@ -399,6 +417,12 @@ WHERE  table_schema IN ('{$this->db}', '{$civiDB}')";
     return $columnSpecs[$table];
   }
 
+  /**
+   * @param $civiTable
+   * @param $logTable
+   *
+   * @return array
+   */
   function columnsWithDiffSpecs($civiTable, $logTable) {
     $civiTableSpecs = $this->columnSpecsOf($civiTable);
     $logTableSpecs  = $this->columnSpecsOf($logTable);
@@ -534,6 +558,11 @@ COLS;
     return (bool) CRM_Core_DAO::singleValueQuery("SHOW TRIGGERS LIKE 'civicrm_contact'");
   }
 
+  /**
+   * @param $info
+   * @param null $tableName
+   * @param bool $force
+   */
   function triggerInfo(&$info, $tableName = NULL, $force = FALSE) {
     // check if we have logging enabled
     $config =& CRM_Core_Config::singleton();