configurable "ini_set" include method

thread: 5 messages  |  last: about 4 years ago  |  started: friday, december 28, 2007, 9:48 pm pst


#1  |  bhazzard (Helena, MT) United States of America
Friday, December 28, 2007, 9:48 PM PST

Currently if we want to have multiple Qcodo apps on one server we have to use the “ini_set” method of setting the includes path. Not a problem, except it adds a lot of repetative coding to the front end of development.

Couldn't we somehow make this a configuration issue?

In other words just set the path once and have it automatically included in all of our files.

Now of course there is a sort of paradox here that we would have to solve. the configuration file is itself an included file, so until the ini_set include path stuff was executed, we wouldn't know where to find the configuration file and blah, blah, blah...

But I think we are smart people and there must be an intelligent solution to this that will save us all from having to add those lines of code all over the place when we install a new Qcodo instance.

#2  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Saturday, December 29, 2007, 9:41 AM PST

if you're using apache, then you can use .htaccess files to use php_value apache directives.

#3  |  bhazzard (Helena, MT) United States of America
Sunday, December 30, 2007, 8:53 AM PST

I remember seeing a tutorial to that effect on this site. Could you remind me where that is posted?

#4  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Monday, December 31, 2007, 12:39 PM PST

Hmm... hehe, i don't remember a tutorial on this per se... =)

But this is actually specific to both PHP as well as apache.  You might be able to read more about it starting from <http://us.php.net/manual/en/ini.php>

#5  |  VexedPanda (Calgary, AB) Canada
Tuesday, January 15, 2008, 2:19 PM PST

Why not avoid using includes paths?
We just have a local configuration.inc.php and prepend.inc.php for each app, and use relative paths to access those. Once that's done, everything can be accessed using the appropriate constants. (eg: _INCLUDES_/header.inc.php )



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.