Code: Select all
include('xxx.php');
But that breaks it when using vQmod because it assumes the relative path. And since vQmod changed files run out of the vqcache path, the solution is to use the full absolute path to where it "should" be, but to be sure it is dynamic per site.
I always used the following:
Code: Select all
include(DIR_SYSTEM . '../path/to/file/xxx.php');
I include the '../' to tell the code to go up one level which is the parent directory of the "system" folder
That is the guaranteed way to find the root folder of the cart. From there you can build the path to your file. Alternatively you can use:
Code: Select all
include(dirname(DIR_SYSTEM) . '/path/to/file/xxx.php');
But aside from making it work with vQmod, it also has its other benefits from a code perspective shown here:
http://www.kavoir.com/2010/02/php-why-y ... e-php.html
Read down to the "a better approach" part....
So not only does it make it vQmod compatible, it also speeds things up a tad