getMethods(); foreach($methods as $method) { $methodRef = new ReflectionMethod($method->class, $method->name); if($methodRef->isPublic() and strpos($method->name, '__') === false) { $methodName = $method->name; if(in_array($moduleName . '-' . strtolower($method->name), $whiteList)) continue; $exits = false; foreach($lang->resource->$moduleName as $key => $label) { if(strtolower($methodName) == strtolower($key)) $exits = true; } if(!$exits) echo $moduleName . "\t" . $methodName . " not in the list. \n"; } } } } } /* checking actions of every module. */ echo '-------------lang checking-----------------' . "\n"; include '../config/config.php'; foreach(glob($moduleRoot . '*') as $modulePath) { unset($lang); $moduleName = basename($modulePath); $mainLangFile = $modulePath . '/lang/zh-cn.php'; if(!file_exists($mainLangFile)) continue; $mainLines = file($mainLangFile); foreach($config->langs as $langKey => $langName) { if($langKey == 'zh-cn' or $langKey == 'zh-tw') continue; $langFile = $modulePath . '/lang/' . $langKey . '.php'; if(!file_exists($langFile)) continue; $lines = file($langFile); foreach($mainLines as $lineNO => $line) { if(strpos($line, '$lang') === false) { //if($line != $lines[$lineNO]) echo $moduleName . ' ' . $langKey . ' ' . $lineNO . "\n"; } else { list($mainKey, $mainValue) = explode('=', $line); list($key, $value) = explode('=', $lines[$lineNO]); if(trim($mainKey) != trim($key)) { $key = trim($key); $lineNO = $lineNO + 1; echo "module $moduleName need checking, command is:"; echo " vim -O +$lineNO ../module/$moduleName/lang/zh-cn.php +$lineNO ../module/$moduleName/lang/en.php \n"; break; } } } } } ?>