[pLog-svn] r6145 - plog/trunk/class/config

Jon Daley plogworld at jon.limedaley.com
Fri Jan 4 09:55:18 EST 2008


That's fine.  Can you do that in 1.2 also, to keep everything in sync?

On Fri, 4 Jan 2008, Mark Wu wrote:

> Hi Jon:
>
> For keep the configFileStorage and configDbStorage work in the same
> behavior, I use the old code, but replace "==" to  "===".
>
> I think it can allowed "false" and "0" works in configdb and configfile ...
>
> And, we also can set the default value when the config variable is "" or
> "null".
>
> Mark
>
>> -----Original Message-----
>> From: plog-svn-bounces at devel.lifetype.net
>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of
>> mark at devel.lifetype.net
>> Sent: Friday, January 04, 2008 5:49 PM
>> To: plog-svn at devel.lifetype.net
>> Subject: [pLog-svn] r6145 - plog/trunk/class/config
>>
>> Author: mark
>> Date: 2008-01-04 04:49:24 -0500 (Fri, 04 Jan 2008) New Revision: 6145
>>
>> Modified:
>>    plog/trunk/class/config/configdbstorage.class.php
>>    plog/trunk/class/config/configfilestorage.class.php
>> Log:
>> I prefer keep the configdbstorage and configfilestorage
>> follow the same rule. So, the "" and "null" does not allowed
>> in getValue(), but "false" and "0" does allowed in getValue().
>>
>> Modified: plog/trunk/class/config/configdbstorage.class.php
>> ===================================================================
>> --- plog/trunk/class/config/configdbstorage.class.php
>> 2008-01-03 11:43:52 UTC (rev 6144)
>> +++ plog/trunk/class/config/configdbstorage.class.php
>> 2008-01-04 09:49:24 UTC (rev 6145)
>> @@ -131,7 +131,7 @@
>>          function getValue( $key, $defaultValue = null )
>>          {
>>              if( array_key_exists($key, $this->_data) ) {
>> -                if ($this->_data[$key] == "" ||
>> $this->_data[$key] == null) {
>> +                if ($this->_data[$key] === "" ||
>> $this->_data[$key] ===
>> + null) {
>>                      return $defaultValue;
>>                  } else {
>>                      return $this->_data[$key];
>>
>> Modified: plog/trunk/class/config/configfilestorage.class.php
>> ===================================================================
>> --- plog/trunk/class/config/configfilestorage.class.php
>> 2008-01-03 11:43:52 UTC (rev 6144)
>> +++ plog/trunk/class/config/configfilestorage.class.php
>> 2008-01-04 09:49:24 UTC (rev 6145)
>> @@ -247,7 +247,7 @@
>>          function getValue( $key, $defaultValue = null )
>>          {
>>          	$value = $this->_props->getValue( $key );
>> -            if( $value == "" || $value == null )
>> +            if( $value === "" || $value === null )
>>              	if(isset($defaultValue))
>>                  	$value = $defaultValue;
>>
>>
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://limedaley.com/mailman/listinfo/plog-svn
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>

-- 
Jon Daley
http://jon.limedaley.com/

To understand recursion, you must first understand recursion.


More information about the pLog-svn mailing list