Thursday, May 5, 2011

Changing include path using php script

I'm looking to include other folders in my include path for PHP. I've seen this question:

http://stackoverflow.com/questions/24622/setting-php-include-path-on-a-per-site-basis

BUT I don't want to replicate the system path (I suppose I could but then it won't update if the system path is updated). What I would rather is to simply have a line which looked like:

ini_set('include_path', ini_get('include_path').$otherpaths);

Will this work, and is there some fundamental readon this is bad?

From stackoverflow
  • I think you are looking for this: set_include_path

    With it, you can do:

    set_include_path(get_include_path() . PATH_SEPARATOR . $otherpath);
    
    altCognito : Hah, oh, for a while there, I'm slackin'. This qualifies as so simple why not ask? That's why it's here! Good to see you.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.