]> git.openstreetmap.org Git - nominatim.git/commitdiff
Restructure script and website installation
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 2 Dec 2018 10:13:48 +0000 (11:13 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 2 Dec 2018 10:13:48 +0000 (11:13 +0100)
Just make cmake install a small stub that includes
the settings from the build directory and then the
script from the source directory. Remove executable
rights from php files in utils/ so that they cannot
be accidentally executed.

20 files changed:
CMakeLists.txt
cmake/script.tmpl [new file with mode: 0755]
cmake/website.tmpl [new file with mode: 0755]
utils/country_languages.php [changed mode: 0755->0644]
utils/export.php [changed mode: 0755->0644]
utils/importWikipedia.php [changed mode: 0755->0644]
utils/query.php [changed mode: 0755->0644]
utils/server_compare.php [changed mode: 0755->0644]
utils/setup.php [changed mode: 0755->0644]
utils/specialphrases.php [changed mode: 0755->0644]
utils/update.php [changed mode: 0755->0644]
utils/warm.php [changed mode: 0755->0644]
website/deletable.php [changed mode: 0755->0644]
website/details.php [changed mode: 0755->0644]
website/hierarchy.php [changed mode: 0755->0644]
website/lookup.php [changed mode: 0755->0644]
website/polygons.php [changed mode: 0755->0644]
website/reverse.php [changed mode: 0755->0644]
website/search.php [changed mode: 0755->0644]
website/status.php

index 898ab22929d8633c6eb71d4bdec26b6b07078783..b7a2caaf72d3889e2a013f53e8152a01fdd52b0e 100644 (file)
@@ -93,8 +93,7 @@ message (STATUS "Using PHP binary " ${PHP_BIN})
 #
 #-----------------------------------------------------------------------------
 
 #
 #-----------------------------------------------------------------------------
 
-set(CUSTOMFILES
-    settings/phrase_settings.php
+set(WEBSITESCRIPTS
     website/deletable.php
     website/details.php
     website/hierarchy.php
     website/deletable.php
     website/details.php
     website/hierarchy.php
@@ -103,6 +102,9 @@ set(CUSTOMFILES
     website/reverse.php
     website/search.php
     website/status.php
     website/reverse.php
     website/search.php
     website/status.php
+)
+
+set(CUSTOMSCRIPTS
     utils/country_languages.php
     utils/importWikipedia.php
     utils/export.php
     utils/country_languages.php
     utils/importWikipedia.php
     utils/export.php
@@ -114,11 +116,24 @@ set(CUSTOMFILES
     utils/warm.php
    )
 
     utils/warm.php
    )
 
-foreach (cfile ${CUSTOMFILES})
-    configure_file(${PROJECT_SOURCE_DIR}/${cfile} ${PROJECT_BINARY_DIR}/${cfile})
+foreach (script_source ${CUSTOMSCRIPTS})
+    configure_file(${PROJECT_SOURCE_DIR}/cmake/script.tmpl
+                   ${PROJECT_BINARY_DIR}/${script_source})
+endforeach()
+
+foreach (script_source ${WEBSITESCRIPTS})
+    configure_file(${PROJECT_SOURCE_DIR}/cmake/website.tmpl
+                   ${PROJECT_BINARY_DIR}/${script_source})
 endforeach()
 
 endforeach()
 
-configure_file(${PROJECT_SOURCE_DIR}/settings/defaults.php ${PROJECT_BINARY_DIR}/settings/settings.php)
+set(CONFIGUREFILES
+    settings/phrase_settings.php
+    settings/defaults.php
+   )
+
+foreach (cfile ${CONFIGUREFILES})
+    configure_file(${PROJECT_SOURCE_DIR}/${cfile} ${PROJECT_BINARY_DIR}/${cfile})
+endforeach()
 
 set(WEBPATHS css images js)
 
 
 set(WEBPATHS css images js)
 
diff --git a/cmake/script.tmpl b/cmake/script.tmpl
new file mode 100755 (executable)
index 0000000..8146ca8
--- /dev/null
@@ -0,0 +1,4 @@
+#!@PHP_BIN@ -Cq
+<?php
+require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+require_once(CONST_BasePath.'/@script_source@');
diff --git a/cmake/website.tmpl b/cmake/website.tmpl
new file mode 100755 (executable)
index 0000000..0257aa1
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+require_once(CONST_BasePath.'/@script_source@');
old mode 100755 (executable)
new mode 100644 (file)
index b1a7ab1..07a9422
@@ -1,7 +1,5 @@
-#!@PHP_BIN@ -Cq
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 
 ini_set('memory_limit', '800M');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 
 ini_set('memory_limit', '800M');
old mode 100755 (executable)
new mode 100644 (file)
index aafb375..34f1b01
@@ -1,10 +1,8 @@
-#!@PHP_BIN@ -Cq
 <?php
     // Script to extract structured city and street data
     // from a running nominatim instance as CSV data
 
 
 <?php
     // Script to extract structured city and street data
     // from a running nominatim instance as CSV data
 
 
-    require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
     require_once(CONST_BasePath.'/lib/init-cmd.php');
     require_once(CONST_BasePath.'/lib/ParameterParser.php');
     ini_set('memory_limit', '800M');
     require_once(CONST_BasePath.'/lib/init-cmd.php');
     require_once(CONST_BasePath.'/lib/ParameterParser.php');
     ini_set('memory_limit', '800M');
old mode 100755 (executable)
new mode 100644 (file)
index 6e42975..06db603
@@ -1,7 +1,5 @@
-#!/usr/bin/php -Cq
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 ini_set('memory_limit', '800M');
 
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 ini_set('memory_limit', '800M');
 
old mode 100755 (executable)
new mode 100644 (file)
index e3e2e7b..16657da
@@ -1,7 +1,5 @@
-#!@PHP_BIN@ -Cq
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 require_once(CONST_BasePath.'/lib/Geocode.php');
 require_once(CONST_BasePath.'/lib/ParameterParser.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 require_once(CONST_BasePath.'/lib/Geocode.php');
 require_once(CONST_BasePath.'/lib/ParameterParser.php');
old mode 100755 (executable)
new mode 100644 (file)
index 0a27c48..f44b073
@@ -1,4 +1,3 @@
-#!@PHP_BIN@ -Cq
 <?php
 
 $sFile = 'sample.log.txt'; // Apache log file
 <?php
 
 $sFile = 'sample.log.txt'; // Apache log file
old mode 100755 (executable)
new mode 100644 (file)
index 0d2e658..66b7192
@@ -1,11 +1,6 @@
-#!@PHP_BIN@ -Cq
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
-// ->indirect via init-cmd.php->/lib/cmd.php                for runWithEnv, getCmdOpt
-// ->indirect via init-cmd.php->/lib/init.php->db.php       for &getDB()
-
 require_once(CONST_BasePath.'/lib/setup/SetupClass.php');
 require_once(CONST_BasePath.'/lib/setup_functions.php');
 ini_set('memory_limit', '800M');
 require_once(CONST_BasePath.'/lib/setup/SetupClass.php');
 require_once(CONST_BasePath.'/lib/setup_functions.php');
 ini_set('memory_limit', '800M');
old mode 100755 (executable)
new mode 100644 (file)
index 7d22df5..40fd375
@@ -1,7 +1,5 @@
-#!@PHP_BIN@ -Cq
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 ini_set('memory_limit', '800M');
 ini_set('display_errors', 'stderr');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 ini_set('memory_limit', '800M');
 ini_set('display_errors', 'stderr');
old mode 100755 (executable)
new mode 100644 (file)
index 7cb2187..24095ef
@@ -1,7 +1,5 @@
-#!@PHP_BIN@ -Cq
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 require_once(CONST_BasePath.'/lib/setup_functions.php');
 require_once(CONST_BasePath.'/lib/setup/SetupClass.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 require_once(CONST_BasePath.'/lib/setup_functions.php');
 require_once(CONST_BasePath.'/lib/setup/SetupClass.php');
old mode 100755 (executable)
new mode 100644 (file)
index 653bcf1..5e1b3ee
@@ -1,7 +1,5 @@
-#!@PHP_BIN@ -Cq
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 ini_set('memory_limit', '800M');
 
 require_once(CONST_BasePath.'/lib/init-cmd.php');
 ini_set('memory_limit', '800M');
 
old mode 100755 (executable)
new mode 100644 (file)
index 6e9178e..5b94d45
@@ -1,6 +1,5 @@
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/output.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/output.php');
old mode 100755 (executable)
new mode 100644 (file)
index 81d643f..474c1d8
@@ -1,7 +1,5 @@
 <?php
 <?php
-@define('CONST_ConnectionBucket_PageType', 'Details');
 
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/output.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/output.php');
old mode 100755 (executable)
new mode 100644 (file)
index 3ac4f32..419a047
@@ -1,7 +1,5 @@
 <?php
 <?php
-@define('CONST_ConnectionBucket_PageType', 'Details');
 
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/AddressDetails.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/AddressDetails.php');
old mode 100755 (executable)
new mode 100644 (file)
index ec2a3a8..ae76df2
@@ -1,7 +1,5 @@
 <?php
 <?php
-@define('CONST_ConnectionBucket_PageType', 'Reverse');
 
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/PlaceLookup.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/PlaceLookup.php');
old mode 100755 (executable)
new mode 100644 (file)
index 0f49183..e5d459f
@@ -1,6 +1,5 @@
 <?php
 
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/output.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/output.php');
old mode 100755 (executable)
new mode 100644 (file)
index 963f750..0ba1771
@@ -1,7 +1,5 @@
 <?php
 <?php
-@define('CONST_ConnectionBucket_PageType', 'Reverse');
 
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/PlaceLookup.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/PlaceLookup.php');
old mode 100755 (executable)
new mode 100644 (file)
index 0b678ca..696cdf7
@@ -1,7 +1,5 @@
 <?php
 <?php
-@define('CONST_ConnectionBucket_PageType', 'Search');
 
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/Geocode.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/Geocode.php');
index c0c379d0a983e6dd6d331d5a0089a75866570952..90be93883e13a74f409f9276321e8b1c47acaf2f 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 
 <?php
 
-@define('CONST_ConnectionBucket_PageType', 'Status');
-
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/ParameterParser.php');
 require_once(CONST_BasePath.'/lib/Status.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/ParameterParser.php');
 require_once(CONST_BasePath.'/lib/Status.php');