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

Will Smarty2 work with php8?

 
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
CySlider
Smarty n00b


Joined: 14 Jan 2021
Posts: 3

PostPosted: Thu Jan 14, 2021 1:00 pm    Post subject: Will Smarty2 work with php8? Reply with quote

Hi,

I have to update some legacy code from php5.5 to php8 (or at least 7.4)

I tried to use smarty 3. But the performance is horrible. Smarty 2 needs 0.01s while Smarty 3 needs 0.30 seconds. (on php5.5)

[Half of it is used while loading the large language config ini files with configLoad, other half is wasted when rendering the page it seems]

So I wonder, if Smarty 2 will still work on php8 or at least php7.4

*Edit: accidently said Smarty 1 instead of 2

*Edit2*: I had caching enabled and my speed numbers were wrong because they were cached as well from the time the template was compiled


Last edited by CySlider on Fri Mar 26, 2021 1:53 am; edited 1 time in total
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Jan 15, 2021 10:04 am    Post subject: Reply with quote

If you have such performance issues, you are doing something wrong.
Generally, Smarty 3 is faster than Smarty 2, unless you overuse/misuse certain features.

And no, there's no plans to support Smarty 2 any longer as far as I know.

And Smarty 3 likely won't be officially supported on PHP8 too. (This is still under consideration.)
Back to top
View user's profile Send private message
CySlider
Smarty n00b


Joined: 14 Jan 2021
Posts: 3

PostPosted: Fri Jan 15, 2021 8:37 pm    Post subject: Reply with quote

Well, at least for half the lost time I really do not do anything fancy but am calling configLoad on a big config.ini file that holds our translations.

If I find some more time, I'll do some digging, where the time is now lost.

BTW, when I say Smarty 3 I meant 3.1, So the newest version. Are they considering to not support it for php8 anymore? Is this project dead? Or did you mean 3.0?
Back to top
View user's profile Send private message
jav664
Smarty Rookie


Joined: 04 Mar 2011
Posts: 11

PostPosted: Tue Feb 16, 2021 8:56 pm    Post subject: Reply with quote

smarty 3 runs smoothly under PHP8.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Feb 17, 2021 8:15 am    Post subject: Reply with quote

CySlider wrote:
BTW, when I say Smarty 3 I meant 3.1, So the newest version. Are they considering to not support it for php8 anymore? Is this project dead? Or did you mean 3.0?


It is supported now, but future is unclear. Depends on release date of Smarty 4.
Back to top
View user's profile Send private message
SlowFox
Smarty Regular


Joined: 02 Oct 2006
Posts: 55

PostPosted: Sat Mar 20, 2021 3:48 pm    Post subject: Reply with quote

AnrDaemon wrote:
Depends on release date of Smarty 4.

Is there any ongoing work on Smarty (apart from bugfixes)? My impression was rather a complete loss of interest during the last couple of years.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Mar 22, 2021 3:13 pm    Post subject: Reply with quote

If you have any concrete ideas, please join the team.

Other than that, if you can name me an equally fully featured PHP template engine, or what you are missing in current release, I'd like to hear, personally.
Back to top
View user's profile Send private message
SlowFox
Smarty Regular


Joined: 02 Oct 2006
Posts: 55

PostPosted: Mon Mar 22, 2021 6:00 pm    Post subject: Reply with quote

AnrDaemon wrote:
If you have any concrete ideas, please join the team

If there still is some ongoing development, this is a real option (though I am not a very good teamplayer).

Actually I am not missing too much: one could get rid of a huge load of warnings and perhaps use the additional type-checking et.al. features of the recent PHP versions. Personally I'd favor for the (or: a) default modifier to be applied at run-time.

Quote:
Other than that, if you can name me an equally fully featured PHP template engine, or what you are missing in current release, I'd like to hear, personally.

I can't, definitely not. I am using Smarty for 15+ years now, I am pleased with it and my main project heavily depends on it (acutally this is one reason why I want to know if there is ongoing development or if I should prepare to be on my own as PHP continues to evolve in the background).
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Mar 24, 2021 7:00 pm    Post subject: Reply with quote

There IS ongoing development, but with a project being in development for so long, it's hard to find a feature that isn't already covered or easily implemented using existing mechanics by the end user.

If you want to spend some time on it, pick a bug report and ask if it is worth working on it. Then try to make a fix.
Back to top
View user's profile Send private message
CySlider
Smarty n00b


Joined: 14 Jan 2021
Posts: 3

PostPosted: Fri Mar 26, 2021 1:51 am    Post subject: Reply with quote

Ok, I found the issue, and it was on me.

Caching was enabled without me realizing it and I did not use it in Smarty2.

This in return lead to my speed output being cached as well and always showing the speed of the template compilation instead of the actual last delivery speed

Embarassed

Anyway. now speeds are far more acceptable even though they still seem up to 2 times slower (0.018-0.032 VS 0.012 - 0.022 in ~10 refreshes). But this is not yet any way scientific and the project isstill on an old PHP version (5.6) that this Smarty version is not tailored towards.
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