⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 settings_find.php

📁 jsp程序开发系统
💻 PHP
字号:
<?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);

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -