From 4cef8e0281ade9be98a64b8b7b4b2689393b6094 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Wed, 9 Jan 2013 01:06:49 +0000 Subject: [PATCH] * merge checkDemoData.php to check.php. --- bin/build/check.php | 14 ++++++++++++++ bin/build/checkDemoData.php | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) delete mode 100755 bin/build/checkDemoData.php diff --git a/bin/build/check.php b/bin/build/check.php index b4d7c30057..7c9b9155dc 100755 --- a/bin/build/check.php +++ b/bin/build/check.php @@ -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"); + } +} diff --git a/bin/build/checkDemoData.php b/bin/build/checkDemoData.php deleted file mode 100755 index 3a1548d926..0000000000 --- a/bin/build/checkDemoData.php +++ /dev/null @@ -1,14 +0,0 @@ -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); -