Ticket #863 (new defect)

Opened 5 months ago

Last modified 3 weeks ago

TTemplateManager with huge file size

Reported by: Shoeb Owned by: xue
Priority: high Milestone: 3.2
Component: Prado Framework v3 Version: 3.0
Severity: crash Keywords: TTempalteManager, Tempalte File Size
Cc:

Description

Hello,

I was working with a page extending TPage and its Template in .page file when i came across this very irritating bug in the TTempateManager.

Exception Shown: TTemplateException Description

Invalid template syntax: Closing tag '</com:TContent>' is expected.

My Template file size was 100588 bytes (as per filesize()) and in class TTempateManager under the method getTemplateByFileName, i tried to var_dump(file_get_contents($fileName)) which is used to fetch the file content from the template file BUT to my amuzement, it fetched ONLY upto a certain limit and not the complete file content including the last part that was </com:TContent> :(

It took me 3 hours to get to this point. Now, this is wat i tried to implement instead of above var_dump(file_get_contents($fileName, false, NULL, 0, filesize($fileName)))

and i got the entire the .page file content starting

<%@ Title="Legal" %> <com:TContent ID="Main"> .. .. .. </com:TContent>

The above was implement 2 places where we have file_get_content function call.

Event then, the exception is thrown.

Attachments

phpinfo.pdf (231.8 kB) - added by doublespeak 3 weeks ago.
phpinfo() details from doublespeak

Change History

Changed 2 months ago by sinnerg

I think it would be best for you to tell us what PHP version you are using.

Since it is file_get_contents() going bad, it should not be a PRADO core issue, since it is not a PRADO function.

Changed 3 weeks ago by doublespeak

phpinfo() details from doublespeak

Changed 3 weeks ago by doublespeak

Same issue here - the largest .page size I can use is 100946 bytes. When I add an extra character (bringing my .page to 100947 bytes) it complains about the missing TContent closing tag.

Running PHP Version 5.2.6 Have attached my phpinfo() to this ticket as a PDF. Hope this helps :)

Note: See TracTickets for help on using tickets.