mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 02:47:59 +00:00
probe for php_cgi in cmake to be used for querying
This commit is contained in:
@@ -86,8 +86,19 @@ if (BUILD_API OR BUILD_IMPORTER)
|
||||
# sanity check if PHP binary exists
|
||||
if (NOT EXISTS ${PHP_BIN})
|
||||
message(FATAL_ERROR "PHP binary not found. Install php or provide location with -DPHP_BIN=/path/php ")
|
||||
else()
|
||||
message (STATUS "Using PHP binary " ${PHP_BIN})
|
||||
endif()
|
||||
if (NOT PHPCGI_BIN)
|
||||
find_program (PHPCGI_BIN php-cgi)
|
||||
endif()
|
||||
# sanity check if PHP binary exists
|
||||
if (NOT EXISTS ${PHPCGI_BIN})
|
||||
message(WARNING "php-cgi binary not found. nominatim tool will not provide query functions.")
|
||||
set (PHPCGI_BIN "")
|
||||
else()
|
||||
message (STATUS "Using php-cgi binary " ${PHPCGI_BIN})
|
||||
endif()
|
||||
message (STATUS "Using PHP binary " ${PHP_BIN})
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -11,4 +11,5 @@ from nominatim import cli
|
||||
exit(cli.nominatim(module_dir='@CMAKE_BINARY_DIR@/module',
|
||||
osm2pgsql_path='@CMAKE_BINARY_DIR@/osm2pgsql/osm2pgsql',
|
||||
phplib_dir='@CMAKE_SOURCE_DIR@/lib',
|
||||
data_dir='@CMAKE_SOURCE_DIR@'))
|
||||
data_dir='@CMAKE_SOURCE_DIR@',
|
||||
phpcgi_path='@PHPCGI_BIN@'))
|
||||
|
||||
@@ -435,7 +435,7 @@ class AdminWarm:
|
||||
|
||||
class QueryExport:
|
||||
"""\
|
||||
Export addresses as CSV file from a Nominatim database.
|
||||
Export addresses as CSV file from the database.
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
@@ -522,10 +522,14 @@ def nominatim(**kwargs):
|
||||
parser.add_subcommand('refresh', UpdateRefresh)
|
||||
|
||||
parser.add_subcommand('export', QueryExport)
|
||||
parser.add_subcommand('search', QueryTodo)
|
||||
parser.add_subcommand('reverse', QueryTodo)
|
||||
parser.add_subcommand('lookup', QueryTodo)
|
||||
parser.add_subcommand('details', QueryTodo)
|
||||
parser.add_subcommand('status', QueryTodo)
|
||||
|
||||
if kwargs.get('phpcgi_path'):
|
||||
parser.add_subcommand('search', QueryTodo)
|
||||
parser.add_subcommand('reverse', QueryTodo)
|
||||
parser.add_subcommand('lookup', QueryTodo)
|
||||
parser.add_subcommand('details', QueryTodo)
|
||||
parser.add_subcommand('status', QueryTodo)
|
||||
else:
|
||||
parser.parser.epilog = 'php-cgi not found. Query commands not available.'
|
||||
|
||||
return parser.run(**kwargs)
|
||||
|
||||
Reference in New Issue
Block a user