private function matchOperateAndTableName($sql)
 {
     preg_match('/^(DELETE|INSERT|REPLACE)\\s+(.+?\\s)?`?' . $this->prefix . '(\\w+)`?\\s+/i', $sql, $match);
     if (!$match) {
         return array(false, false, false);
     }
     list(, $operate, , $tableName) = $match;
     list($operate, $tableName) = array(strtolower($operate), strtolower($tableName));
     if (!ACloudSysCoreS::inArray($tableName, $this->getTables())) {
         return array(false, false, false);
     }
     return array(true, $operate, $tableName);
 }
Esempio n. 2
0
 public function format($data, $format, $charset)
 {
     $format = ACloudSysCoreS::inArray(strtolower($format), $this->formats) ? strtolower($format) : 'json';
     $action = $format . 'Format';
     return $this->{$action}($data, $charset);
 }