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

Namespaced Smarty instance

 
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 -> Installation and Setup
View previous topic :: View next topic  
Author Message
Lemon Juice
Smarty Pro


Joined: 24 May 2006
Posts: 109

PostPosted: Thu Oct 23, 2014 2:39 pm    Post subject: Namespaced Smarty instance Reply with quote

I was wondering if there are any plans for releasing namespaced smarty for phph 5.3+? I once had a need to have objects of separate Smarty versions because I was embedding a library from one project into another project and both projects used different Smarty versions so in order to keep them separate I wanted to load the other smarty instance into a new namespace. However, because of PHP design deficiency this would mean changing Smarty code and inserting namespace declarations into Smarty files. Fortunately, I was in charge of both projects so I managed to refactor the code to use just one Smarty library - but that is not always the case!

Sometimes I may not be allowed to touch anything in existing code and would prefer to keep everything separate and simply ship a separate Smarty library in my library/plugin without clashing or depending on any Smarty libraries being present in the base project.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Nov 21, 2014 1:06 am    Post subject: Re: Namespaced Smarty instance Reply with quote

Lemon Juice wrote:
I once had a need to have objects of separate Smarty versions because I was embedding a library from one project into another project and both projects used different Smarty versions so in order to keep them separate I wanted to load the other smarty instance into a new namespace.

That's the wrong way to do it.
You should never ever use different versions of the same library in a single project.
EVER.
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 -> Installation and Setup 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