Skip to content
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

'xmlreader' PHP extension has limited functionality when 'dom' extension only modular #477

Closed
Repkit opened this issue Mar 20, 2017 · 3 comments
Assignees

Comments

@Repkit
Copy link

Repkit commented Mar 20, 2017

It seems that the PHP package is compiled without DOM extension enabled and if you enable it afterwards it doesn't matter.
The problem seems to be https://github.com/php/php-src/blob/PHP-7.0/ext/xmlreader/php_xmlreader.c
At line 30 (https://github.com/php/php-src/blob/PHP-7.0/ext/xmlreader/php_xmlreader.c#L30) it's verify for DOM support and loading stuff. At line 1121 (https://github.com/php/php-src/blob/PHP-7.0/ext/xmlreader/php_xmlreader.c#L1121) the method "expand" raise an error if HAVE_DOM doesn't exists (it's not included) - php_error(E_WARNING, "DOM support is not enabled"); . From my understanding HAVE_DOM is set only when the pacakge is compiled with DOM (https://github.com/php/php-src/blob/6053987bc27e8dede37f437193a5cad448f99bce/ext/dom/config.m4) If the extension is added/enabled after it doesn't count...

@mamash
Copy link

mamash commented Mar 20, 2017

Ignore my previous response, I had another look and it wasn't clear at all from your report that the problem seems to be that the xmlreader compiles differently (namely XMLReader::expand is lost) if the dom extension is not configured too at the same time.

I don't see a good way around this at this point, the checks for dom defeat the whole purpose of being able to build a modular PHP stack.

@mamash
Copy link

mamash commented Mar 25, 2017

I plan to change pkgsrc to build the dom extension embedded, as there's no extra dependency cost (libxml is already being consumed, anyway). pkgsrc is in 2017Q1 freeze right now, so I'll make this change in a week or so.

@mamash mamash self-assigned this Mar 25, 2017
@mamash mamash changed the title php_error(E_WARNING, "DOM support is not enabled"); 'xmlreader' PHP extension has limited functionality when 'dom' extension only modular Apr 1, 2017
@mamash
Copy link

mamash commented Apr 5, 2017

I made the changes necessary in pkgsrc trunk today: the 'dom' extension now builds into the PHP binary, rather than as a standalone extension. I couldn't find any other check where one extension would require another one (that was not there in some way already).

The commits involved make this a non-trivial change, we won't be bringing it back into existing pkgsrc releases, so 2017Q2 will be the first to have it (end of Q2).

For the record, fixing this the other way around (making both dom and xmlreader separate) worked too, but it was more difficult at the end and didn't feel worth it.

jsonn referenced this issue in jsonn/pkgsrc Apr 12, 2017
lang/php56: build fix
lang/php70: build fix
lang/php71: build fix

Revisions pulled up:
- lang/php56/Makefile                                           1.13
- lang/php56/Makefile.php                                       1.2
- lang/php56/PLIST                                              1.3
- lang/php56/distinfo                                           1.41
- lang/php56/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php70/Makefile                                           1.6
- lang/php70/Makefile.php                                       1.3
- lang/php70/PLIST                                              1.3
- lang/php70/distinfo                                           1.31
- lang/php70/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php71/Makefile                                           1.9
- lang/php71/Makefile.php                                       1.2
- lang/php71/PLIST                                              1.3
- lang/php71/distinfo                                           1.17
- lang/php71/patches/patch-ext_xsl_php__xsl.h                   1.1
- textproc/Makefile                                             1.918
- textproc/php-dom/DESCR                                        deleted
- textproc/php-dom/Makefile                                     deleted

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:28:59 UTC 2017

   Modified Files:
           pkgsrc/lang/php56: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php70: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php71: Makefile Makefile.php PLIST distinfo
   Added Files:
           pkgsrc/lang/php56/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php70/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php71/patches: patch-ext_xsl_php__xsl.h

   Log Message:
   Build the dom extension embedded. This enables full functionality in xmlreader and fixes joyent/pkgsrc/issues/477. Bump PKREVISION.

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:34:47 UTC 2017

   Modified Files:
           pkgsrc/textproc: Makefile
   Removed Files:
           pkgsrc/textproc/php-dom: DESCR Makefile

   Log Message:
   Remove textproc/php-dom, the module is now built into the resp. PHP packages.
netbsd-srcmastr referenced this issue in NetBSD/pkgsrc Apr 18, 2017
lang/php56: build fix
lang/php70: build fix
lang/php71: build fix

Revisions pulled up:
- lang/php56/Makefile                                           1.13
- lang/php56/Makefile.php                                       1.2
- lang/php56/PLIST                                              1.3
- lang/php56/distinfo                                           1.41
- lang/php56/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php70/Makefile                                           1.6
- lang/php70/Makefile.php                                       1.3
- lang/php70/PLIST                                              1.3
- lang/php70/distinfo                                           1.31
- lang/php70/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php71/Makefile                                           1.9
- lang/php71/Makefile.php                                       1.2
- lang/php71/PLIST                                              1.3
- lang/php71/distinfo                                           1.17
- lang/php71/patches/patch-ext_xsl_php__xsl.h                   1.1
- textproc/Makefile                                             1.918
- textproc/php-dom/DESCR                                        deleted
- textproc/php-dom/Makefile                                     deleted

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:28:59 UTC 2017

   Modified Files:
           pkgsrc/lang/php56: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php70: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php71: Makefile Makefile.php PLIST distinfo
   Added Files:
           pkgsrc/lang/php56/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php70/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php71/patches: patch-ext_xsl_php__xsl.h

   Log Message:
   Build the dom extension embedded. This enables full functionality in xmlreader and fixes joyent/pkgsrc/issues/477. Bump PKREVISION.

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:34:47 UTC 2017

   Modified Files:
           pkgsrc/textproc: Makefile
   Removed Files:
           pkgsrc/textproc/php-dom: DESCR Makefile

   Log Message:
   Remove textproc/php-dom, the module is now built into the resp. PHP packages.
netbsd-srcmastr referenced this issue in NetBSD/pkgsrc Jun 9, 2017
lang/php56: build fix
lang/php70: build fix
lang/php71: build fix

Revisions pulled up:
- lang/php56/Makefile                                           1.13
- lang/php56/Makefile.php                                       1.2
- lang/php56/PLIST                                              1.3
- lang/php56/distinfo                                           1.41
- lang/php56/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php70/Makefile                                           1.6
- lang/php70/Makefile.php                                       1.3
- lang/php70/PLIST                                              1.3
- lang/php70/distinfo                                           1.31
- lang/php70/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php71/Makefile                                           1.9
- lang/php71/Makefile.php                                       1.2
- lang/php71/PLIST                                              1.3
- lang/php71/distinfo                                           1.17
- lang/php71/patches/patch-ext_xsl_php__xsl.h                   1.1
- textproc/Makefile                                             1.918
- textproc/php-dom/DESCR                                        deleted
- textproc/php-dom/Makefile                                     deleted

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:28:59 UTC 2017

   Modified Files:
           pkgsrc/lang/php56: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php70: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php71: Makefile Makefile.php PLIST distinfo
   Added Files:
           pkgsrc/lang/php56/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php70/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php71/patches: patch-ext_xsl_php__xsl.h

   Log Message:
   Build the dom extension embedded. This enables full functionality in xmlreader and fixes joyent/pkgsrc/issues/477. Bump PKREVISION.

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:34:47 UTC 2017

   Modified Files:
           pkgsrc/textproc: Makefile
   Removed Files:
           pkgsrc/textproc/php-dom: DESCR Makefile

   Log Message:
   Remove textproc/php-dom, the module is now built into the resp. PHP packages.
jperkin pushed a commit that referenced this issue Jun 13, 2017
== Version 2.6.6 - 2017-06-09 Jeremy Daer <jeremydaer@gmail.com>

Security:
* #1097 – SMTP security: prevent command injection via To/From
   addresses. (jeremy)

Bugs:
* #689 - Fix Exim delivery method broken by #477 in 2.5.4. (jethrogb)
jperkin pushed a commit that referenced this issue Jun 13, 2017
== Version 2.5.5 - 2017-06-09 Jeremy Daer <jeremydaer@gmail.com>

Security:
* #1097 – SMTP security: prevent command injection via To/From
   addresses. (jeremy)

Bugs:
* #633 – Cope with message parts that have an empty Content-Type
   (ThomasKoppensteiner, zeepeeare)
* #689 - Fix Exim delivery method broken by #477 in 2.5.4. (jethrogb)
netbsd-srcmastr referenced this issue in NetBSD/pkgsrc Jun 22, 2017
lang/php56: build fix
lang/php70: build fix
lang/php71: build fix

Revisions pulled up:
- lang/php56/Makefile                                           1.13
- lang/php56/Makefile.php                                       1.2
- lang/php56/PLIST                                              1.3
- lang/php56/distinfo                                           1.41
- lang/php56/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php70/Makefile                                           1.6
- lang/php70/Makefile.php                                       1.3
- lang/php70/PLIST                                              1.3
- lang/php70/distinfo                                           1.31
- lang/php70/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php71/Makefile                                           1.9
- lang/php71/Makefile.php                                       1.2
- lang/php71/PLIST                                              1.3
- lang/php71/distinfo                                           1.17
- lang/php71/patches/patch-ext_xsl_php__xsl.h                   1.1
- textproc/Makefile                                             1.918
- textproc/php-dom/DESCR                                        deleted
- textproc/php-dom/Makefile                                     deleted

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:28:59 UTC 2017

   Modified Files:
           pkgsrc/lang/php56: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php70: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php71: Makefile Makefile.php PLIST distinfo
   Added Files:
           pkgsrc/lang/php56/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php70/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php71/patches: patch-ext_xsl_php__xsl.h

   Log Message:
   Build the dom extension embedded. This enables full functionality in xmlreader and fixes joyent/pkgsrc/issues/477. Bump PKREVISION.

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:34:47 UTC 2017

   Modified Files:
           pkgsrc/textproc: Makefile
   Removed Files:
           pkgsrc/textproc/php-dom: DESCR Makefile

   Log Message:
   Remove textproc/php-dom, the module is now built into the resp. PHP packages.
jsonn referenced this issue in jsonn/pkgsrc Jun 22, 2017
lang/php56: build fix
lang/php70: build fix
lang/php71: build fix

Revisions pulled up:
- lang/php56/Makefile                                           1.13
- lang/php56/Makefile.php                                       1.2
- lang/php56/PLIST                                              1.3
- lang/php56/distinfo                                           1.41
- lang/php56/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php70/Makefile                                           1.6
- lang/php70/Makefile.php                                       1.3
- lang/php70/PLIST                                              1.3
- lang/php70/distinfo                                           1.31
- lang/php70/patches/patch-ext_xsl_php__xsl.h                   1.1
- lang/php71/Makefile                                           1.9
- lang/php71/Makefile.php                                       1.2
- lang/php71/PLIST                                              1.3
- lang/php71/distinfo                                           1.17
- lang/php71/patches/patch-ext_xsl_php__xsl.h                   1.1
- textproc/Makefile                                             1.918
- textproc/php-dom/DESCR                                        deleted
- textproc/php-dom/Makefile                                     deleted

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:28:59 UTC 2017

   Modified Files:
           pkgsrc/lang/php56: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php70: Makefile Makefile.php PLIST distinfo
           pkgsrc/lang/php71: Makefile Makefile.php PLIST distinfo
   Added Files:
           pkgsrc/lang/php56/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php70/patches: patch-ext_xsl_php__xsl.h
           pkgsrc/lang/php71/patches: patch-ext_xsl_php__xsl.h

   Log Message:
   Build the dom extension embedded. This enables full functionality in xmlreader and fixes joyent/pkgsrc/issues/477. Bump PKREVISION.

---
   Module Name:    pkgsrc
   Committed By:   fhajny
   Date:           Wed Apr  5 12:34:47 UTC 2017

   Modified Files:
           pkgsrc/textproc: Makefile
   Removed Files:
           pkgsrc/textproc/php-dom: DESCR Makefile

   Log Message:
   Remove textproc/php-dom, the module is now built into the resp. PHP packages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants