public function setDevServer($force = false)
{
$path = '';
// .fof file not found, ask the user!
if (!JFile::exists(getcwd() . '/.fof') || $force) {
$this->out("What's the dev site location? ( /var/www/ )");
$path = $this->in();
if (!$path || !JFolder::exists($path)) {
$this->out('The path does not exists');
$this->setDevServer();
}
if (!JFile::exists($path . '/configuration.php')) {
$this->out('The path does not contain a Joomla Website');
$this->setDevServer();
}
$fof = array('dev' => $path);
JFile::write(getcwd() . '/.fof', json_encode($fof));
} else {
$fof = json_decode(JFile::read(getcwd() . '/.fof'));
if ($fof && $fof->dev) {
$path = $fof->dev;
}
}
if (!$path) {
throw new \RuntimeException("Could not detect the path to the dev server");
}
// Load the configuration object.
/** @var \FofApp $app */
$app = JFactory::getApplication();
$app->reloadConfiguration($path);
}