For Programmers: Free Programming Magazines  


Home > Archive > PHP PEAR Questions and Answers > July 2005 > Re: [PEAR-BUG] Bug #4896 [Opn->Fbk]: Error if template file is empty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR-BUG] Bug #4896 [Opn->Fbk]: Error if template file is empty
Matthew Fonda

2005-07-24, 8:33 pm

PEAR Bug Database wrote:

>ATTENTION! Do NOT reply to this email!
>To reply, use the web interface found at
>http://pear.php.net/bugs/bug.php?id=4896&edit=2
>
>
> ID: 4896
> Updated by: borz_off@cs.msu.su
> Reported By: mfonda at php dot net
>-Status: Open
>+Status: Feedback
> Type: Bug
> Package: HTML_Template_Sigma
> Operating System: Linux
> PHP Version: 5.1.0
> New Comment:
>
>While this is indeed trivial to fix, what exactly is the point of
>loading a zero-length "template"?
>
>

There is no real point in loading a zero-length template, I just
encounter the problem while setting up stuff, I had just not added any
body to my template yet. Although it may not happen often, sometimes for
one reason or another there is no body in a template, and there
shouldn't be an error if there is. This would be a one line fix, I don't
see the harm in fixing something that causes a warning.

-- Matthew

>
>Previous Comments:
>------------------------------------------------------------------------
>
>[2005-07-23 00:58:21] mfonda at php dot net
>
>Description:
>------------
>If an empty template file gets loaded, the following error will be
>produced:
>
>
>Warning: fread() [function.fread]: Length parameter must be greater
>than 0 in /usr/local/lib/php/HTML/Template/Sigma.php on line 1190
>
>Should be a simple fix :-)
>
>Test script:
>---------------
><?php
>
>$template = new HTML_Template_Sigma();
>
>$template->loadTemplateFile('some_empty.tpl');
>
>?>
>
>Expected result:
>----------------
>No error, template file loads fine
>
>Actual result:
>--------------
>Warning: fread() [function.fread]: Length parameter must be greater
>than 0 in /usr/local/lib/php/HTML/Template/Sigma.php on line 1190
>
>------------------------------------------------------------------------
>
>
>
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com