Skip to content

Commit 6c9f9de

Browse files
committed
Remove gdbm integration (PHP-8.3)
This follows commit 13986fa because GDBM is licensed under GNU GPL 3, which makes it incompatible in real-case server-based environments. Instead of providing configuration for GDBM, it is easier to simply remove it and provide simpler configuration to the user building/installing software.
1 parent 7ca01bc commit 6c9f9de

File tree

5 files changed

+10
-196
lines changed

5 files changed

+10
-196
lines changed

cmake/cmake/modules/FindDbm.cmake

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Find the dbm library.
66
Depending on the system, the dbm library can be part of other libraries as an
77
interface.
88
9-
* GNU dbm has compatibility interface via gdbm_compatibility
9+
* GNU dbm library (GDBM) has compatibility interface via gdbm_compatibility but
10+
it is licensed as GPL 3, which is incompatible with PHP.
1011
* TODO: Built into default libraries (C): Solaris still has some macros
1112
definitions mapping to internal dbm functions available in the db.h header.
1213
When defining `DB_DBM_HSEARCH` dbm handler is available as built into C
@@ -24,8 +25,6 @@ Module defines the following `IMPORTED` target(s):
2425
* `Dbm_IS_BUILT_IN` - Whether dbm is a part of the C library.
2526
* `Dbm_INCLUDE_DIRS` - Include directories needed to use this package.
2627
* `Dbm_LIBRARIES` - Libraries needed to link to the package library.
27-
* `Dbm_IMPLEMENTATION` - String of the library name that implements the dbm
28-
library.
2928
3029
## Cache variables
3130
@@ -77,7 +76,6 @@ else()
7776
find_path(
7877
Dbm_INCLUDE_DIR
7978
NAMES dbm.h
80-
PATH_SUFFIXES gdbm
8179
DOC "Directory containing dbm library headers"
8280
)
8381

@@ -87,9 +85,7 @@ else()
8785

8886
find_library(
8987
Dbm_LIBRARY
90-
NAMES
91-
gdbm_compat
92-
dbm
88+
NAMES dbm
9389
DOC "The path to the dbm library"
9490
)
9591

@@ -109,12 +105,6 @@ else()
109105
mark_as_advanced(Dbm_INCLUDE_DIR Dbm_LIBRARY)
110106
endif()
111107

112-
if(Dbm_LIBRARY MATCHES "gdbm_compat")
113-
set(Dbm_IMPLEMENTATION "GDBM")
114-
elseif(Dbm_LIBRARY)
115-
set(Dbm_IMPLEMENTATION "DBM")
116-
endif()
117-
118108
find_package_handle_standard_args(
119109
Dbm
120110
REQUIRED_VARS

cmake/cmake/modules/FindGDBM.cmake

Lines changed: 0 additions & 93 deletions
This file was deleted.

cmake/cmake/modules/FindNdbm.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Find the ndbm library.
66
Depending on the system, the nbdm ("new" dbm) can be part of other libraries as
77
an interface.
88
9-
* GNU dbm library (GDBM) has a compatibility interface that provides ndbm.h
10-
header and gdbm_compat library.
9+
* GNU dbm library (GDBM) has compatibility interface via gdbm_compatibility that
10+
provides ndbm.h header but it is licensed as GPL 3, which is incompatible with
11+
PHP.
1112
* Built into default libraries (C): BSD-based systems, macOS, Solaris.
1213
1314
Module defines the following `IMPORTED` target(s):
@@ -83,7 +84,6 @@ else()
8384
Ndbm_LIBRARY
8485
NAMES
8586
ndbm
86-
gdbm_compat
8787
db1
8888
DOC "The path to the ndbm library"
8989
)

cmake/ext/dba/CMakeLists.txt

Lines changed: 4 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ Enable the legacy (original) Berkeley DB style (Database Manager) handler.
6666
6767
Enable the bundled flat-file DBA handler.
6868
69-
## PHP_EXT_DBA_GDBM
70-
71-
* Default: `OFF`
72-
* Values: `ON|OFF`
73-
74-
Enable the GNU dbm (GDBM) handler.
75-
7669
## PHP_EXT_DBA_INIFILE
7770
7871
* Default: `ON`
@@ -218,20 +211,6 @@ add_feature_info(
218211
"bundled flat-file handler"
219212
)
220213

221-
cmake_dependent_option(
222-
PHP_EXT_DBA_GDBM
223-
"DBA: Enable the GNU dbm (GDBM) handler"
224-
OFF
225-
[[PHP_EXT_DBA AND NOT PHP_EXT_DBA_QDBM]]
226-
OFF
227-
)
228-
mark_as_advanced(PHP_EXT_DBA_GDBM)
229-
add_feature_info(
230-
"ext/dba GDBM"
231-
PHP_EXT_DBA_GDBM
232-
"GNU dbm handler"
233-
)
234-
235214
cmake_dependent_option(
236215
PHP_EXT_DBA_INIFILE
237216
"DBA: Enable the bundled INI-file handler"
@@ -277,21 +256,15 @@ cmake_dependent_option(
277256
PHP_EXT_DBA_QDBM
278257
"DBA: Enable the Quick Database Manager (QDBM) handler"
279258
OFF
280-
[[PHP_EXT_DBA AND NOT PHP_EXT_DBA_DBM AND NOT PHP_EXT_DBA_GDBM]]
259+
[[PHP_EXT_DBA AND NOT PHP_EXT_DBA_DBM]]
281260
OFF
282261
)
283262
add_feature_info(
284263
"ext/dba QDBM"
285264
PHP_EXT_DBA_QDBM
286265
"Quick Database Manager handler"
287266
)
288-
if(PHP_EXT_DBA_QDBM AND PHP_EXT_DBA_GDBM)
289-
message(
290-
FATAL_ERROR
291-
"You cannot combine 'PHP_EXT_DBA_GDBM' with 'PHP_EXT_DBA_QDBM'. Please "
292-
"select either GDBM or QDBM."
293-
)
294-
elseif(PHP_EXT_DBA_QDBM AND PHP_EXT_DBA_DBM)
267+
if(PHP_EXT_DBA_QDBM AND PHP_EXT_DBA_DBM)
295268
message(
296269
FATAL_ERROR
297270
"You cannot combine 'PHP_EXT_DBA_DBM' with 'PHP_EXT_DBA_QDBM'. Please "
@@ -452,24 +425,13 @@ if(PHP_EXT_DBA_DBM)
452425
PURPOSE "Necessary to enable the DBM handler in the dba extension."
453426
)
454427

455-
if(Dbm_LIBRARY MATCHES "gdbm")
456-
message(
457-
WARNING
458-
"The GNU dbm (GDBM) library is licensed under the GNU GPL 3, which is "
459-
"not compatible with the PHP license. PHP then shouldn't be distributed. "
460-
"The PHP_EXT_DBA_DBM is a legacy artifact for testing purposes. The "
461-
"recommendation for using and distributing the PHP 'dba' extension is to "
462-
"disable the PHP_EXT_DBA_DBM."
463-
)
464-
endif()
465-
466428
target_link_libraries(php_ext_dba PRIVATE Dbm::Dbm)
467429

468430
target_sources(php_ext_dba PRIVATE dba_dbm.c)
469431

470432
set(DBM_INCLUDE_FILE "<dbm.h>")
471433
set(DBA_DBM TRUE)
472-
set(DBM_VERSION "${Dbm_IMPLEMENTATION}")
434+
set(DBM_VERSION "DBM")
473435
endif()
474436

475437
################################################################################
@@ -486,34 +448,6 @@ if(PHP_EXT_DBA_FLATFILE)
486448
set(DBA_FLATFILE TRUE)
487449
endif()
488450

489-
################################################################################
490-
# GDBM.
491-
################################################################################
492-
if(PHP_EXT_DBA_GDBM)
493-
message(
494-
WARNING
495-
"The GNU dbm (GDBM) library is licensed under the GNU GPL 3, which is not "
496-
"compatible with the PHP license. PHP then shouldn't be distributed. The "
497-
"recommendation for using and distributing the PHP 'dba' extension is to "
498-
"disable PHP_EXT_DBA_GDBM."
499-
)
500-
501-
find_package(GDBM)
502-
set_package_properties(
503-
GDBM
504-
PROPERTIES
505-
TYPE REQUIRED
506-
PURPOSE "Necessary to enable the GDBM handler in the dba extension."
507-
)
508-
509-
target_link_libraries(php_ext_dba PRIVATE GDBM::GDBM)
510-
511-
target_sources(php_ext_dba PRIVATE dba_gdbm.c)
512-
513-
set(GDBM_INCLUDE_FILE "<gdbm.h>")
514-
set(DBA_GDBM TRUE)
515-
endif()
516-
517451
################################################################################
518452
# INI-file.
519453
################################################################################
@@ -560,17 +494,6 @@ if(PHP_EXT_DBA_NDBM)
560494
PURPOSE "Necessary to enable the ndbm handler in the dba extension."
561495
)
562496

563-
if(Ndbm_LIBRARY MATCHES "gdbm")
564-
message(
565-
WARNING
566-
"The GNU dbm (GDBM) library is licensed under the GNU GPL 3, which is "
567-
"not compatible with the PHP license. PHP then shouldn't be distributed. "
568-
"The PHP_EXT_DBA_NDBM is a legacy artifact for testing purposes. The "
569-
"recommendation for using and distributing the PHP 'dba' extension is to "
570-
"disable the PHP_EXT_DBA_NDBM."
571-
)
572-
endif()
573-
574497
target_link_libraries(php_ext_dba PRIVATE Ndbm::Ndbm)
575498

576499
target_sources(php_ext_dba PRIVATE dba_ndbm.c)
@@ -582,7 +505,7 @@ endif()
582505
################################################################################
583506
# QDBM.
584507
################################################################################
585-
if(PHP_EXT_DBA_QDBM AND NOT PHP_EXT_DBA_DBM AND NOT PHP_EXT_DBA_GDBM)
508+
if(PHP_EXT_DBA_QDBM AND NOT PHP_EXT_DBA_DBM)
586509
find_package(QDBM)
587510
set_package_properties(
588511
QDBM

cmake/ext/dba/cmake/config.h.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
/* Define to 1 if the dba extension uses the bundled flatfile handler. */
4545
#cmakedefine DBA_FLATFILE 1
4646

47-
/* Define to 1 if the dba extension uses the GDBM handler. */
48-
#cmakedefine DBA_GDBM 1
49-
5047
/* Define to 1 if the dba extension uses the bundled inifile handler. */
5148
#cmakedefine DBA_INIFILE 1
5249

@@ -68,9 +65,6 @@
6865
/* The DBM handler version information. */
6966
#cmakedefine DBM_VERSION "@DBM_VERSION@"
7067

71-
/* The GDBM handler header file. */
72-
#cmakedefine GDBM_INCLUDE_FILE @GDBM_INCLUDE_FILE@
73-
7468
/* Define to 1 if the PHP extension 'dba' is available. */
7569
#cmakedefine HAVE_DBA 1
7670

0 commit comments

Comments
 (0)