1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Rep Power

    Relative paths no longer working

    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 Code:
    // Load it only for Wordpress and Elgg
    if ( PN_ENVIRONMENT !== 'codeigniter' ) {
    PN_COMMONPATH '/ci-core/pn-ci-inject.php'); 
    $GLOBALS['CI'] = get_instance();

    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,




    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.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Rep Power
    You can use the chdir function to change the active directory.

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo