Forums / Developer / [eztararchivehandler.php] Limit of 99 in $v_stored_filename

[eztararchivehandler.php] Limit of 99 in $v_stored_filename

Author Message

Sébastien Morel

Friday 27 July 2007 9:16:37 am

Hi,

Why does this limit exist ?

For a script I have to compress several images from eZ and very often the length of the filename is too long.

I must hack the lib or I have another way ?

Thanks

Séb

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Ekkehard Dörre

Friday 27 July 2007 9:58:15 am

Hi Sébastien,

there is this enhancement

http://issues.ez.no/IssueView.php?Id=9651&activeItem=1

from last year, but not resolved.

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Sébastien Morel

Friday 27 July 2007 1:09:23 pm

Ok, great but anyone knows why 99 ?

I don't believe it's a random value ? Why it's not in a setting configuration file ?

Thanks for your help ;)

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Tobias Struckmeier

Saturday 28 July 2007 2:00:43 pm

Hi Sebastien,

I had the same problem when I worked on the newsletter setup package.
The reason that it is 99 Chars is simply because the tar format does not support more. I guess it was defined somewhere in the past. The fact that you can compress also deeper structures in most systems is the fact that GNU/Tar and the Unix Tar have implemented proprietary extensions to bypass this limitation (two different of course ;) ).
As far as I could research, the implementation in eZ Publish was build compatible to the tar spec. There also had been some patches a long time ago (AFAIKR from Björn Dieding) that have been aimed to allow more characters. But they don't seem to work.

Because the code for that is quite complex and a new eZ Publish version is currently made which which will enable all to use the eZ components (ezcArchive doesn't have this limitation) it was decided to focus the resources on the new version instead fixing this shortcoming.

Anyway, you see the newsletter is working. So here is how I did it.

Because I didn't wanted to add another archive format (find one matching the requirements, licensing issues, and so on...) I decided to flatten the directory structure by a simple trick.
I created a class (eZMatryoshka - funny name heh? ;) ) that utilize an ini file to move the files in the archive to a "higher" location and during installation I move it back where it belongs.
Means I have a file or directory in

ezextension/extension/eznewsletter/design/somewhere/deep/in/the/tree/are/some/templates/waiting/for/inclusion/

which I simply move to:

ezextension/extension/eznewsletter/inclusion/

It would be better to have a ezmatryoshka directory there though. ;)

It was quickly written and could be finetuned I think, but you could give it a try, it should be working for you as well. You can find it in the eznewsletter_site package.

Remember that you have to change the file listing in "package.ezpkg/ezextension/extension-YOUREXTENSIONNAME.xml" in accordance or package the extension after you have applied the "matryoschka transforming".

Hope that helps you further a bit.

[info] Matryoshka as class name i used in the meaning of the russian matryoshka dolls http://en.wikipedia.org/wiki/Matryoshka