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:
Sarah Hoffmann
2021-04-28 10:59:07 +02:00
parent 23fd1d032a
commit 3eb4d88057
11 changed files with 48 additions and 32 deletions

View File

@@ -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"

View File

@@ -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')

View File

@@ -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',