relative paths stopped working in admin
-
I am developing a site that is partly built on top of CodeIgniter and the other part is using a hacked version of wordpress. So, what I’ve done is “injected” CI functionality into the wordpress by including a global bootstrap via a plugin. The bootstrap defines some constants, loads some functions and does the following to create a $CI object:
[PHP]// Load it only for WordPress and Elgg
if ( PN_ENVIRONMENT !== ‘codeigniter’ ) {
ob_start();
require(PN_COMMONPATH . ‘/ci-core/pn-ci-inject.php’);
ob_end_clean();
$GLOBALS[‘CI’] = get_instance();
}[/PHP]the pn-ci-inject file loads codeigniter using a blank controller. I then flush the buffer, which wonderfully allows me to use
global $CI
to access libraries, helpers, etc.
However, when I did this, something strange broke. Now, in wordpress, my relative paths are not working. So,
require(‘./admin.php’);
or
require(‘../../whatever.php’);
produces fatal errors. However, when I replace the paths with constants I’ve set with the absolute paths, everything works wonderfully. Again, these relative paths worked fine until I created the $CI object.
I really, really, don’t want to go through all of wordpress and replace all relative with absolute paths. What did I do? Does anyone have any idea what this is about?
Thanks all.
- The topic ‘relative paths stopped working in admin’ is closed to new replies.