Download the PHP package lukaswhite/podcast-feed-validator without Composer
On this page you can find all versions of the php package lukaswhite/podcast-feed-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lukaswhite/podcast-feed-validator
More information about lukaswhite/podcast-feed-validator
Files in lukaswhite/podcast-feed-validator
Package podcast-feed-validator
Short Description A PHP library for validating podcast feeds
License MIT
Informations about the package podcast-feed-validator
Podcast Feed Validator
A PHP library for validating podcast feeds.
Checks the validity of the feed; for example whether it's XML, RSS, whether it has the appropriate namespace.
It warns if certain fields are missing; for example, the fields that iTunes requires.
It also recommends fields that iTunes recommend, but which are not required.
Note that I deliberately haven't added a method to fetch a remote feed, so as not to add additional dependencies; I'd recommend using Guzzle.
Installation
Usage
The Result
The return value is an object that encapsulates the errors, warnings and recommendations.
Each of these are just strings, and are defined as constants in the relevant classes.
Note that typically, if an error has occurred then validation has failed before it starts generating warnings or recommendations. For example if the provided feed isn't XML, then it cannot check for the existence of certain fields.
The result object also includes individual results for the episodes.
Example
Suppose you provide the following XML:
This will return FALSE
:
The following will all return TRUE
:
It will also make recommendations, so the following will also return TRUE
:
For the episode:
See the tests for more information.