One last hurdle while embedding - Duplicate Smarty
Posted: Wed Oct 25, 2006 11:23 pm
I've almost got embedding working the way I want it to (from 2 different directories, site in one, s9y in subdirectory).
I used the approach where I first include serendipity, using outputbuffering, and save the output in a variable. Then I include my CMS stuff, and use the variable to put the content into place.
Almost works. There's one problem: I get a fatal error on a duplicate definition of the Smarty class, which makes sense, both the CMS and s9y are Smarty based.
The dirty solution was to remove one of the includes of Smarty, which makes both systems use the same Smarty.
The correct solution in my opiniion, would be a possibility in either the CMS or s9y to configure what Smarty.class.php to use. If I can tell s9y to use the one from the cms, it will work because require_once will then prevent the class from being loaded twice.
s9y is the best place to fix this, since s9y is included first and the cms is included second.
Would it be easy to make this a little bit more configurable? I guess it's a matter of defining SMARTY_DIR someplace other than functions_smarty.inc.php, or have it do an if(defined)) check so I can define it myself before including s9y.
What do you think?
I used the approach where I first include serendipity, using outputbuffering, and save the output in a variable. Then I include my CMS stuff, and use the variable to put the content into place.
Almost works. There's one problem: I get a fatal error on a duplicate definition of the Smarty class, which makes sense, both the CMS and s9y are Smarty based.
The dirty solution was to remove one of the includes of Smarty, which makes both systems use the same Smarty.
The correct solution in my opiniion, would be a possibility in either the CMS or s9y to configure what Smarty.class.php to use. If I can tell s9y to use the one from the cms, it will work because require_once will then prevent the class from being loaded twice.
s9y is the best place to fix this, since s9y is included first and the cms is included second.
Would it be easy to make this a little bit more configurable? I guess it's a matter of defining SMARTY_DIR someplace other than functions_smarty.inc.php, or have it do an if(defined)) check so I can define it myself before including s9y.
What do you think?