I use a very similar method:
include_once("../config.php");
if(file_exists("../config.dev.php")) include_once("../config.dev.php");
The reason I chose this is so that you don't need to duplicate data from
config.php into config.dev.php - just the differences (this may depend of
course on your config methods).
I then svn:ignore *.dev.php
Thanks,
Nathan
Web Controlled Robot Arm and Beetle
http://www.kennedytechnology.com
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Philip Arndt
Sent: Wednesday, 29 October 2008 11:06 a.m.
To: [email protected]
Subject: [phpug] Re: deployment....
I wrote a pretty cool config function once:
<?php
if (file_exists(realpath("../config/config.production.php")))
{
include_once("config.production.php");
define("IS_DEV", 0);
}
else if (file_exists(realpath("../config/config.dev.php")))
{
include_once("config.dev.php");
define("IS_DEV", 1);
}
?>
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---