From 433017b9907c8348a48ef1a9fa7669e3d9523f1b Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 17 Dec 2020 14:58:09 +0100 Subject: [PATCH] move creation of website scripts to setup script Instead of creating the website wrapper scripts with cmake, they are now created when --setup-website is called. The setup of the configuration constants is directly embedded into the scripts. This means we can get rid of the separate settings-frontend.php. More importantly however, it means that it is now possible to set up multiple website directories from the same build directory. --- CMakeLists.txt | 18 +--------- cmake/website.tmpl | 8 ----- lib/lib.php | 18 ++++++++++ lib/setup/SetupClass.php | 71 +++++++++++++++++++++++++++------------- utils/query.php | 1 + 5 files changed, 69 insertions(+), 47 deletions(-) delete mode 100755 cmake/website.tmpl diff --git a/CMakeLists.txt b/CMakeLists.txt index d1dd69ba..b4f4ddb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,26 +114,10 @@ if (BUILD_IMPORTER) endif() #----------------------------------------------------------------------------- -# webserver scripts (API only) +# Targets for running a development webserver from the build directory. #----------------------------------------------------------------------------- if (BUILD_API) - set(WEBSITESCRIPTS - deletable.php - details.php - lookup.php - polygons.php - reverse.php - search.php - status.php - ) - - foreach (script_source ${WEBSITESCRIPTS}) - configure_file(${PROJECT_SOURCE_DIR}/cmake/website.tmpl - ${PROJECT_BINARY_DIR}/website/${script_source}) - endforeach() - - add_custom_target(serve php -S 127.0.0.1:8088 WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/website diff --git a/cmake/website.tmpl b/cmake/website.tmpl deleted file mode 100755 index 8194a8eb..00000000 --- a/cmake/website.tmpl +++ /dev/null @@ -1,8 +0,0 @@ -