Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Parse error, unexpected $end in \www\setup.php

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
iu2456
Smarty n00b


Joined: 12 Jun 2003
Posts: 1

PostPosted: Thu Jun 12, 2003 2:58 pm    Post subject: Parse error, unexpected $end in \www\setup.php Reply with quote

I'm running smarty with PHP 4.3 in Windows 2000 server, but when run a page I get this:
Code:
Parse error: parse error, unexpected $end in C:\www\setup.php on line 21

Does anyone know of a better way?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Jun 13, 2003 12:29 am    Post subject: Reply with quote

what is your question? You have a syntax error in your code.
Back to top
View user's profile Send private message
ZeroFill
Smarty Rookie


Joined: 31 Aug 2003
Posts: 28

PostPosted: Sun Nov 16, 2003 9:29 am    Post subject: Reply with quote

I have the same problem and it started with 2.6.0-RC3 (works fine if i copy 2.5.0's files back to the dir). the problem is that i have a block that starts in header.tpl and ends in footer.tpl. since it's an "optional" block plugin (only appears if i add ?timeblock=1 to the URI), it looks like 2.6.0-RC3 is using a different method than 2.5.0 so it breaks the script if <{/close}> isnt included.

yes, i delete the compiled dir each time i switch between 2.5 and 2.6

[edit]
actually, it still breaks if i take out the <{if $smarty.get.timeblock}>
[/edit]
_________________
my delimiters are <{ and }>
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Nov 17, 2003 9:01 am    Post subject: Reply with quote

ZeroFill wrote:
the problem is that i have a block that starts in header.tpl and ends in footer.tpl.


yep. that doesn't work with 2.6.0. blocks have to be closed in the same file where they where opened. looking it the manual: it was neither specifically allowed nor specifically forbidden.

i'm for abandoning this ability (it doesnt't work with {if}, {section}, {foreach} for example anyway, even in 2.5.0) but i'm sure ZeroFill is for keeping it Smile . any other opinions?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Nov 17, 2003 3:08 pm    Post subject: Reply with quote

It looks like ZeroFill is using the technique for timing using my older {timeblock} template timer. He's already posted into the thread for Total page generation time where I posted what I thought to be a better technique that also avoids explicit blocks.

I think we can live without this "feature".
Back to top
View user's profile Send private message
ZeroFill
Smarty Rookie


Joined: 31 Aug 2003
Posts: 28

PostPosted: Mon Nov 17, 2003 3:23 pm    Post subject: Reply with quote

boots wrote:
It looks like ZeroFill is using the technique for timing using my older {timeblock} template timer. He's already posted into the thread for Total page generation time where I posted what I thought to be a better technique that also avoids explicit blocks.

I think we can live without this "feature".


yep. it was boot's timeblock plugin. that feature was fun while it lasted -- beggars can't be choosers Neutral
_________________
my delimiters are <{ and }>
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Nov 17, 2003 3:42 pm    Post subject: Reply with quote

the point is, that smarty 2.5.0 treated {block} and {/block} as merely two single entities.

so "{block}...{/block}...{/block}" for example didn't lead to syntactical incorrect php, just to weird behaviour.

in the long run i'd like to make smarty's compiler check more syntax (like proper nesting of blocks). this is only feasable if we enforce the opening and the closing tag in the same file.

i always hate to break compatibility to older version, but in this case i think it's the most viable for the future.

for ZeroFill's case, boots built a flexible timer as modifier (instead of block), that should work across files, right?

if it's really needed anywhere else (although it's really bad style IMHO) such blocks can be tricked by registering "block" and "/block" as two distinct simple functions. one does "ob_start()", the other does "ob_get_contents()" and both call their corresponding "old" block-function. it's just not easy to make auto-loadable.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Nov 17, 2003 4:02 pm    Post subject: Reply with quote

Just to make sure I was clear--the "feature" I refered to that I'm +1 for dropping is the wonky block handling as messju more explicitly defined in his last post. As long as you don't cross file boundaries, the original {timeblock} still works, but as messju kindly said, my other timer approach is more flexible -- it even works between template and php code.

More to the point, I am very much behind the idea of being "correct" rather than BC for syntax issues in Smarty. Never-the-less, BC issues are probably best broken with major versions. In the case of the change of block functions I am little concerned as there are nearly always things that can be done to the template to restore the needed balance of tags and I suspect that only rare cases will be broken.

Considering that the block change was made in the cvs very shortly after the 2.5.0 release, I think it has probably been well shaken out by now. I *really* hope this was the only broken case Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP