Skip to content

Add Lexbor files for URL handling #18656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ ignore:
- "ext/lexbor/lexbor/html"
- "ext/lexbor/lexbor/ns"
- "ext/lexbor/lexbor/ports"
- "ext/lexbor/lexbor/punycode"
- "ext/lexbor/lexbor/tag"
- "ext/lexbor/lexbor/unicode"
- "ext/lexbor/lexbor/url"
- "ext/pcre/pcre2lib"
- "ext/uri/uriparser"
8 changes: 8 additions & 0 deletions ext/lexbor/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ PHP_NEW_EXTENSION([lexbor], m4_normalize([
$LEXBOR_DIR/core/hash.c
$LEXBOR_DIR/core/mem.c
$LEXBOR_DIR/core/mraw.c
$LEXBOR_DIR/core/plog.c
$LEXBOR_DIR/core/print.c
$LEXBOR_DIR/core/serialize.c
$LEXBOR_DIR/core/shs.c
Expand Down Expand Up @@ -174,7 +175,11 @@ PHP_NEW_EXTENSION([lexbor], m4_normalize([
$LEXBOR_DIR/html/tree/open_elements.c
$LEXBOR_DIR/ns/ns.c
$LEXBOR_DIR/ports/posix/lexbor/core/memory.c
$LEXBOR_DIR/punycode/punycode.c
$LEXBOR_DIR/tag/tag.c
$LEXBOR_DIR/unicode/idna.c
$LEXBOR_DIR/unicode/unicode.c
$LEXBOR_DIR/url/url.c
]),
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $PHP_LEXBOR_CFLAGS])
Expand All @@ -193,7 +198,10 @@ PHP_ADD_BUILD_DIR([
$ext_builddir/$LEXBOR_DIR/html/tree/insertion_mode
$ext_builddir/$LEXBOR_DIR/ns
$ext_builddir/$LEXBOR_DIR/ports/posix/lexbor/core
$ext_builddir/$LEXBOR_DIR/punycode
$ext_builddir/$LEXBOR_DIR/tag
$ext_builddir/$LEXBOR_DIR/unicode
$ext_builddir/$LEXBOR_DIR/url
])
PHP_ADD_INCLUDE([$ext_srcdir])
PHP_INSTALL_HEADERS([ext/lexbor], m4_normalize([
Expand Down
5 changes: 4 additions & 1 deletion ext/lexbor/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
EXTENSION("lexbor", "php_lexbor.c", false, "/I " + configure_module_dirname + " /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
PHP_LEXBOR="yes";
ADD_SOURCES("ext/lexbor/lexbor/ports/windows_nt/lexbor/core", "memory.c", "lexbor");
ADD_SOURCES("ext/lexbor/lexbor/core", "array_obj.c array.c avl.c bst.c diyfp.c conv.c dobject.c dtoa.c hash.c mem.c mraw.c print.c serialize.c shs.c str.c strtod.c", "lexbor");
ADD_SOURCES("ext/lexbor/lexbor/core", "array_obj.c array.c avl.c bst.c diyfp.c conv.c dobject.c dtoa.c hash.c mem.c mraw.c plog.c print.c serialize.c shs.c str.c strtod.c", "lexbor");
ADD_SOURCES("ext/lexbor/lexbor/dom", "interface.c", "lexbor");
ADD_SOURCES("ext/lexbor/lexbor/dom/interfaces", "attr.c cdata_section.c character_data.c comment.c document.c document_fragment.c document_type.c element.c node.c processing_instruction.c shadow_root.c text.c", "lexbor");
ADD_SOURCES("ext/lexbor/lexbor/html/tokenizer", "error.c state_comment.c state_doctype.c state_rawtext.c state_rcdata.c state_script.c state.c", "lexbor");
Expand All @@ -17,7 +17,10 @@ ADD_SOURCES("ext/lexbor/lexbor/css/selectors", "state.c selectors.c selector.c p
ADD_SOURCES("ext/lexbor/lexbor/css/syntax", "state.c parser.c syntax.c anb.c tokenizer.c token.c","lexbor");
ADD_SOURCES("ext/lexbor/lexbor/css/syntax/tokenizer", "error.c","lexbor");
ADD_SOURCES("ext/lexbor/lexbor/ns", "ns.c","lexbor");
ADD_SOURCES("ext/lexbor/lexbor/punycode", "punycode.c","lexbor");
ADD_SOURCES("ext/lexbor/lexbor/tag", "tag.c","lexbor");
ADD_SOURCES("ext/lexbor/lexbor/unicode", "idna.c unicode.c","lexbor");
ADD_SOURCES("ext/lexbor/lexbor/url", "url.c","lexbor");
ADD_FLAG("CFLAGS_LEXBOR", "/D LEXBOR_BUILDING /utf-8");

AC_DEFINE("HAVE_LEXBOR", 1, "Define to 1 if the PHP extension 'lexbor' is available.");
Expand Down
30 changes: 30 additions & 0 deletions ext/lexbor/lexbor/punycode/base.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2023-2024 Alexander Borisov
*
* Author: Alexander Borisov <borisov@lexbor.com>
*/

#ifndef LEXBOR_PUNYCODE_BASE_H
#define LEXBOR_PUNYCODE_BASE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "lexbor/core/base.h"


#define LXB_PUNYCODE_VERSION_MAJOR 1
#define LXB_PUNYCODE_VERSION_MINOR 1
#define LXB_PUNYCODE_VERSION_PATCH 0

#define LEXBOR_PUNYCODE_VERSION_STRING LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_MAJOR) "." \
LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_MINOR) "." \
LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_PATCH)


#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* LEXBOR_PUNYCODE_BASE_H */
Loading