summaryrefslogtreecommitdiff
path: root/ext/dom/php_dom.c
Commit message (Collapse)AuthorAgeFilesLines
* Promote warnings to error in DOM extensionGeorge Peter Banyard2020-09-221-4/+7
| | | | Closes GH-5418
* Accept zend_object in zend_read_propertyNikita Popov2020-08-071-5/+2
|
* Remove proto comments from C filesMax Semenik2020-07-061-2/+1
| | | | Closes GH-5758
* Introduce InternalIteratorNikita Popov2020-06-241-2/+2
| | | | | | | | | | | | | | | | | | | Userland classes that implement Traversable must do so either through Iterator or IteratorAggregate. The same requirement does not exist for internal classes: They can implement the internal get_iterator mechanism, without exposing either the Iterator or IteratorAggregate APIs. This makes them usable in get_iterator(), but incompatible with any Iterator based APIs. A lot of internal classes do this, because exposing the userland APIs is simply a lot of work. This patch alleviates this issue by providing a generic InternalIterator class, which acts as an adapater between get_iterator and Iterator, and can be easily used by many internal classes. At the same time, we extend the requirement that Traversable implies Iterator or IteratorAggregate to internal classes as well. Closes GH-5216.
* Add ZVAL_OBJ_COPY macroNikita Popov2020-06-171-4/+2
| | | | | For the common ZVAL_OBJ + GC_ADDREF pattern. This mirrors the existing ZVAL_STR_COPY API.
* Fix [-Wundef] warning in DOM extensionGeorge Peter Banyard2020-05-161-12/+12
|
* Merge branch 'PHP-7.4'Nikita Popov2020-04-281-23/+0
|\ | | | | | | | | * PHP-7.4: Revert "Fix #79065: DOM classes do not expose properties to Reflection"
| * Revert "Fix #79065: DOM classes do not expose properties to Reflection"Nikita Popov2020-04-281-23/+0
| | | | | | | | | | | | This reverts commit 6bc8f7e5a9949b2ba79376abd1ed13d0b4d0ae3c. This causes an assertion failure in PHPUnit.
* | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-271-0/+23
|\ \ | |/ | | | | | | * PHP-7.4: Fix #79065: DOM classes do not expose properties to Reflection
| * Fix #79065: DOM classes do not expose properties to ReflectionChristoph M. Becker2020-04-271-0/+23
| | | | | | | | | | We add a `get_properties` handler which complements the already existing `has_property` and `read_property`handlers.
* | Generate method entries for ext/domMáté Kocsis2020-04-131-21/+21
| | | | | | | | Closes GH-5374
* | Generate method entries from stubs for a couple of extensionsMáté Kocsis2020-04-111-1/+1
| | | | | | | | Closes GH-5368
* | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-081-2/+9
|\ \ | |/ | | | | | | * PHP-7.4: Fix memory leak introduced by fixing bug #78221
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-04-081-2/+9
| |\ | | | | | | | | | | | | * PHP-7.3: Fix memory leak introduced by fixing bug #78221
| | * Fix memory leak introduced by fixing bug #78221Christoph M. Becker2020-04-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to free the retrieved text content; to keep the code readable, we extract a helper function to check for empty nodes. Unfortunately, we cannot use xmlIsBlankNode(), because that also recognizes whitespace only text content. We also make sure to properly handle NULL returns from xmlNodeGetContent().
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-071-0/+8
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78221: DOMNode::normalize() doesn't remove empty text nodes
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-04-071-0/+8
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78221: DOMNode::normalize() doesn't remove empty text nodes
| | * Fix #78221: DOMNode::normalize() doesn't remove empty text nodesChristoph M. Becker2020-04-071-0/+8
| | | | | | | | | | | | | | | If a text node is not followed by another text node, we remove it, if its textContent is empty.
* | | Generate function entries from stubs for a couple of extensionsMáté Kocsis2020-04-041-6/+1
| | | | | | | | | | | | Closes GH-5347
* | | [RFC] Implement new DOM Living Standard APIs in ext/domBenjamin Eberlei2020-02-281-1/+67
| | |
* | | Rename php_dom_create_interator() to php_dom_create_iterator()Christoph M. Becker2020-02-171-1/+1
| | | | | | | | | | | | Thus fixing an obvious typo.
* | | Use RETURN_THROWS() during ZPP in the date, dba and dom extensionsMáté Kocsis2019-12-311-1/+1
| | |
* | | Convert ext/dom to use arginfo stub.Benjamin Eberlei2019-11-081-6/+1
| | |
* | | ext/dom: Add global registerNodeNS flag on DOMXPath ctor and property.Benjamin Eberlei2019-10-051-0/+2
| | |
* | | Remove most uses of the ERROR typeNikita Popov2019-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is now only used to signal exceptions for property reads. ERROR zvals are never returned back to the VM anymore, so there's no need to check for them when receiving a VAR. Also return MAY_BE_ERROR, as ERROR is now no longer relevant for inference.
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | | | | | | | | | Closes GH-4732.
* | | Cleanup ext/dom: Additional unimplemented code following 25bfac4Benjamin Eberlei2019-09-231-12/+0
| | |
* | | Cleanup ext/dom: Removal of unimplemented dummy classes.Benjamin Eberlei2019-09-171-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following classes were registered in ext/dom but neither documented nor had any behavior (only test data). These classes are now removed: - DOMNameList - DomImplementationList - DOMConfiguration - DomError - DomErrorHandler - DOMImplementationSource - DOMLocator - DOMUserDataHandler - DOMTypeInfo
* | | Refactor zend_object_handlers API to pass zend_object* and zend_string* ↵Dmitry Stogov2019-02-041-36/+31
|/ / | | | | | | insted of zval(s).
* | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| |
* | Implement typed propertiesNikita Popov2019-01-111-2/+4
|/ | | | | | | | | | RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
* Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* Use zval_ptr_dtor() imstead of zval_dtor()Dmitry Stogov2018-07-051-2/+2
|
* Export standard object handlers, to avoid indirect accessDmitry Stogov2018-05-311-9/+5
|
* Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-6/+6
| | | | where we sure about string persistence.
* Keep initialized object_handlers structures in read-only memory.Dmitry Stogov2018-03-141-4/+4
|
* Merge branch 'PHP-7.2'Anatol Belski2018-02-171-1/+0
|\ | | | | | | | | * PHP-7.2: Remove duplicated assignment
| * Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2018-02-171-1/+0
| |\ | | | | | | | | | | | | * PHP-7.1: Remove duplicated assignment
| | * Remove duplicated assignmentAnatol Belski2018-02-171-1/+0
| | |
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
| * | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Make sure properties are initialized before cloningNikita Popov2017-11-251-8/+6
| | | | | | | | | | | | | | | | | | Now that they are not memset, they need to be explicitly intialized, as zend_objects_clone_members() destroys the old property values first.
* | | Add zend_object_alloc() APINikita Popov2017-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using ecalloc() to create objects is expensive, because the dynamic-size memset() is unreasonably slow. Make sure we only zero the main object structure with known size, as the properties are intialized separately anyway. Technically we do not need to zero the embedded zend_object structure either, but as long as the memset argument is constant, a couple more bytes don't really matter.
* | | Use interned strings for "magic" property of internal classes. (not copyied ↵Dmitry Stogov2017-11-011-1/+4
| | | | | | | | | | | | into SHM)
* | | Encapsulate reference-counting primitives.Dmitry Stogov2017-10-271-1/+1
| | | | | | | | | | | | | | | | | | Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead. Added mactros to validate reference-counting (disabled for now). These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
* | | Refactored array creation API. array_init() and array_init_size() are ↵Dmitry Stogov2017-09-201-2/+1
|/ / | | | | | | converted into macros calling zend_new_array(). They are not functions anymore and don't return any values.
* | Implement Countable for DomNodeList and DOMNamedNodeMap (Request #74837)Andreas Treichel2017-07-101-2/+2
| |