aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2011-03-15 01:01:30 +0100
committerLaurent Bachelier <laurent@bachelier.name>2011-03-15 01:01:30 +0100
commitf7a63b0b647c0ab307233f31ecb938fb067c151a (patch)
treee95c374874fa242f4da5a6b216f3a8414b9884d3
parentMake message more universal and explicit (diff)
downloadsymfttpd-f7a63b0b647c0ab307233f31ecb938fb067c151a.tar.xz
The Application determines the "web" path
This would be useful for supporting WordPress, or some non-standard Symfony2 setups.
-rw-r--r--lib/Symfony1.php13
-rwxr-xr-xspawn2
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/Symfony1.php b/lib/Symfony1.php
index 1d5a866..006e720 100644
--- a/lib/Symfony1.php
+++ b/lib/Symfony1.php
@@ -76,7 +76,7 @@ class Symfony1 extends Application
public function getApps()
{
$applications = array();
- foreach (new DirectoryIterator($this->project_path.'/web') as $file)
+ foreach (new DirectoryIterator($this->getWebPath()) as $file)
{
if ($file->isFile() && preg_match('/\.php$/', $file->getFilename()))
{
@@ -87,4 +87,15 @@ class Symfony1 extends Application
return $apps;
}
+
+ /**
+ * @return string Path of the public files
+ *
+ * @author Laurent Bachelier <laurent@bachelier.name>
+ */
+ public function getWebPath()
+ {
+
+ return $this->project_path.'/web';
+ }
}
diff --git a/spawn b/spawn
index c0fa9d9..9f808a8 100755
--- a/spawn
+++ b/spawn
@@ -84,7 +84,7 @@ catch (ExecutableNotFoundError $e)
if ($options['genconf_cmd'] === false)
{
- $options['genconf_cmd'] = $options['php_cmd'].' '.escapeshellarg(realpath(dirname(__FILE__)).'/genconf').' -p '.escapeshellarg($options['project_path'].'/web');
+ $options['genconf_cmd'] = $options['php_cmd'].' '.escapeshellarg(realpath(dirname(__FILE__)).'/genconf').' -p '.escapeshellarg($application->getWebPath());
}
Template::writeConfig($options);