[pLog-svn] r6457 - plog/trunk/class/gallery/dao (fwd)

Jon Daley plogworld at jon.limedaley.com
Wed Mar 4 13:35:27 EST 2009


 	Seeing no response, I ignored the wizard fix, and backported the 
change to the 1.2 tree.

On Thu, 25 Sep 2008, Jon Daley wrote:

> 	Just going through old emails.  (starting to get back to having time 
> again...)  I don't think this was ever answered?
>
> On Tue, 1 Jul 2008, Jon Daley wrote:
>
>> 	Ok, good.  Do you want to do that?  I think I know what the problem 
>> is, so I know how to fix it, but you have dealt with this problem, so 
>> probably know how to check it better?  ie. do we need to go from 1.0 to 1.1 
>> to 1.2 in order to test the bug?
>>
>> 	Maybe 1.1 isn't "important" in that upgrade path, ie. the 1.1 wizard 
>> isn't broken, but just that in 1.0 we allowed uppercase extensions, and in 
>> 1.1 we didn't?
>>
>> 	So, the fix is to port revision 6457 to the 1.2 branch to help anyone 
>> who already upgraded to 1.2, and then we fix the 1.2 wizard to help any 
>> folks that haven't upgraded yet?  Is that what you are thinking too?
>> 
>> On Tue, 1 Jul 2008, Mark Wu wrote:
>> 
>>> Now I see what you said .
>>> 
>>> Yes, if possible, we should fix the upgrade wizard for this.
>>> 
>>> Mark
>>> 
>>> 
>>>> -----Original Message-----
>>>> From: plog-svn-bounces at devel.lifetype.net
>>>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
>>>> Sent: Tuesday, July 01, 2008 8:42 PM
>>>> To: LifeType Developer List
>>>> Subject: Re: [pLog-svn] r6457 - plog/trunk/class/gallery/dao (fwd)
>>>>
>>>>  	But, isn't the problem that the wizard is already
>>>> renaming the files, but it is renaming them inappropriately?
>>>> It sounds like you are saying that it might take too long to
>>>> go through and rename all of the files?
>>>>  	I think the fix is fine for people who already upgraded
>>>> to 1.2, but for those people who haven't yet - and I suspect
>>>> there are really a lot of people who haven't upgraded, we
>>>> should have the wizard do the right thing, and avoid the
>>>> extra check on every resource access?
>>>> 
>>>> 
>>>> On Tue, 1 Jul 2008, Mark Wu wrote:
>>>> 
>>>>> I am not sure, maybe.
>>>>> 
>>>>> For a small site, running a wizard to change the name might
>>>> possible,
>>>>> for a big site, ...  I don't think it is a good idea, but
>>>> it still possible.
>>>>> 
>>>>> I prefer to keep it simple.
>>>>> 
>>>>> Mark
>>>>> 
>>>>>> -----Original Message-----
>>>>>> From: plog-svn-bounces at devel.lifetype.net
>>>>>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
>>>>>> Sent: Tuesday, July 01, 2008 2:00 AM
>>>>>> To: LifeType SVN
>>>>>> Subject: Re: [pLog-svn] r6457 - plog/trunk/class/gallery/dao (fwd)
>>>>>>
>>>>>>  	Any answer?
>>>>>> 
>>>>>> ---------- Forwarded message ----------
>>>>>> Date: Wed, 14 May 2008 12:27:37 -0400 (EDT)
>>>>>> From: Jon Daley <plogworld at jon.limedaley.com>
>>>>>>
>>>>>>  	Ah, I think I get it now.  So, the 1.2 wizard isn't
>>>> creating the
>>>>>> filenames correctly, is that it?  And so it should be changed to
>>>>>> rename the resources appropriately?
>>>>>> 
>>>>>> On Wed, 14 May 2008, Jon Daley wrote:
>>>>>>
>>>>>>> 	Can you check it into 1.2 then?  You should probably
>>>>>> check the bug
>>>>>>> reports where people said it was fixed, to make sure that
>>>>>> it doesn't
>>>>>>> break anything for them.  I am not sure why different people are
>>>>>>> experiencing different behavior.
>>>>>>> 
>>>>>>> On Wed, 14 May 2008, Mark Wu wrote:
>>>>>>> 
>>>>>>>> Actually, it is bug of 1.2 :(
>>>>>>>> 
>>>>>>>> This fix only for those who upgrade from lifetype 1.0.x
>>>>>>>> 
>>>>>>>> For upper case file and lower case file exist at the same system.
>>>>>>>> 
>>>>>>>> So, we have to use File::isReadable() to see if the file
>>>> exist, if
>>>>>>>> not, then use another way ...
>>>>>>>> 
>>>>>>>> Mark
>>>>>>>> 
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: plog-svn-bounces at devel.lifetype.net
>>>>>>>>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of
>>>>>> Jon Daley
>>>>>>>>> Sent: Wednesday, May 14, 2008 7:24 PM
>>>>>>>>> To: LifeType Developer List
>>>>>>>>> Subject: Re: [pLog-svn] r6457 - plog/trunk/class/gallery/dao
>>>>>>>>>
>>>>>>>>>  	I don't understand this change, and if it is a
>>>> bug in 1.2,
>>>>>>>>> shouldn't we fix it there?  I thought I fixed all of the
>>>>>> extension
>>>>>>>>> issues in 1.2.  At least the folks who complained about
>>>>>> it are now
>>>>>>>>> happy?
>>>>>>>>> 
>>>>>>>>> On Wed, 14 May 2008, mark at devel.lifetype.net wrote:
>>>>>>>>> 
>>>>>>>>>> Author: mark
>>>>>>>>>> Date: 2008-05-14 03:03:21 -0400 (Wed, 14 May 2008) New
>>>>>>>>> Revision: 6457
>>>>>>>>>> 
>>>>>>>>>> Modified:
>>>>>>>>>>   plog/trunk/class/gallery/dao/galleryresource.class.php
>>>>>>>>>> Log:
>>>>>>>>>> Fixed the lower/upper case error of original file  name
>>>>>> extension.
>>>>>>>>>> 
>>>>>>>>>> Before 1.1, we used original file extension without any
>>>>>>>>> modification. After 1.1, we convert all the extension to
>>>>>> lower case.
>>>>>>>>>> 
>>>>>>>>>> So, if user upgrade from 1.0->1.1->1.2, they will get
>>>>>>>>> problems about those old files.
>>>>>>>>>> 
>>>>>>>>>> The best way to solve the problem is use File::isReadable
>>>>>>>>> to check file exist or not, if the file does not exist,
>>>>>> we use the
>>>>>>>>> old way to get the file.
>>>>>>>>>> 
>>>>>>>>>> Todo: Maybe we can add a system image "lost.jpg", so we
>>>>>>>>> just return the lost.jpg if both files not exist.
>>>>>>>>>> 
>>>>>>>>>> Modified:
>>>> plog/trunk/class/gallery/dao/galleryresource.class.php
>>>>>>>>>> 
>>>>>> ===================================================================
>>>>>>>>>> --- plog/trunk/class/gallery/dao/galleryresource.class.php
>>>>>>>>> 2008-05-14 06:58:19 UTC (rev 6456)
>>>>>>>>>> +++ plog/trunk/class/gallery/dao/galleryresource.class.php
>>>>>>>>> 2008-05-14 07:03:21 UTC (rev 6457)
>>>>>>>>>> @@ -201,11 +201,15 @@
>>>>>>>>>> 		/**
>>>>>>>>>> 		 * @return the encoded name of the file in disk
>>>>>>>>>> 		 */
>>>>>>>>>> -        function getEncodedFileName()
>>>>>>>>>> +        function getEncodedFileName( $encodeExtension = true )
>>>>>>>>>>         {
>>>>>>>>>>             $fileParts = explode( ".", $this->_fileName );
>>>>>>>>>> -            $fileExt =
>>>>>> strtolower($fileParts[count($fileParts)-1]);
>>>>>>>>>> -            $encodedFileName =
>>>>>>>>> $this->getOwnerId()."-".$this->getId().".".$fileExt;
>>>>>>>>>> +			if( $encodeExtension )
>>>>>>>>>> +				$fileExt =
>>>>>>>>> strtolower($fileParts[count($fileParts)-1]);
>>>>>>>>>> +			else
>>>>>>>>>> +				$fileExt =
>>>>>>>>> $fileParts[count($fileParts)-1];
>>>>>>>>>> +
>>>>>>>>>> +			$encodedFileName =
>>>>>>>>>> +$this->getOwnerId()."-".$this->getId().".".$fileExt;
>>>>>>>>>>         	return $encodedFileName;
>>>>>>>>>>         }
>>>>>>>>>> 
>>>>>>>>>> @@ -465,13 +469,17 @@
>>>>>>>>>> 		 */
>>>>>>>>>> 		function getOriginalSizeFileName()
>>>>>>>>>> 		{
>>>>>>>>>> -
>>>>>>>>>> -
>>>>>>>>>> 			$config =& Config::getConfig();
>>>>>>>>>>
>>>>>>>>>> 			// encoding the filename if
>>>>>>>>> "encoded_file_name" enabled
>>>>>>>>>> 			if( $config->getValue(
>>>>>>>>> "resources_naming_rule" ) ==
>>>>>>>>>> "encoded_file_name" )
>>>>>>>>>> +			{
>>>>>>>>>> +				$storage = new
>>>>>> GalleryResourceStorage();
>>>>>>>>>> +				$filePath =
>>>>>>>>> $storage->getUserFolder( $this->getOwnerId() );
>>>>>>>>>> 				$fileName =
>>>> $this->getEncodedFileName();
>>>>>>>>>> +				if( !File::isReadable(
>>>>>>>>> $filePath.$fileName ) )
>>>>>>>>>> +					$fileName =
>>>>>>>>> $this->getEncodedFileName( false );
>>>>>>>>>> +			}
>>>>>>>>>> 			else
>>>>>>>>>> 				$fileName =
>>>> $this->getFileName();
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> _______________________________________________
>>>>>>>>>> pLog-svn mailing list
>>>>>>>>>> pLog-svn at devel.lifetype.net
>>>>>>>>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> Jon Daley
>>>>>>>>> http://jon.limedaley.com/
>>>>>>>>> 
>>>>>>>>> The colder the X-ray table, the more of your body is
>>>>>> required on it.
>>>>>>>>> _______________________________________________
>>>>>>>>> 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/
>>>>>>> 
>>>>>>> If anything just cannot go wrong, it will anyway.
>>>>>>> -- Murphy's Fifth Law
>>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Jon Daley
>>>>>> http://jon.limedaley.com/
>>>>>> 
>>>>>> If it jams, force it.  If it breaks, it needed replacing anyway.
>>>>>> -- Lowery's Law
>>>>>> _______________________________________________
>>>>>> 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
>>>>> 
>>>>> _______________________________________________
>>>>> pLog-svn mailing list
>>>>> pLog-svn at devel.lifetype.net
>>>>> http://limedaley.com/mailman/listinfo/plog-svn
>>>>> 
>>>> 
>>>> --
>>>> Jon Daley
>>>> http://jon.limedaley.com
>>>> ~~
>>>> Every 18 months, the speed of software halves.
>>>> -- Gates' Law
>>>> _______________________________________________
>>>> 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
~~
Enter any 11-digit prime number to continue.


More information about the pLog-svn mailing list