Ticket #863 (new defect)
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.
