Skip to content

Commit 65558b8

Browse files
committed
Sync with upstream: Add ext/uri
1 parent 43746f5 commit 65558b8

File tree

6 files changed

+110
-0
lines changed

6 files changed

+110
-0
lines changed

cmake/ext/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ set_property(
3535
reflection
3636
spl
3737
standard
38+
uri
3839
)
3940

4041
define_property(

cmake/ext/lexbor/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ target_sources(
3838
lexbor/core/hash.c
3939
lexbor/core/mem.c
4040
lexbor/core/mraw.c
41+
lexbor/core/plog.c
4142
lexbor/core/print.c
4243
lexbor/core/serialize.c
4344
lexbor/core/shs.c
@@ -196,7 +197,11 @@ target_sources(
196197
lexbor/ns/ns.c
197198
$<$<NOT:$<PLATFORM_ID:Windows>>:lexbor/ports/posix/lexbor/core/memory.c>
198199
$<$<PLATFORM_ID:Windows>:lexbor/ports/windows_nt/lexbor/core/memory.c>
200+
lexbor/punycode/punycode.c
199201
lexbor/tag/tag.c
202+
lexbor/unicode/idna.c
203+
lexbor/unicode/unicode.c
204+
lexbor/url/url.c
200205
PUBLIC
201206
FILE_SET HEADERS
202207
FILES

cmake/ext/uri/CMakeLists.txt

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#[=============================================================================[
2+
# The uri extension
3+
4+
Configure the `uri` extension.
5+
6+
This extension provides support for URI handling.
7+
#]=============================================================================]
8+
9+
cmake_minimum_required(VERSION 3.25...3.31)
10+
11+
project(
12+
PhpExtensionUri
13+
LANGUAGES C
14+
)
15+
16+
include(FeatureSummary)
17+
18+
add_feature_info(
19+
"ext/uri"
20+
TRUE
21+
"support for URI handling"
22+
)
23+
24+
add_library(php_ext_uri OBJECT)
25+
26+
target_sources(
27+
php_ext_uri
28+
PRIVATE
29+
php_uri.c
30+
php_uri.stub.php
31+
uriparser/src/UriCommon.c
32+
uriparser/src/UriCompare.c
33+
uriparser/src/UriEscape.c
34+
uriparser/src/UriFile.c
35+
uriparser/src/UriIp4.c
36+
uriparser/src/UriIp4Base.c
37+
uriparser/src/UriMemory.c
38+
uriparser/src/UriNormalize.c
39+
uriparser/src/UriNormalizeBase.c
40+
uriparser/src/UriParse.c
41+
uriparser/src/UriParseBase.c
42+
uriparser/src/UriQuery.c
43+
uriparser/src/UriRecompose.c
44+
$<$<NOT:$<PLATFORM_ID:Windows>>:uriparser/src/UriResolve.c>
45+
uriparser/src/UriShorten.c
46+
PUBLIC
47+
FILE_SET HEADERS
48+
FILES
49+
php_uri.h
50+
)
51+
52+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
53+
target_sources(
54+
php_ext_uri
55+
PUBLIC
56+
FILE_SET HEADERS
57+
FILES
58+
uriparser/include/uriparser/Uri.h
59+
uriparser/include/uriparser/UriBase.h
60+
uriparser/include/uriparser/UriDefsAnsi.h
61+
uriparser/include/uriparser/UriDefsConfig.h
62+
uriparser/include/uriparser/UriDefsUnicode.h
63+
uriparser/include/uriparser/UriIp4.h
64+
uriparser/src/UriCommon.h
65+
uriparser/src/UriConfig.h
66+
uriparser/src/UriIp4Base.h
67+
uriparser/src/UriMemory.h
68+
uriparser/src/UriNormalizeBase.h
69+
uriparser/src/UriParseBase.h
70+
)
71+
endif()
72+
73+
target_compile_definitions(
74+
php_ext_uri
75+
PRIVATE
76+
URI_STATIC_BUILD
77+
ZEND_ENABLE_STATIC_TSRMLS_CACHE
78+
)
79+
80+
target_include_directories(
81+
php_ext_uri
82+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/uriparser/include
83+
)
84+
85+
add_dependencies(php_ext_uri php_ext_lexbor)
86+
87+
set(URI_ENABLE_ANSI TRUE)
88+
set(URI_NO_UNICODE TRUE)
89+
90+
configure_file(cmake/config.h.in config.h)

cmake/ext/uri/cmake/config.h.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* Define to 1 for enabling ANSI support of uriparser. */
2+
#cmakedefine URI_ENABLE_ANSI 1
3+
4+
/* Define to 1 for disabling unicode support of uriparser. */
5+
#cmakedefine URI_NO_UNICODE 1

docs/cmake/ext/uri.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- This is auto-generated file. -->
2+
* Source code: [ext/uri/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/uri/CMakeLists.txt)
3+
4+
# The uri extension
5+
6+
Configure the `uri` extension.
7+
8+
This extension provides support for URI handling.

docs/evolution.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ PHP coding standards now use the C11 standard.
941941
50.1 to 57.1.
942942
* Bundled file library in ext/fileinfo upgraded to 5.46.
943943
* Bundled pcre2lib in ext/pcre upgraded from 10.44 to 10.45.
944+
* Added new extensions lexbor and uri as always enabled.
944945
945946
#### Autotools
946947

0 commit comments

Comments
 (0)