]> git.openstreetmap.org Git - nominatim.git/commitdiff
install executables and call settings.php explicitly
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 8 Mar 2016 23:07:46 +0000 (00:07 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 12 Mar 2016 08:40:43 +0000 (09:40 +0100)
Executables (including websites) need to be installed in the
build directory, so that they can find the right settings.php.
settings now defines build and source dir.

20 files changed:
CMakeLists.txt
lib/init.php
settings/settings.php
utils/blocks.php
utils/country_languages.php
utils/importWikipedia.php
utils/imports.php
utils/query.php
utils/setup.php
utils/specialphrases.php
utils/update.php
utils/warm.php
website/deletable.php
website/details.php
website/hierarchy.php
website/lookup.php
website/polygons.php
website/reverse.php
website/search.php
website/status.php

index a561e020d30a87edc5ce7bea7f1f2de79f73d091..dca35eca4449fe7b7756e9a0282aa779b975ca3c 100644 (file)
@@ -33,6 +33,7 @@ add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
 #-----------------------------------------------------------------------------
 
 set(BUILD_TESTS on)
+set(WITH_LUA off)
 add_subdirectory(osm2pgsql)
 
 find_package(Threads REQUIRED)
@@ -60,19 +61,41 @@ include_directories(${LIBXML2_INCLUDE_DIR})
 #
 #-----------------------------------------------------------------------------
 
-configure_file(
-    ${PROJECT_SOURCE_DIR}/settings/settings.php
-    ${PROJECT_BINARY_DIR}/settings/settings.php
-)
+set(CUSTOMFILES
+    settings/settings.php
+    settings/phrase_settings.php
+    website/deletable.php
+    website/details.php
+    website/hierarchy.php
+    website/lookup.php
+    website/polygons.php
+    website/reverse.php
+    website/search.php
+    website/status.php
+    utils/blocks.php
+    utils/country_languages.php
+    utils/imports.php
+    utils/importWikipedia.php
+    utils/query.php
+    utils/server_compare.php
+    utils/setup.php
+    utils/specialphrases.php
+    utils/update.php
+    utils/warm.php
+   )
+
+foreach (cfile ${CUSTOMFILES})
+    configure_file(${PROJECT_SOURCE_DIR}/${cfile} ${PROJECT_BINARY_DIR}/${cfile})
+endforeach()
+
+set(WEBPATHS css images js)
 
-configure_file(
-    ${PROJECT_SOURCE_DIR}/settings/phrase_settings.php
-    ${PROJECT_BINARY_DIR}/settings/phrase_settings.php
-)
+foreach (wp ${WEBPATHS})
+    execute_process(
+        COMMAND ln -sf ${PROJECT_SOURCE_DIR}/website/${wp} ${PROJECT_BINARY_DIR}/website/
+    )
+endforeach()
 
-execute_process(
-    COMMAND ln -s -t ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/utils
-)
 
 #-----------------------------------------------------------------------------
 #
index db984ef8c4c893bac16f2b42680cb5845f85b78f..26952d05857f4ea9ecb83530ad138d10713e8fe1 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 
-       @define('CONST_BasePath', dirname(dirname(__FILE__)));
-
-       require_once('settings/settings.php');
        require_once(CONST_BasePath.'/lib/lib.php');
        require_once(CONST_BasePath.'/lib/leakybucket.php');
        require_once(CONST_BasePath.'/lib/db.php');
index 93d3a9d5b4cfc5733056ad60541b462bc310f4d8..d48aff7340192b3b9ad4038686e06cd6324545f9 100644 (file)
@@ -1,5 +1,6 @@
 <?php
-       @define('CONST_InstallPath', dirname(dirname(__FILE__)));
+       @define('CONST_BasePath', '@CMAKE_SOURCE_DIR@');
+       @define('CONST_InstallPath', '@CMAKE_BINARY_DIR@');
        if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_InstallPath.'/settings/local.php');
        if (isset($_GET['debug']) && $_GET['debug']) @define('CONST_Debug', true);
 
index bd5efd0014f014c2b3fb50dc2daff4a28c46695c..28c48c588d03a6557c2de446d635034433c3dfc3 100755 (executable)
@@ -1,8 +1,9 @@
 #!/usr/bin/php -Cq
 <?php
 
-        require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
-        ini_set('memory_limit', '800M');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-cmd.php');
+       ini_set('memory_limit', '800M');
 
        $aCMDOptions = array(
                "Manage service blocks / restrictions",
index 7e200e5b4581be78ea29acd1ca6bb4129f835464..5f890083122846eabe1f5e06cdead0997b2a9366 100755 (executable)
@@ -1,7 +1,9 @@
 #!/usr/bin/php -Cq
 <?php
 
-        require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.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');
 
index 6e32ee11be7acb2ade717953ca3985e12a7dbd73..8e527467a8f01c6db1d64982a61c958514f1442f 100755 (executable)
@@ -1,7 +1,8 @@
 #!/usr/bin/php -Cq
 <?php
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-cmd.php');
        ini_set('memory_limit', '800M');
 
        $aCMDOptions = array(
index 70a24963fa57f2f5338174dfe890965f12fb0057..a3a4848e9d0c5eb62031a1690b7b598c115ca44e 100755 (executable)
@@ -1,7 +1,8 @@
 #!/usr/bin/php -Cq
 <?php
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-cmd.php');
        ini_set('memory_limit', '800M');
 
        $aCMDOptions = array(
index b3fdb2683d9bf9f097f322b583e01497badf8edd..9ab23dc308635df8c9fccd05e85432fe676de9f3 100755 (executable)
@@ -1,9 +1,10 @@
 #!/usr/bin/php -Cq
 <?php
 
-    require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
-    require_once(CONST_BasePath.'/lib/Geocode.php');
-    ini_set('memory_limit', '800M');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-cmd.php');
+       require_once(CONST_BasePath.'/lib/Geocode.php');
+       ini_set('memory_limit', '800M');
 
        $aCMDOptions = array(
                "Query database from command line. Returns search result as JSON.",
index 259201bfc1461d649d878c3418c165e59d1e0a7d..31db3d0d377a469a84cecc515fb9877bc5e77da7 100755 (executable)
@@ -1,7 +1,8 @@
 #!/usr/bin/php -Cq
 <?php
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-cmd.php');
        ini_set('memory_limit', '800M');
 
        $aCMDOptions = array(
index 020f5f8004a283547185af43423d36b6e6208444..189a7a3e00fef086a0d002dc69665e6a58c380c3 100755 (executable)
@@ -1,9 +1,10 @@
 #!/usr/bin/php -Cq
 <?php
 
-        require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
-        ini_set('memory_limit', '800M');
-        ini_set('display_errors', 'stderr');
+       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');
 
         $aCMDOptions = array(
                 "Import and export special phrases",
index a91eb30ea1ddb16615d6d2e14cd9a3cb7672fc7e..670273028b98990f7c8b3c596f5e2a03741b43d2 100755 (executable)
@@ -1,8 +1,9 @@
 #!/usr/bin/php -Cq
 <?php
 
-        require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
-        ini_set('memory_limit', '800M');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-cmd.php');
+       ini_set('memory_limit', '800M');
 
        $aCMDOptions = array(
                "Import / update / index osm data",
index 923e2aba12bb572d7b4804598d614ebf9bcbf675..72eac27adf254d0597596a66813bff6539e9a71c 100755 (executable)
@@ -1,8 +1,9 @@
 #!/usr/bin/php -Cq
 <?php
 
-        require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php');
-        ini_set('memory_limit', '800M');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-cmd.php');
+       ini_set('memory_limit', '800M');
 
        $aCMDOptions = array(
                "Tools to warm nominatim db",
index 5d6ee15ddb1bc3dbc6c92c12b2486e481cc040c2..3283bb8300b3e6fbbc2c57d5b4b3fbd03ea84df0 100755 (executable)
@@ -1,5 +1,6 @@
 <?php
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
 
        $sOutputFormat = 'html';
index 3a0fee82a29fb2d70dc9e0b2138dc15e6671a71b..4974717a4b5977452f259af1db586edbc90fdbe1 100755 (executable)
@@ -1,7 +1,8 @@
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Details');
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
 
        $sOutputFormat = 'html';
index de83ca4464a4d3e8f21a333a0be6de28014c02e0..5e3d7299db68d8513d5bbdec3e9b348a828dc995 100755 (executable)
@@ -1,7 +1,8 @@
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Details');
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.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/PlaceLookup.php');
 
index 51abe1f2ed6dd79aa0ad24b5e7edddadd980053f..dfa09d3b7ffe8a84d5fc2484b5633340b0157d1e 100755 (executable)
@@ -1,7 +1,8 @@
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Reverse');
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.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/PlaceLookup.php');
 
index 423374c7a08b6678bc95e38a9046c63606de3ba0..3c98bdbca86030651042b83bc34c4eb52dd8dc13 100755 (executable)
@@ -1,5 +1,6 @@
 <?php
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
 
        $sOutputFormat = 'html';
index d1c554a454352a79914f2f75a4096c182f8fa490..79a950124d8e077f7ed98418d18073d73ddec9fd 100755 (executable)
@@ -1,7 +1,8 @@
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Reverse');
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.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/PlaceLookup.php');
        require_once(CONST_BasePath.'/lib/ReverseGeocode.php');
index c216c8848c3a07063fd448e92d1a2222ba1da2fa..497ff598359821bdae0c3117a7c5b8efbde6ae86 100755 (executable)
@@ -1,7 +1,8 @@
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Search');
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.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/Geocode.php');
 
index 832f4600c60032c2913fdcd78d8615c5677717f9..f4e696a4014263cd201c3c4292a977bc8d287f1a 100644 (file)
@@ -1,7 +1,8 @@
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Status');
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-website.php');
 
        function statusError($sMsg)
        {