![Smarty Forum Index Smarty Forum Index](templates/smarty/images/phpbb2_logo.gif) |
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Lemon Juice Smarty Pro
Joined: 24 May 2006 Posts: 109
|
Posted: Thu Oct 23, 2014 2:39 pm Post subject: Namespaced Smarty instance |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Nov 21, 2014 1:06 am Post subject: Re: Namespaced Smarty instance |
|
|
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 |
|
|
|
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
|