[Openfirst-cvscommit] base/config install.php,1.5,1.6
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-22 22:44:37
|
Update of /cvsroot/openfirst/base/config In directory sc8-pr-cvs1:/tmp/cvs-serv16361 Modified Files: install.php Log Message: Fix indenting problems and other miscellaneous issues. Index: install.php =================================================================== RCS file: /cvsroot/openfirst/base/config/install.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** install.php 22 Jun 2003 17:30:20 -0000 1.5 --- install.php 22 Jun 2003 22:44:34 -0000 1.6 *************** *** 45,65 **** if(function_exists("glob")) { ! foreach (glob("../*/setup/*.mysql") as $filename) { $sqlf = str_replace(".", "-", str_replace(".mysql", "",substr(strrchr($filename, "/"), 1))); $dir = str_replace(".", "-", str_replace(".mysql", "", substr(strchr($filename, "/"), 1))); echo("<br /> <input type='checkbox' name='$dir'>$sqlf - $dir</input>"); ! if($_POST[$dir] == "on") { // This doesn't quite work. I'm not sure why. $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { ! if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = mysql_query(trim($line)); ! } } echo(" - <b>Submitted, and added.</b>"); fclose($sf); } ! } } else { chdir(".."); --- 45,65 ---- if(function_exists("glob")) { ! foreach (glob("../../*/setup/*.mysql") as $filename) { $sqlf = str_replace(".", "-", str_replace(".mysql", "",substr(strrchr($filename, "/"), 1))); $dir = str_replace(".", "-", str_replace(".mysql", "", substr(strchr($filename, "/"), 1))); echo("<br /> <input type='checkbox' name='$dir'>$sqlf - $dir</input>"); ! if(isset($_POST[$dir]) == true && $_POST[$dir] == "on") { // This doesn't quite work. I'm not sure why. $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { ! if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = mysql_query(trim($line)); ! } } echo(" - <b>Submitted, and added.</b>"); fclose($sf); } ! } } else { chdir(".."); *************** *** 67,100 **** while ($file = readdir($handle)){ if(is_dir("$file") && $file != "." && $file != "..") { ! $handl=@opendir(getcwd() . "/$file/setup/"); while ($fil = @readdir($handl)){ if($fil != ".." && $fil != "." && $fil != "") { ! $filename = "../$file/setup/$fil"; ! ! ! $sqlf = str_replace(".", "-", str_replace(".mysql", "",substr(strrchr($filename, "/"), 1))); ! $dir = str_replace(".", "-", str_replace(".mysql", "", substr(strchr($filename, "/"), 1))); ! echo("<br /> <input type='checkbox' name='$dir'>$sqlf - $dir</input>"); ! if($_POST[$dir] == "on") { ! $filename = "$file/setup/$fil"; ! $sf = fopen($filename, "r"); ! $query = ""; ! while($line = fgets($sf, 4096)) { ! if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = mysql_query(trim($line)); ! } } ! echo(" - <b>Submitted, and added.</b>"); ! fclose($sf); ! $filename = "../$file/setup/$fil"; ! }} ! }} } ! ?> <br /><input type="submit" value="Create Tables" /> </form> ! <?php } } else { showlogin(); } --- 67,100 ---- while ($file = readdir($handle)){ if(is_dir("$file") && $file != "." && $file != "..") { ! $handl=@opendir(getcwd() . "/$file/setup/"); while ($fil = @readdir($handl)){ if($fil != ".." && $fil != "." && $fil != "") { ! $filename = "../$file/setup/$fil"; ! $sqlf = str_replace(".", "-", str_replace(".mysql", "",substr(strrchr($filename, "/"), 1))); ! $dir = str_replace(".", "-", str_replace(".mysql", "", substr(strchr($filename, "/"), 1))); ! echo("<br /> <input type='checkbox' name='$dir'>$sqlf - $dir</input>"); ! if($_POST[$dir] == "on") { ! $filename = "$file/setup/$fil"; ! $sf = fopen($filename, "r"); ! $query = ""; ! while($line = fgets($sf, 4096)) { ! if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = mysql_query(trim($line)); ! } ! } ! echo(" - <b>Submitted, and added.</b>"); ! fclose($sf); ! $filename = "../$file/setup/$fil"; ! } ! } } ! } } ! } ?> <br /><input type="submit" value="Create Tables" /> </form> ! <?php } else { showlogin(); } |