• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

src/H30-Jun-2017-2,374816

tests/H30-Jun-2017-1,046564

.gitignoreH A D30-Jun-2017102 109

.travis.ymlH A D30-Jun-2017463 3527

LICENSEH A D30-Jun-20171.5 KiB3224

README.mdH A D30-Jun-20175.4 KiB162117

build.xmlH A D30-Jun-20173 KiB9277

composer.jsonH A D30-Jun-2017820 2726

fDOMDocument.specH A D30-Jun-20172.5 KiB6350

phpcs.xmlH A D30-Jun-20171.4 KiB4127

phpunit.xml.distH A D30-Jun-2017909 3026

README.md

1fDOMDocument
2============
3
4The classes contained within this repository extend the standard DOM to use exceptions at
5all occasions of errors instead of PHP warnings or notices. They also add various custom methods
6and shortcuts for convenience and to simplify the usage of DOM.
7
8[![Build Status](https://travis-ci.org/theseer/fDOMDocument.png)](https://travis-ci.org/theseer/fDOMDocument)
9
10Requirements
11------------
12
13    PHP: 5.3.3 (5.3.0-5.3.2 had serious issues with spl stacked autoloaders)
14    Extensions: dom, libxml
15
16
17Installation
18------------
19Apart from cloning this repository, fDOMDocument can be installed using by any of the following methods.
20
21##### Composer
22As fDOMDocument is a library and does not provide any cli tools, you can only add it to your own project:
23
24    {
25        "require": {
26            "theseer/fdomdocument": "^1.6"
27        }
28    }
29
30
31##### YUM/DNF (Fedora / Redhat / CentOS)
32The following command will install fDOMDocument via its RPM package:
33
34    sudo yum install php-theseer-fDOMDocument
35
36
37Usage
38-----
39
40fDOMDocument is designed as a drop in replacement for DOMDocument. You can either use the composer generated
41autoloader or the provided one.
42
43Usage Samples
44-------------
45    <?php
46
47    require '/path/to/autoload.php';
48
49    $dom = new TheSeer\fDOM\fDOMDocument();
50    try {
51        $dom->loadXML('<?xml version="1.0" ?><root><child name="foo" /></root>');
52    } catch (fDOMException $e) {
53        die($e);
54    }
55
56    $child = $dom->queryOne('//child');
57    print_r($child->getAttribute('name'));
58    print_r($child->getAttribute('missing','DefaultValue'));
59
60    ?>
61
62Changelog
63---------
64##### Release 1.6.6
65* Merge PRs 33+34: Add support for parameter "asTextNode" to fDOMElement::appendElement().
66  fDOMElement::appendElementNS() and fDOMElement::appendElementPrefix
67
68##### Releaes 1.6.5
69* Revert git exports limitations as they cause unwanted side effects
70
71##### Releaes 1.6.4
72* Merge PR 31 to optimize travis builds and git exports (Thanks to @willemstuursma)
73
74##### Releaes 1.6.3
75* Merge PR 29 to fix issues with PHP 7.2
76
77##### Release 1.6.2
78* Handle empty string warings from PHP
79
80##### Release 1.6.1
81* Added Workaround for [HHVM Issue #5412](https://github.com/facebook/hhvm/issues/5412)
82
83##### Release 1.6.0
84* Added ```createElement*``` to ```fDOMEmenet``` and ```fDOMDocumentFragment``` as shortcuts
85* Added ```appendElement*``` to ```fDOMDocumentFragment``` as shortcuts
86* Enhanced the exception messages of save errors with filenames to contain the filename
87* Fixed fDomDocumentFragment::__toString to actually work
88* Updated / Added some tests
89
90##### Release 1.5.0
91* Added ```select``` to ```fDOMDocument```,```fDOMElement``` and ```fDOMNode``` to support
92  CSS Selectors in favor of XPath only to find nodes
93
94* Added ```query``` and ```queryOne``` forwardes to ```fDOMNode```
95
96##### Release 1.4.3
97* Added ```saveXML``` and ```saveHTML``` to ```fDOMNode``` and ```fDOMElement``` as a
98  shortcut to calling those methods on the ownerDocument
99
100##### Release 1.4.2
101* Added ```__toString``` support to ```fDOMNode```, ```fDOMElement```, ```fDOMDocument``` and ```fDOMDocumentFragment```
102
103##### Release 1.4.1
104* Removed unused Interface ```fDOMNodeInterface``` from code base
105
106##### Release 1.4.0
107* Added XPathQuery helper object, allowing for a prepared statement alike API around XPath
108
109##### Release 1.3.2
110* Added ```__clone``` method to reset domxpath object when domdocument gets cloned (Thanks to Markus Ineichen for pointing it out)
111
112##### Release 1.3.1
113* PHP 5.3 compatibility: changed interal behavior for incompatible changes from PHP 5.3 to 5.4 (Thanks to Jens Graefe for pointing it out)
114
115##### Release 1.3.0
116* Added appendTextNode method (Thanks to Markus Ineichen)
117* Added appendElement / appendElementNS to DOMDocument to support documentElement "creation" (Thanks to Markus Ineichen)
118* Overwrite createElement / createElementNS to throw exception on error
119* Removed fDOMFilter code: Unmaintained and broken in its current form
120* Added (static) Flag for fDOMException to globally enable full exception message
121* Added Unit tests
122
123##### Release 1.2.4
124* PHP 5.4 compatibilty: added support for optional options bitmask on additional methods
125
126##### Release 1.2.3
127* Cleanup code style to adhere coding standard
128* Added entity support for Attributes
129* Added phpcs file to make coding standard public
130
131##### Release 1.2.2
132* Fix Exception to not overwrite final methods of \Exception
133
134##### Release 1.2.1
135* Changed fDOMDocument to be no longer final, use lsb to lookup actual class in constructor.
136  This should fix test/mock issues.
137
138##### Release 1.2.0
139* Changed fException to be more compatible with standard exceptions by adding a switch to get full info by getMessage()
140* Merged setAttributes() and setAttributesNS() methods from Andreas
141* Fixed internal registerNamespace variable mixup
142
143##### Release 1.1.0
144* Renamed files to mimic classname cases
145* Fixed inSameDocument to support DOMDocument as well as DOMNodes
146* Added fDOMXPath class providing queryOne(), qoute() and prepare()
147* Adjusted forwarders in fDOMDocument to make use of new object
148* Fixed various return values to statically return true for compatibility with original API
149* Applied Workaround to fix potential problems with lost references to instances of fDOMDocument
150* Support registerPHPFunctions
151* Bump Copyright
152* Added missing docblocks
153
154##### Release 1.0.2
155* Indenting and typo fixes, minor bugfixes
156
157##### Release 1.0.1
158* Bugfix: typehints corrected
159
160##### Release 1.0.0
161* Initial release
162