MCPcopy Create free account
hub / github.com/crmeb/CRMchat / sql_split

Method sql_split

crmchat/app/controller/InstallController.php:654–679  ·  view source on GitHub ↗
($sql, $tablepre)

Source from the content-addressed store, hash-verified

652 }
653
654 function sql_split($sql, $tablepre)
655 {
656
657 if ($tablepre != "tp_")
658 $sql = str_replace("tp_", $tablepre, $sql);
659
660 $sql = preg_replace("/TYPE=(InnoDB|MyISAM|MEMORY)( DEFAULT CHARSET=[^; ]+)?/", "ENGINE=\\1 DEFAULT CHARSET=utf8", $sql);
661
662 $sql = str_replace("\r", "\n", $sql);
663 $ret = array();
664 $num = 0;
665 $queriesarray = explode(";\n", trim($sql));
666 unset($sql);
667 foreach ($queriesarray as $query) {
668 $ret[$num] = '';
669 $queries = explode("\n", trim($query));
670 $queries = array_filter($queries);
671 foreach ($queries as $query) {
672 $str1 = substr($query, 0, 1);
673 if ($str1 != '#' && $str1 != '-')
674 $ret[$num] .= $query;
675 }
676 $num++;
677 }
678 return $ret;
679 }
680
681 // 递归删除文件夹
682 function delFile($dir, $file_type = '')

Callers 1

indexMethod · 0.95

Calls 1

trimFunction · 0.50

Tested by

no test coverage detected