Commit 631e0f55 authored by Jon Pugh's avatar Jon Pugh

Load RoboFile.php commands from the server's config path or from Site/platform root.

parent 36c9d373
......@@ -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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment