[Fusionforge-commits] r14670 - trunk/src/common/include

Alain Peyrat aljeux at fusionforge.org
Sun Oct 16 21:59:28 CEST 2011


Author: aljeux
Date: 2011-10-16 21:59:28 +0200 (Sun, 16 Oct 2011)
New Revision: 14670

Modified:
   trunk/src/common/include/DatabaseInstaller.class.php
Log:
minor syntax change

Modified: trunk/src/common/include/DatabaseInstaller.class.php
===================================================================
--- trunk/src/common/include/DatabaseInstaller.class.php	2011-10-16 19:59:22 UTC (rev 14669)
+++ trunk/src/common/include/DatabaseInstaller.class.php	2011-10-16 19:59:28 UTC (rev 14670)
@@ -37,7 +37,7 @@
 
 		$init = "$path/$name-init.sql";
 		if (is_file($init)) {
-			$ret = $this->runScript($init);
+			$ret = $this->_runScript($init);
 			if (!$ret) {
 				return false;
 			}
@@ -62,7 +62,7 @@
 			$date   = $this->getDatabaseDate();
 		}
 
-		$scripts = $this->getScripts($path);
+		$scripts = $this->_getScripts($path);
 		$output  = '';
 		foreach ($scripts as $script) {
 			if ((int) $script['date'] > $date) {
@@ -103,7 +103,7 @@
 		return false;
 	}
 
-	private function runScript($file) {
+	private function _runScript($file) {
 		// If a condition statement if found, then run the script only if true.
 		$content = file($file);
 		if (preg_match('/^-- TRUE\? (.+)/', $content[0], $match)) {
@@ -124,7 +124,7 @@
 		return true;
 	}
 
-	private static function getScripts($dir) {
+	private static function _getScripts($dir) {
 		$data = array();
 		if (is_dir($dir)) {
 			if ($dh = opendir($dir)) {
@@ -144,13 +144,13 @@
 				}
 				closedir($dh);
 			}
-			usort($data, array('DatabaseInstaller', 'compare_scripts'));
+			usort($data, array('DatabaseInstaller', '_compare_scripts'));
 			reset($data);
 		}
 		return $data;
 	}
 
-	private static function compare_scripts($script1, $script2) {
-		return strcmp($script1['filename'], $script2['filename']);
+	private static function _compare_scripts($a, $b) {
+		return strcmp($a['filename'], $b['filename']);
 	}
 }




More information about the Fusionforge-commits mailing list