summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Pugh2018-04-04 15:44:05 (GMT)
committerJon Pugh2018-04-04 16:00:01 (GMT)
commit631e0f5549bf2388df1feb4fbde1bc4ab65033e3 (patch)
tree680efa3554acd9a03be96562b7ae4eb1a69526ea
parent36c9d373a66b8073fbc58be2ede5ffcde3839e88 (diff)
Load RoboFile.php commands from the server's config path or from Site/platform root.
-rw-r--r--src/Provision/Context.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Provision/Context.php b/src/Provision/Context.php
index 5d33bf2..ed4f2c7 100644
--- a/src/Provision/Context.php
+++ b/src/Provision/Context.php
@@ -939,6 +939,23 @@ class Context implements BuilderAwareInterface
foreach ($this->servicesInvoke('getCommandClasses') as $class) {
$classes += $class;
}
+
+ // Load RoboFile from site root or server_config_path, if there is one.
+ if ($this->hasProperty('root')) {
+ $robofile_path = $this->getProperty('root') . DIRECTORY_SEPARATOR . 'RoboFile.php';
+ if (file_exists($robofile_path)) {
+ include($robofile_path);
+ $classes[] = 'RoboFile';
+ }
+ }
+ elseif ($this->hasProperty('server_config_path')) {
+ $robofile_path = $this->getProperty('server_config_path') . DIRECTORY_SEPARATOR . 'RoboFile.php';
+ if (file_exists($robofile_path)) {
+ include($robofile_path);
+ $classes[] = 'RoboFile';
+ }
+ }
+
return $classes;
}
}