} else {
$baseFile = $options['f'];
if (!file_exists($baseFile)) {
throw new Exception('The given file(' . $baseFile . ') does not exist.');
}
}
// bootstrap Fork
define('APPLICATION', 'Backend');
$kernel = new AppKernel('prod', false);
$kernel->boot();
$kernel->defineForkConstants();
if (!defined('PATH_WWW')) {
define('PATH_WWW', __DIR__ . '/..');
}
$loader = new BackendInit($kernel);
$loader->initialize('Backend');
$loader->passContainerToModels();
// create needed constants
$container = $kernel->getContainer();
// Set the overwrite parameter
$overwrite = isset($options['o']);
// Set the basedir
$baseDir = getcwd() . '/..';
// load the xml from the file
$xmlData = @simplexml_load_file($baseFile);
// this is an invalid xml file
if ($xmlData === false) {
throw new Exception('Invalid locale.xml file.');
}
// Everything ok, let's install the locale
BackendLocaleModel::importXML($xmlData, $overwrite, null, null, 1);