* merge checkDemoData.php to check.php.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user