Okay, this may seem odd. I have a 3rd party set of scripts that I purchased. The script set pulls from an included Smarty template engine. It doesn't matter where in the directory structure I need to put it, but the file I include in the node body needs to be able to find all the other files that it calls to.

I'm trying different things and getting mixed results - I'm confident that I'll figure it out eventually, just wondering if anyone has successfully done this and how it was done. Could save me a lot of time and hassle, and a few handfuls of hair as well!

Comments

sickhippie’s picture

At this point I'm stuck with a "Fatal error: Class 'Smarty' not found" error. I know there is no easy way to convert something from Smarty back to straight php. As near as I can tell, it's including at least some of the files it's calling (confirmed with a var_dump), but not including others.

Edit: Got past that, now having a small host of errors. Things like warning: include_once() [function.include]: Failed opening 'templates//pdfSettings.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')

The line that is causing it is include_once('templates/'. $Variables->Template . '/pdfSettings.php'); Now, that variable should be set in one of the early includes in the script - but while the variable array is there, there is nothing populating it all.

FYI, I'm including the main script with

<?php
$dir = getcwd();
chdir('calculators');
require "calc1.php";
chdir($dir);
?>

The script and all related files are in ./calculators - hopefully someone has some idea of wtf is going on here?