[Mapbender-commits] r2725 - branches/spsneo_dev/build

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Jul 26 04:06:51 EDT 2008


Author: spsneo
Date: 2008-07-26 04:06:51 -0400 (Sat, 26 Jul 2008)
New Revision: 2725

Added:
   branches/spsneo_dev/build/build-checksum.php
Log:
Function to scan and create json files

Added: branches/spsneo_dev/build/build-checksum.php
===================================================================
--- branches/spsneo_dev/build/build-checksum.php	                        (rev 0)
+++ branches/spsneo_dev/build/build-checksum.php	2008-07-26 08:06:51 UTC (rev 2725)
@@ -0,0 +1,34 @@
+<?php
+
+define("ROOTDIR", "../mapbender");
+
+require_once("checksum-utils.inc");
+$dir_not_to_scan = array();
+array_push($dir_not_to_scan,".", "..", "conf", "license", "log", "resources", "update");
+
+$rootdir_path = ROOTDIR;
+//remove slash if it is there at the end of the path
+if(substr($rootdir_path, -1) == '/') {
+	$rootdir_path = substr($rootdir_path, 0 , -1);
+}
+
+if(!is_dir($rootdir_path)) {
+	echo $rootdir_path." is not a valid directory\n";
+	return FALSE;
+}
+
+if(!is_readable($rootdir_path)) {
+	echo $rootdir_path." is not readable.\nPlease make sure you have privilege to build.\nAborting...";
+	exit();
+}
+$rootdir = dir($rootdir_path);
+$rootdir_path = $rootdir->path;
+
+while(false !== ($dir_to_scan = $rootdir->read())) {
+	$dir_to_scan_path = $rootdir_path.'/'.$dir_to_scan;
+	if(is_dir($dir_to_scan_path) && !in_array($dir_to_scan, $dir_not_to_scan)) {
+		echo "Scanning directory: ".$dir_to_scan_path."\n";
+		build_checksum($dir_to_scan_path);
+		echo "All checksums and respective JSON files created for all the files and directories inside ".$dir_to_scan_path."\n\n";
+	}
+}



More information about the Mapbender_commits mailing list