mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 02:47:59 +00:00
boilerplate for PHP code of tokenizer
This adds an installation step for PHP code for the tokenizer. The PHP code is split in two parts. The updateable code is found in lib-php. The tokenizer installs an additional script in the project directory which then includes the code from lib-php and defines all settings that are static to the database. The website code then always includes the PHP from the project directory.
This commit is contained in:
@@ -16,7 +16,7 @@ class DummyTokenizer:
|
||||
self.analyser_cache = {}
|
||||
|
||||
|
||||
def init_new_db(self, config):
|
||||
def init_new_db(self, *args, **kwargs):
|
||||
assert self.init_state == None
|
||||
self.init_state = "new"
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ def test_config(def_config, tmp_path):
|
||||
|
||||
@pytest.fixture
|
||||
def tokenizer_factory(dsn, tmp_path, monkeypatch, property_table):
|
||||
(tmp_path / 'tokenizer').mkdir()
|
||||
|
||||
def _maker():
|
||||
return legacy_tokenizer.create(dsn, tmp_path / 'tokenizer')
|
||||
|
||||
@@ -26,6 +26,7 @@ def test_script(envdir):
|
||||
|
||||
def run_website_script(envdir, config):
|
||||
config.lib_dir.php = envdir / 'php'
|
||||
config.project_dir = envdir
|
||||
refresh.setup_website(envdir, config)
|
||||
|
||||
proc = subprocess.run(['/usr/bin/env', 'php', '-Cq',
|
||||
|
||||
Reference in New Issue
Block a user