Kan veel beter, maar om even snel te kijken wat afhankelijk is van een script.

echo '<pre>';
render_project("index.php", '../', "fckeditor");
echo '</pre>';
function render_project($start, $path, $not=null){
	$start = $path . $start;
	if (file_exists($start)) {
		$file = file($start);
		foreach ($file as $row){
			$i++;
			$test = strpos($row, "include");
			$ok = ($not && strpos($row, $not))?false:true;
			if ($ok && ($test||($test===0))) {
				if (preg_match('%(?:\'+[A-Z0-9/._]+.)%i', $row, $regs)||
				   preg_match('%(?:\"+[A-Z0-9/._]+.)%i', $row, $regs)) {
					$result = substr($regs[0],1,strlen($regs[0])-2);
					$t = strpos($result, '.');
					if ($t>0||$t===0) {
						if (file_exists($path.$result)) {
							echo str_pad( $i, 4, "0", STR_PAD_LEFT). ' : '. $start . ' : ' .$result . PHP_EOL;
							render_project($result, $path, $not);
						} else {
							echo str_pad( $i, 4, "0", STR_PAD_LEFT). ' : '. $start . ' : ' .$result .' ->not found: ' . PHP_EOL;
						}
					}
				}
			}
		}
	}
}


Als resultaat komt er dan iets als:
0005 : ../index.php : system/config.pro.php
0059 : ../index.php : include/classes/html_base_classes.php
0002 : ../include/classes/html_base_classes.php : sgml_base_class.php ->not found:
0060 : ../index.php : include/classes/html_pro_classes.php
0061 : ../index.php : include/functions/functions.php
0123 : ../include/functions/functions.php : ../page.tpl ->not found:

Waarbij gelijk duidelijk is wat niet gevonden word.

Misschien te simpel, maar voor mij voorlopig goed genoeg.

Groet Cees

Reageren