@define('CONST_BinDir', '@CMAKE_SOURCE_DIR@/utils');
@define('CONST_DataDir', '@CMAKE_SOURCE_DIR@');
@define('CONST_SqlDir', '@CMAKE_SOURCE_DIR@/lib-sql');
+@define('CONST_ConfigDir', '@CMAKE_SOURCE_DIR@/settings');
loadDotEnv();
$_SERVER['NOMINATIM_NOMINATIM_TOOL'] = '@CMAKE_BINARY_DIR@/nominatim';
phplib_dir='@CMAKE_SOURCE_DIR@/lib-php',
sqllib_dir='@CMAKE_SOURCE_DIR@/lib-sql',
data_dir='@CMAKE_SOURCE_DIR@',
+ config_dir='@CMAKE_SOURCE_DIR@/settings',
phpcgi_path='@PHPCGI_BIN@'))
function loadDotEnv()
{
$dotenv = new \Symfony\Component\Dotenv\Dotenv();
- $dotenv->load(CONST_DataDir.'/settings/env.defaults');
+ $dotenv->load(CONST_ConfigDir.'/env.defaults');
if (file_exists('.env')) {
$dotenv->load('.env');
defined('CONST_DataDir') or define('CONST_DataDir', $_SERVER['NOMINATIM_DATADIR']);
defined('CONST_BinDir') or define('CONST_BinDir', $_SERVER['NOMINATIM_BINDIR']);
defined('CONST_SqlDir') or define('CONST_SqlDir', $_SERVER['NOMINATIM_SQLDIR']);
+ defined('CONST_ConfigDir') or define('CONST_ConfigDir', $_SERVER['NOMINATIM_CONFIGDIR']);
defined('CONST_Default_ModulePath') or define('CONST_Default_ModulePath', $_SERVER['NOMINATIM_DATABASE_MODULE_SRC_PATH']);
}
$sValue = $_SERVER['NOMINATIM_'.$sConfName];
if (!$sValue) {
- return CONST_DataDir.'/settings/'.$sSystemConfig;
+ return CONST_ConfigDir.'/'.$sSystemConfig;
}
return $sValue;
$sStyle = getSetting('IMPORT_STYLE');
if (in_array($sStyle, array('admin', 'street', 'address', 'full', 'extratags'))) {
- return CONST_DataDir.'/settings/import-'.$sStyle.'.style';
+ return CONST_ConfigDir.'/import-'.$sStyle.'.style';
}
return $sStyle;
return 1
for arg in ('module_dir', 'osm2pgsql_path', 'phplib_dir', 'sqllib_dir',
- 'data_dir', 'phpcgi_path'):
+ 'data_dir', 'config_dir', 'phpcgi_path'):
setattr(args, arg, Path(kwargs[arg]))
args.project_dir = Path(args.project_dir).resolve()
datefmt='%Y-%m-%d %H:%M:%S',
level=max(4 - args.verbose, 1) * 10)
- args.config = Configuration(args.project_dir, args.data_dir / 'settings')
+ args.config = Configuration(args.project_dir, args.config_dir)
log = logging.getLogger()
log.warning('Using project directory: %s', str(args.project_dir))
env['NOMINATIM_DATADIR'] = str(nominatim_env.data_dir)
env['NOMINATIM_BINDIR'] = str(nominatim_env.data_dir / 'utils')
env['NOMINATIM_SQLDIR'] = str(nominatim_env.sqllib_dir)
+ env['NOMINATIM_CONFIGDIR'] = str(nominatim_env.config_dir)
env['NOMINATIM_DATABASE_MODULE_SRC_PATH'] = nominatim_env.module_dir
if not env['NOMINATIM_OSM2PGSQL_BINARY']:
env['NOMINATIM_OSM2PGSQL_BINARY'] = nominatim_env.osm2pgsql_path
self.test_env['NOMINATIM_USE_US_TIGER_DATA'] = 'yes'
self.test_env['NOMINATIM_DATADIR'] = self.src_dir
self.test_env['NOMINATIM_SQLDIR'] = self.src_dir / 'lib-sql'
+ self.test_env['NOMINATIM_CONFIGDIR'] = self.src_dir / 'settings'
self.test_env['NOMINATIM_BINDIR'] = self.src_dir / 'utils'
self.test_env['NOMINATIM_DATABASE_MODULE_SRC_PATH'] = self.build_dir / 'module'
self.test_env['NOMINATIM_OSM2PGSQL_BINARY'] = self.build_dir / 'osm2pgsql' / 'osm2pgsql'