We’re about to upgrade our main site’s software to smarty3. everything works fine, except the embedded version of gallery2, which uses smarty2.
it’s included that way:
require_once('../../gallery2/embed.php');
the embedded gallery2 automatically extends the smarty3 class of our main site (smarty2 & 3 use the same classname). so gallery2 now uses smarty3 like smarty2 which doesn’t work.
is peacefully smarty2 & smarty3 coexistence possible in such a case?
- renaming one of both smarty classes … failed (breaks things inside smarty)
- tried to extend gallery2’s template object with smarty3 compatibility functions … failed
- yeah, namespaces would be the solution, but since smarty doesn’t use them out of the box …
many thanks for your help
i solved it the dirty way. separating smarty2 from smarty3 by refactoring smarty2 to a different class name + renaming all the included functions (they are each in a separate function) + some change to compile code using my renamed functions. not pretty. but works.