Re: [fw-general] Zend_Mail exhaust memory reading multipart mail with large attachment

2010-12-04 Thread Luiz A Brandao Jr
Hello Michael,

Would you mind sharing the modifications you did to
Zend_Mail_Store_Imap and Zend_Mail_Protocol_Imap? I also need to work
with UIDs!

Thank you,

Luiz Brandao


>
> On 11 February 2010 06:03, Michael Kliewe  wrote:
>> Hello Jens,
>> exactly, I extended both Zend_Mail_Storage_Imap and Zend_Mail_Protocol_Imap
>> because I need many functions that both classes don't provide, for example I
>> work only with unique ids, not sequence numbers. So I had to change many of
>> the functions.
>> For example it is also not possible to search or sort at the moment in
>> Zend_Mail_Storage_Imap, so I had to add the missing functions.
>> Have a look at
>> http://framework.zend.com/issues/browse/ZF-8858
>> http://framework.zend.com/issues/browse/ZF-9138
>> and here I added the possibility to copy many mails with just one imap
>> command (because calling copy() 1000 times is very slow)
>> http://framework.zend.com/issues/browse/ZF-8513
>> Would be cool if someone patches this functionality into the library.
>> I used "Iloha MIME Library (IML)" for parsing the response of the
>> BODYSTRUCTURE request. Just 3 of the functions in it are needed. It is from
>> 2002, but I didn't find a better solution until now, and it is GPL.
>> Perhaps you have a better way to solve it?
>> Michael
>>
>> On Feb 11, 2010, at 1:01 AM, Jens Wabnitz wrote:
>>
>> Hello Michael,
>>
>> thanks for the hint.
>> How do you send the command to imap server?
>> Tried to do it with the Zend_Mail_Protocol_Imap Instance but failed.
>> Got the information with imap_fetchstructure() but only for the cost of
>> another connection.
>>
>> Shouldn't the Imap classes be modified to lazy load content?
>>
>> Thanks again
>> Jens
>>
>>
>> Am 10.02.2010 14:56, schrieb Michael Kliewe:
>>
>> Hi,
>> I had the same problem, and I solved it with the imap command
>> FETCH BODYSTRUCTURE
>> There you get the headers of all parts of a mail (or of specific parts if
>> you set more parameters to the request). You can also request headers of
>> many mails by one request.
>> The only "problem" is to parse that result, because it looks like
>> * 2 FETCH (BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "us-ascii") NIL NIL
>> "7BIT" 1120 1) ("TEXT" "HTML" ("charset" "us-ascii") NIL NIL
>> "QUOTED-PRINTABLE" 3874 1)
>>
>> Michael
>>
>> 
>>
>> http://www.phpgangsta.de
>>
>> On Feb 10, 2010, at 2:06 PM, Jens Wabnitz wrote:
>>
>> Hello,
>>
>> i'm building an application with mail reading
>> capabilities using Zend_Mail_Storage_Imap.
>>
>> It seems that the RecursiveIterator for Messages and even the countParts
>> Method fetch the whole content of the parts.
>> For mails with larger attachments calling these functions leads to a
>> "Fatal error: Allowed memory size of 67108864 bytes exhausted ...".
>>
>> Is there any way to get the headers of message parts without
>> fetching the content?
>>
>> Thanks in advance
>> Jens
>>
>>
>>
>>
>>
>>
>>
>


Re: [fw-general] Zend_Mail exhaust memory reading multipart mail with large attachment

2010-12-04 Thread Luiz A Brandao Jr
Hello Michael,

Would you mind sharing the modifications we did to
Zend_Mail_Store_Imap and Zend_Mail_Protocol_Imap? I also need to work
with UIDs!

Thank you,

Luiz Brandao



On 11 February 2010 06:03, Michael Kliewe  wrote:
> Hello Jens,
> exactly, I extended both Zend_Mail_Storage_Imap and Zend_Mail_Protocol_Imap
> because I need many functions that both classes don't provide, for example I
> work only with unique ids, not sequence numbers. So I had to change many of
> the functions.
> For example it is also not possible to search or sort at the moment in
> Zend_Mail_Storage_Imap, so I had to add the missing functions.
> Have a look at
> http://framework.zend.com/issues/browse/ZF-8858
> http://framework.zend.com/issues/browse/ZF-9138
> and here I added the possibility to copy many mails with just one imap
> command (because calling copy() 1000 times is very slow)
> http://framework.zend.com/issues/browse/ZF-8513
> Would be cool if someone patches this functionality into the library.
> I used "Iloha MIME Library (IML)" for parsing the response of the
> BODYSTRUCTURE request. Just 3 of the functions in it are needed. It is from
> 2002, but I didn't find a better solution until now, and it is GPL.
> Perhaps you have a better way to solve it?
> Michael
>
> On Feb 11, 2010, at 1:01 AM, Jens Wabnitz wrote:
>
> Hello Michael,
>
> thanks for the hint.
> How do you send the command to imap server?
> Tried to do it with the Zend_Mail_Protocol_Imap Instance but failed.
> Got the information with imap_fetchstructure() but only for the cost of
> another connection.
>
> Shouldn't the Imap classes be modified to lazy load content?
>
> Thanks again
> Jens
>
>
> Am 10.02.2010 14:56, schrieb Michael Kliewe:
>
> Hi,
> I had the same problem, and I solved it with the imap command
> FETCH BODYSTRUCTURE
> There you get the headers of all parts of a mail (or of specific parts if
> you set more parameters to the request). You can also request headers of
> many mails by one request.
> The only "problem" is to parse that result, because it looks like
> * 2 FETCH (BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "us-ascii") NIL NIL
> "7BIT" 1120 1) ("TEXT" "HTML" ("charset" "us-ascii") NIL NIL
> "QUOTED-PRINTABLE" 3874 1)
>
> Michael
>
> 
>
> http://www.phpgangsta.de
>
> On Feb 10, 2010, at 2:06 PM, Jens Wabnitz wrote:
>
> Hello,
>
> i'm building an application with mail reading
> capabilities using Zend_Mail_Storage_Imap.
>
> It seems that the RecursiveIterator for Messages and even the countParts
> Method fetch the whole content of the parts.
> For mails with larger attachments calling these functions leads to a
> "Fatal error: Allowed memory size of 67108864 bytes exhausted ...".
>
> Is there any way to get the headers of message parts without
> fetching the content?
>
> Thanks in advance
> Jens
>
>
>
>
>
>
>


[fw-general] Invalid XHTML attribute in Zend_Form_Element

2009-03-01 Thread Luiz A Brandao Jr
Hello,

I was trying to validate a page and verified that a Zend Form element
creates an invalid XHTML attribute "helper". Like helper="formText".
How can I prevent it from rendering? Not that I unconditionally need
my page to be valid but I'd like to.

I tried $myElement->setAttrib('helper', null); but it gives an error
when the Zend_Form_Decorator_ViewScript decorator is called.

Thank you,
Luiz Brandao


Re: [fw-general] Change output charset encoding (Zend_View output filter)

2009-02-20 Thread Luiz A Brandao Jr
It would be the simpler solution if I had access to the pop-up page
but in this case it's an external site.

On Fri, Feb 20, 2009 at 8:43 PM, Jason Webster  wrote:
> Assuming that the pop-up page is either a new browser window or
> modal-iframe-type-thing,
> you can try setting the Content-type via a meta/http-equiv tag in the head
> of the document being served:
>
> 
>
> This may be the simpler solution.
>
> On 20/02/2009 2:57 PM, Luiz A Brandao Jr wrote:
>>
>> Hello,
>>
>> I'm developing a site using UTF-8 but I have to pop-up a page that
>> seems to be using ISO-8859-1. This pop-up page doesn't set the charset
>> in its HTML headers and because of that it's not being properly
>> displayed within Firefox. It seems that Firefox is using the same
>> encoding of the parent window when rendering the pop-up page. I
>> changed the charset info in the header of the parent window to
>> ISO-8859-1 and the poped-up page was displayed fine.
>>
>> So I was wondering how can I use utf8_decode() function to convert all
>> output data? Can I set a filter to Zend_View? I need something similar
>> to the "escape" helper but I can't use it because not all layout
>> content are dynamic so I have UTF-8 text that I can't apply escape to.
>>
>> Thank you,
>> Luiz Jr
>
>


[fw-general] Change output charset encoding (Zend_View output filter)

2009-02-20 Thread Luiz A Brandao Jr
Hello,

I'm developing a site using UTF-8 but I have to pop-up a page that
seems to be using ISO-8859-1. This pop-up page doesn't set the charset
in its HTML headers and because of that it's not being properly
displayed within Firefox. It seems that Firefox is using the same
encoding of the parent window when rendering the pop-up page. I
changed the charset info in the header of the parent window to
ISO-8859-1 and the poped-up page was displayed fine.

So I was wondering how can I use utf8_decode() function to convert all
output data? Can I set a filter to Zend_View? I need something similar
to the "escape" helper but I can't use it because not all layout
content are dynamic so I have UTF-8 text that I can't apply escape to.

Thank you,
Luiz Jr


Re: [fw-general] Project Structure / Public directory

2009-01-06 Thread Luiz A Brandao Jr
My problem is like you previously described. When using plesk one usually
can't access files outside the httpdocs folder due to
open_basedirconfiguration. So I have to put all application files in
the web directory.
So if I have a guestbook application I would put all files
insidehttpdocs/guestbookand follow the standard directory structure
from there, what means that I
will have httpdocs/guestbook/public, httpdocs/guestbook/application etc

Then with the following .htaccess I would check if a request match a file in
the public folder and allow it, otherwise rewrite to index.php Just to
exemplify: if a request like
http://mysite/guestbook/images/someimage.jpgmatch a image
inhttpdocs/guestbook/public/images/someimage.jpgit will rewrite to
that image, if not, it will rewrite to
index.php

The only difference is that that index.php stays outside of the public foder.
But I'm sure this can be changed with additional rewrite rules. I think this
way we can follow the default folder structure even inside the web root
folder and organize multiple applications into their own folders. What do
you think of this aproach? Do you think the .htaccess can be improved?


RewriteEngine On
RewriteBase /myapp

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteCond %{DOCUMENT_ROOT}/myapp/public/$1 -s [OR]
RewriteCond %{DOCUMENT_ROOT}/myapp/public/$1 -l [OR]
RewriteCond %{DOCUMENT_ROOT}/myapp/public/$1 -d
RewriteRule ^(.*)$ public/$1 [NC,L]

RewriteRule ^.*$ index.php [NC,L]


On Mon, Jan 5, 2009 at 9:43 PM, Pádraic Brady wrote:

> One possible solution is setting a .htaccess file for the other root
> directories setting the "deny from all" directive to forbid access.
>
> Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
>
>
> --
> *From:* Alan Wagstaff 
> *To:* Zend Framework General 
> *Sent:* Monday, January 5, 2009 10:44:37 PM
> *Subject:* [fw-general] Project Structure / Public directory
>
> Hi all,
> In most of the ZF tutorials I have read (ZF Quickstart, Rob's one, ZF
> Book), they all recommend setting your Apache's webroot to your
> /zfapp/public/ directory for security reasons.
>
> I can understand the logic, putting the application / library directory
> outside of the webroot is a good thing but I'm thinking ahead to
> distribution and struggling to understand.  Take for example, vBulletin - a
> popular forum software.  When you download vBulletin, you unzip it, grab the
> /forum directory and dump it in your webroot.  Then visit
> http://www.example.com/forum and there's your forum.  You could also put
> it in /community/forum and it would work just as well.
>
> I don't really understand how I could do that with ZF using the recommend
> project structure.  How would I go about setting up my project structure /
> .htaccess so the end user could put my app in whatever sub-folder they
> wanted on their website, and not just in the webroot?
>
> Thanks in advance :)
>
> Alan.
>
>


[fw-general] Zend_Http_Client vs cURL

2008-12-21 Thread Luiz A Brandao Jr
Hello,

What's the reason to use Zend_Http_Client over the cURL extension?
Do you know how Zend_Http_Client performs comparatively to curl?

Thank you,

Luiz