X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/cb06d1f4caa5a2fae5da6748bb38480a306e3ee8..298ed11261cdb959406435b97be750abb0abc4af:/nominatim/tools/exec_utils.py diff --git a/nominatim/tools/exec_utils.py b/nominatim/tools/exec_utils.py index e0d048a2..23dd8a1d 100644 --- a/nominatim/tools/exec_utils.py +++ b/nominatim/tools/exec_utils.py @@ -26,6 +26,8 @@ def run_legacy_script(script, *args, nominatim_env=None, throw_on_fail=False): env = nominatim_env.config.get_os_env() 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 @@ -89,6 +91,13 @@ def run_api_script(endpoint, project_dir, extra_env=None, phpcgi_bin=None, return 0 +def run_php_server(server_address, base_dir): + """ Run the built-in server from the given directory. + """ + subprocess.run(['/usr/bin/env', 'php', '-S', server_address], + cwd=str(base_dir), check=True) + + def run_osm2pgsql(options): """ Run osm2pgsql with the given options. """