* merge checkDemoData.php to check.php.

This commit is contained in:
wangchunsheng
2013-01-09 01:06:49 +00:00
parent 5355b7715f
commit 4cef8e0281
2 changed files with 14 additions and 14 deletions
+14
View File
@@ -138,3 +138,17 @@ foreach(glob($moduleRoot . '*') as $modulePath)
if(file_exists($enLangFile)) include $enLangFile;
if(file_exists($configFile)) include $configFile;
}
echo '-------------demo data checking. -----------------' . "\n";
$demoSQL = file("../../db/demo.sql");
foreach($demoSQL as $line => $sql)
{
if(strpos($sql, 'INSERT') === false) continue;
if(strpos($sql, $config->db->prefix . 'config') !== false or
strpos($sql, $config->db->prefix . 'company') !== false or
strpos($sql, $config->db->prefix . 'group') !== false)
{
die('line ' . ($line + 1) . " has error\n");
}
}
-14
View File
@@ -1,14 +0,0 @@
<?php
include("../../config/my.php");
$demoSql = file("../../db/demo.sql");
$output = '';
foreach($demoSql as $sql)
{
if(strpos($sql, 'INSERT') !== false and
strpos($sql, $config->db->prefix . 'config') === false and
strpos($sql, $config->db->prefix . 'company') === false and
strpos($sql, $config->db->prefix . 'group') === false
) $output .= $sql;
}
file_put_contents("../../db/demo.sql", $output);