settings_find.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: settings_find.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.4 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Functions scanner
- // +-------------------------------------------------------------+
- error_reporting(E_ALL & ~E_NOTICE);
- include("./global.php");
- developer_check();
- admin_header('Server Information', 'Functions Scan');
- function find_settings($dirname) {
- global $setting_names, $settings_location;
- $dir = opendir($dirname);
- while ($file = readdir($dir)) {
- if (is_dir($dirname . $file) AND $file != '.' AND $file != '..' AND $file != 'CVS') {
- find_settings($dirname . $file . '/');
- }
-
- if (strstr($file, ".php") OR strstr($file, ".txt") OR strstr($file, ".html")) {
-
- $file = $dirname . $file;
- $fp = fopen($file, "r");
- $contents = fread($fp, filesize($file));
- fclose($fp);
- preg_match_all('|$settings['?([^']]*)'?]|', $contents, $matches);
-
- $setting_names = array_merge($setting_names, $matches[1]);
- $settings_location[] = array($file, $matches[1]);
- }
- }
- }
- find_settings("./../");
- $setting_names = array_unique($setting_names);
- // lets find names that are not in the database
- $db->query("SELECT settings FROM settings");
- while ($result = $db->row_array()) {
- if (!in_array($result[settings], $setting_names)) {
- echo "<b>$result[settings]</b> is in the database but is not found in the code</br>";
- }
- $database_settings[] = $result[settings];
- }
- echo "<br /><hr><br />";
- foreach ($setting_names AS $key => $var) {
- if (!in_array($var, $database_settings)) {
- echo "<b>$var</b> is in the code but is not found in the database</br>";
- }
- }
- echo "<br /><hr><br />";
- echo "<b>Debug code to find the location of an orphan setting</b>";
- print_rr($settings_location);
- ?>