[pLog-svn] r582 - plog/trunk/class/config
oscar at devel.plogworld.net
oscar at devel.plogworld.net
Mon Dec 27 13:39:05 GMT 2004
Author: oscar
Date: 2004-12-27 13:39:05 +0000 (Mon, 27 Dec 2004)
New Revision: 582
Modified:
plog/trunk/class/config/configfilestorage.class.php
Log:
ConfigFileStorage::saveValue wasn't able to save into fields that had no value, such as ""
Modified: plog/trunk/class/config/configfilestorage.class.php
===================================================================
--- plog/trunk/class/config/configfilestorage.class.php 2004-12-27 13:27:15 UTC (rev 581)
+++ plog/trunk/class/config/configfilestorage.class.php 2004-12-27 13:39:05 UTC (rev 582)
@@ -162,27 +162,21 @@
// depending if it's a string or not, we need a different regexp and a
// expression that will replace the original
- //if( is_string($value)) {
if( $this->_getType( $value ) == TYPE_STRING ) {
- $regexp = "/ *\\\$config\[\"$name\"\] *= *\"(.+)\"; */";
+ $regexp = "/ *\\\$config\[\"$name\"\] *= *\"(.*)\"; */";
$replaceWith = "\$config[\"$name\"] = $valueString;";
}
else {
- $regexp = "/ *\\\$config\[\"$name\"\] *= *(.+); */";
+ $regexp = "/ *\\\$config\[\"$name\"\] *= *(.*); */";
$replaceWith = "\$config[\"$name\"] = $valueString;";
}
- //print("regexp:".$regexp."<br/>");
- //print("regexp: $regexp<br/>replaceWith: $replaceWith<br/><br/>");
while( $i < count($contents)) {
$line = $contents[$i];
$newline = preg_replace($regexp, $replaceWith, $line );
- /*if($line!=$newline)
- print("<b>replacement: ".$newline."</b><br/>");*/
$i++;
- //$result[$i] = $newline;
// for some reason, looks like we're getting some garbage in the end
// of the file... couldn't find any better way to do it
@@ -192,13 +186,10 @@
}
else {
array_push( $result, "?>");
- //print("<h1>end!!!!</h1>");
break;
}
}
- //print_r($result);
-
// the only thing we have to do know is save the contents of $result
// to the output file
$f->writeLines( $result );
More information about the pLog-svn
mailing list