[TYPO3-core] RFC #3977: Bugfix: Permissions not set on extracted localization-files

Christian Kuhn lolli at schwarzbu.ch
Sat Apr 24 16:29:19 CEST 2010


Hey,

Lars Houmark wrote:
> Problem: When updating translations from TER in the EM, the unzipped 
> files is not chmod'ed correctly, which can lead into problems, when they 
> later need to be replaced if the language file is updated.
> 
> Solution: Improve t3lib::fixPermissions with an extra parameter, that 
> makes it fix permissions recursively.

Attached _v5 and _v5_test:

- fixPermissions() now returns a result (TRUE on win)
- fixPermissions() checks for allowed path
- fixPermissions() accepts a trailing slash for directories
- fixPermissions() closes handles
- fixPermissions() and mkdir() are now covered by unit tests
- the em_index change doesn't add a trailing slash to l10n directory
- the diff does not include cgl changes on unrelated things

I know the unit tests are a bit longish, but I tried to feed the methods 
with nearly every edge case that came to my mind.

+1 on reading and testing ;)

@Jigal: I like spl iterators, but I think it's too much overhead in this 
case and doesn't make the code more readable. I played a bit with glob() 
instead, but didn't came up with a pattern for all cases. So readdir() 
is imho a straight and clean solution here.

Regards
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3977_v5.diff
Type: text/x-patch
Size: 5035 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100424/6734743d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3977_v5_test.diff
Type: text/x-patch
Size: 12575 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100424/6734743d/attachment-0001.bin>


More information about the TYPO3-team-core mailing list