2 Helper functions for executing external programs.
4 from pathlib import Path
7 def run_legacy_script(script, *args, nominatim_env=None):
8 """ Run a Nominatim PHP script with the given arguments.
10 cmd = ['/usr/bin/env', 'php', '-Cq',
11 nominatim_env.phplib_dir / 'admin' / script]
14 env = nominatim_env.config.get_os_env()
15 env['NOMINATIM_DATADIR'] = str(nominatim_env.data_dir)
16 env['NOMINATIM_BINDIR'] = str(nominatim_env.data_dir / 'utils')
18 proc = subprocess.run(cmd, cwd=str(nominatim_env.project_dir), env=env)
20 return proc.returncode