-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Create separate lexbor extension #18538
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
base: master
Are you sure you want to change the base?
Conversation
c2b1e8d
to
6a309fe
Compare
c228b4a
to
accf126
Compare
@cmb69 for Windows maybe? |
I haven't actually checked that (can do later if necessary), but I think we need to install the actual lexbor headers; cf. Line 12 in 4122daa
I think that also needs to be done for POSIX systems, so phpize builds can work. |
Definitely. Also, you need to keep the selectors-adapted directory in ext/dom. Due to technical reasons this is a port of the upstream sources adapted to libxml2, so it has a dependency on libxml. |
I tried to follow what ext/dom did when it used to have the lexbor sources: https://github.com/php/php-src/blob/master/ext/dom/config.w32#L19 it didn't install the lexbor headers, other than putting them on the include path. Nevertheless, I'm trying out the suggestion.
Did I move it accidentally? 🤔 I tried to keep it in place, because I noticed that it was a PHP specific adaptation :) |
1f92120
to
054161b
Compare
ext/lexbor/config.w32
Outdated
@@ -26,5 +26,5 @@ if (PHP_LEXBOR == "yes") { | |||
|
|||
AC_DEFINE("HAVE_LEXBOR", 1, "Define to 1 if the PHP extension 'lexbor' is available."); | |||
|
|||
PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h"); | |||
PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h /"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows is still broken, based on the pcre one that cmb linked, perhaps it must be this?
PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h lexbor/");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, I tried to use exactly lexbor/
, and then I force pushed the current attempt, but they both had the same failures.
Ah sorry I saw it was moved but didn't properly check it is indeed still in dom, thanks! |
c938572
to
78d185b
Compare
@@ -16,27 +16,12 @@ if (PHP_DOM == "yes") { | |||
entityreference.c \ | |||
token_list.c \ | |||
notation.c xpath.c dom_iterators.c \ | |||
namednodemap.c xpath_callbacks.c", null, "-Iext/dom/lexbor"); | |||
namednodemap.c xpath_callbacks.c", null, "/I ext/lexbor"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmb69 Currently, the build fails with the following error:
ext\dom\parentnode\css_selectors.c(26): fatal error C1083: Cannot open include file: 'lexbor/selectors-adapted/selectors.h': No such file or directory
I installed the relevant header file below, but do you think I should add something like -Iext/dom/
here? Please note that previously, the file was in ext/dom/lexbor/lexbor/lexbor-adapted/selectors.h
, and now I removed one level from the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P.S. I wanted to mean -Iext/lexbor/
instead of -Iext/dom/
6d631e1
to
a5072e2
Compare
|
static PHP_MINFO_FUNCTION(lexbor) | ||
{ | ||
php_info_print_table_start(); | ||
php_info_print_table_row(2, "Lexbor support", "active"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense / would it be possible to print the Lexbor version here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering this, but Lexbor has a main version (2.5.0 is the one currently in development), and seperate versions for each component, so I wasn't sure what we want. @nielsdos Do you have any preference for exposing the version information for Lexbor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No real preference. Exposing the main lexbor version is fine by me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented a quick and dirty solution to expose the information, since it changes only ~ once per year, so my assumption is that it's not going to be difficult to maintain the version number in the makefiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also list all of them. PHPInfo is for human rather than programmatic consumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I see the question, it doesn't really matter if the granular version information is also exposed. At least I'm totally fine with the current phpinfo content.
In preparation of php#14461 (https://wiki.php.net/rfc/url_parsing_api)
Co-authored-by: Gina Peter Banyard <[email protected]>
31090dd
to
40bc6a8
Compare
Is it possible to merge this before the URI API vote ends? Doing so would make it a tiny little bit easier for me to rebase #14461. |
I think that should be fine. The vote is very likely to be accepted and this is effectively an internal-only change (except for the fact that users will see an additional extension). In the worst case we revert if the vote fails. |
In preparation of #14461 (https://wiki.php.net/rfc/url_parsing_api)
Windows support is pretty much TBD, as I have no way to test it.