aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2011-06-19 23:46:26 +0200
committerLaurent Bachelier <laurent@bachelier.name>2011-06-19 23:46:26 +0200
commit3693a01ed1806e04289fbf419aeab58cb38e0601 (patch)
tree1173c04e4fb51ffd8f35433bd5716e69d67710ac
parentThe Application determines the genconf path (diff)
downloadsymfttpd-3693a01ed1806e04289fbf419aeab58cb38e0601.tar.xz
Let's be bold. Start using the symfttpd directory inside a project.
-rw-r--r--lib/MultiConfig.php5
-rw-r--r--symfttpd.conf.php8
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/MultiConfig.php b/lib/MultiConfig.php
index 431b425..5b5d1d8 100644
--- a/lib/MultiConfig.php
+++ b/lib/MultiConfig.php
@@ -10,11 +10,16 @@ class MultiConfig
static public function get($cfgname = 'symfttpd.conf.php')
{
$options = array();
+ if (file_exists(getcwd().'/symfttpd') && is_dir(getcwd().'/symfttpd'))
+ {
+ $options['has_symfttpd_dir'] = true;
+ }
$configs = array(
dirname(__FILE__).'/../'.$cfgname, // defaults
getenv('HOME').'/.'.$cfgname, // user configuration
getcwd().'/config/'.$cfgname, // project configuration
+ getcwd().'/symfttpd/'.$cfgname, // project configuration, new style
);
foreach ($configs as $config)
diff --git a/symfttpd.conf.php b/symfttpd.conf.php
index 7c7872a..0234b72 100644
--- a/symfttpd.conf.php
+++ b/symfttpd.conf.php
@@ -12,6 +12,11 @@
// {{{ mksymlinks configuration
/**
+ * Is there or should there be a "symfttpd" directory in the project?
+ */
+$options['has_symfttpd_dir'] = false;
+
+/**
* Path to symfttpd files
* Useful for creating the link to genconf.
* Do not change/copy it unless you know what you are doing.
@@ -23,7 +28,8 @@ $options['path'] = dirname(__FILE__);
* Create the symlink to genconf
* @var string|boolean false or path relative to the project root
*/
-$options['genconf'] = 'config/lighttpd.php';
+$options['genconf'] = $options['has_symfttpd_dir']
+ ? 'symfttpd/lighttpd.php' : 'config/lighttpd.php';
/**
* Create the symlink to the symfony data directory