Brennen Bearnes
da214d8e51
add an interface to Feed, stub some additional feed types
11 years ago
Michael Bemmerl
30aa109e9a
Trap unparseable date strings.
11 years ago
Michael Bemmerl
2498670c5b
Tabified spaces
11 years ago
Michael Robinson
b86584270e
Add return $this to allow chaining
11 years ago
Michael Bemmerl
2ca6219f8f
Bugfix: Filter atom namespace prefixes also in feed items.
11 years ago
Michael Bemmerl
3769d1e75d
setDate method supports RSS2 feeds now. New method addGenerator for some advertising.
11 years ago
Michael Bemmerl
fecb20f288
Some updates to the setDate method, both to code and documentation.
Since this project requires PHP >= 5.3 anyway, the check for this version is not needed anymore in Item.php.
11 years ago
Michael Bemmerl
cb8e25269f
Some documentation fixes and additions for phpdoc
11 years ago
Michael Bemmerl
cc62d12c2e
Built-in support for author elements in RSS2 feeds.
This was previously already possible by using the custom addElement function.
11 years ago
Michael Bemmerl
f0bcb31422
Added a check for a restriction in the ATOM specification regarding the number of atom:link entites.
11 years ago
Michael Bemmerl
ee8d341505
Implemented function to add multiple custom link elements. This fixes #10 .
11 years ago
Michael Bemmerl
81e7520894
Implemented function to add custom XML namespaces. This fixes #9 .
The namespace prefix and name can be set by invoking the addNamespace method of the Feed class.
11 years ago
Michael Bemmerl
46df278a65
Added support for atom:link elements with relation=self. Fixes #5
See http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
11 years ago
Michael Bemmerl
6c1935f05f
Renamed the getContentType() method.
It's actually the MIME type which is returned and then used for the HTTP Content-Type header field.
12 years ago
Michael Bemmerl
1b1a3d0334
Fixed attribute string: Removed double whitespace between the key-value pairs.
12 years ago
Brennen Bearnes
7182691709
break out feed types; add printFeed(); namespace everything
A minimal set of changes to support PSR-0-style autoloading:
- rename base class to \FeedWriter\Feed and FeedItem to \FeedWriter\Item
- break types out into \FeedWriter\ATOM, \FeedWriter\RSS1, and
\FeedWriter\RSS2
- use class constants for versions
- make generateFeed() return a string rather than doing any IO itself
- add printFeed() to do output, if needed
My rationale for the last 2 items on that list is that our web framework
expects me to pass around strings, not do direct IO. I imagine needing
to grab the output and stash it in a variable or what-have-you is
a common use case, and it felt silly to have to wrap this in an
output buffer to accomplish that.
12 years ago
Michael Bemmerl
4926cd6a1b
Added wrapper classes for each feed type. Fixes #2 .
The FeedWriter class is now abstract, which means it is not possible to directly create an instance of it. Use the new wrapper classes in FeedTypes.php instead. This also obsoletes the constructor's version parameter for end-users.
12 years ago
Michael Bemmerl
f6356d2484
Removed __DIR__ constant for compatibility with PHP < 5.3
12 years ago
Michael Bemmerl
a45095963f
Some data integrity checks on public method addItem():
* Only accept instances of FeedItem
* Only accept instances of FeedItem with the same feed type
12 years ago
Michael Bemmerl
7d1ddfee53
Some small changes:
* Fixed spelling mistakes
* All \n's were replaced by PHP_EOL's
12 years ago
Phil Freo
a9bbe20a94
making feeditem require path absolute
13 years ago
Phil Freo
26918c7707
Using class_exists and require instead of require_once because of performance improvements in relationship to APC.
APC shouldn't have to open files more than once, but it does if you use require_once instead of require. More details here:
http://www.techyouruniverse.com/software/php-performance-tip-require-versus-require_once
13 years ago
Michael Bemmerl
e4f7aad8b7
Encode special chars in XML attributes, which would otherwise break the XML.
13 years ago
Michael Bemmerl
57fc7997d2
Removed the PHP closing braket in FeedItem.php. Otherwise the line ending would be printed when require'ing the FeedItem.php.
14 years ago
Michael Bemmerl
b0cfed933b
Removed superfluous whitespaces.
14 years ago
Michael Bemmerl
18c19ebc2a
Removed duplicated code
14 years ago
Michael Bemmerl
6210aac244
Some cosmetic fixes
14 years ago
Michael Bemmerl
635b6da956
Fixed error message formatting.
14 years ago
Michael Bemmerl
a49324e1d2
Sanitize user input which contains <![CDATA[ ... ]]>, which would otherwise break the XML.
14 years ago
Michael Bemmerl
9e5411ffb4
Reactivated conversion of special chars in non-CDATA tags.
This time using htmlspecialchars instead of htmlentities, because we need a encoding for XML, not for HTML.
14 years ago
Michael Bemmerl
6aa594ad6e
Included FeedItem.php in FeedWriter.php.
So this has now not to be done by the user. Another benefit of this change: The examples do work now. ;-)
14 years ago
Michael Bemmerl
6ebd01341e
Added copyright and license notices (GPL) to all files
14 years ago
Michael Bemmerl
294179725b
Fixed 'Content-Type' header field spelling.
14 years ago
Michael Bemmerl
e850856abc
Fixed some typo's and added comments.
14 years ago
Michael Bemmerl
81452997b7
Set the feed update date for ATOM validity.
(SVN import from repo. "www" @ revision 615, made by "Michi" on Oktober 31, 2010 (02:39:15))
14 years ago
Michael Bemmerl
49e86cdee7
Removed the autoload feature of class FeedWriter.
(SVN import from repo. "www" @ revision 614, made by "Michi" on Oktober 21, 2010 (23:49:49))
14 years ago
Michael Bemmerl
76ac509386
Some fixes for ATOM validity:
* Set the author element of the feed item
* Set a unique identifier (for RSS2 & ATOM)
(SVN import from repo. "www" @ revision 612, made by "Michi" on Oktober 17, 2010 (04:56:08))
14 years ago
Michael Bemmerl
6cfa70371a
Some minor improvements:
* Removed and added some whitespace
* The uuid() function is now static
(SVN import from repo. "www" @ revision 608, made by "Michi" on Oktober 34, 2010 (00:35:59))
14 years ago
Michael Bemmerl
3b49744b2f
Some fixes and improvements:
* Passing of DateTime instances did not work
* The correct Content-Type header (depending on the feed type) is send to the browser.
* Fixed indentation
* Fixed node generation if no attributes available
* Remove last whitespace on attribute generation
(SVN import from repo. "www" @ revision 607, made by "Michi" on Oktober 4, 2010 (00:22:46))
14 years ago
Michael Bemmerl
7dde9536fc
Initial Import of "PHP Universal Feed Generator" made by Anis Ahmad.
The files are taken from the zip file available at Anis' website.
14 years ago