Download the PHP package phanan/poddle without Composer

On this page you can find all versions of the php package phanan/poddle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package poddle

Poddle – PHP Podcast Feed Parser Unit Tests

Effortlessly parse podcast feeds in PHP following PSP-1 Podcast RSS Standard.

Requirements and Installation

Poddle requires PHP 8.1 or higher. You can install the library via Composer by running the following command:

Usage

Parse from a URL

To parse a podcast feed from its URL, call the fromUrl method with the feed URL:

This method also accepts two additional parameters:

Parse from XML

If you already have the XML string, you can parse it using Poddle::fromXml instead:

Upon success, both fromUrl and fromXml methods return a Poddle object, which you can use to access the feed's channel and episodes.

Channel

To access the podcast channel, call getChannel on the Poddle object:

All channel's required elements per the PSP-1 standard are available as properties on the Channel object:

All channel’s recommended elements are available via the metadata property:

Episodes

To access the podcast episodes, call getEpisodes on the Poddle object:

By default, getEpisodes will throw an error if any of the episodes is malformed. If you want a more forgiving behavior, pass true into the call to silently ignore the invalid episodes.

This method returns a lazy collection of \PhanAn\Poddle\Values\Episode objects. You can iterate over the collection to access each episode:

All episode's required elements per the PSP-1 standard are available as properties on the Episode object:

All episode's recommended elements are available via the metadata property:

Other Elements and Values

If you need to access other elements or values not covered by the PSP-1 standard, you can make use of the $xmlReader property on the Poddle object:

This property is an instance of Saloon\XmlWrangler\XmlReader and allows you to navigate the XML document directly. For example, to access the feed's lastBuildDate value:

For more information on how to use XmlReader, refer to Saloon\XmlWrangler documentation.

The original feed content is available via the xml property on the Poddle object:

Serialization and Deserialization

All classes under the PhanAn\Poddle\Values namespace implement the \Illuminate\Contracts\Support\Arrayable and \Illuminate\Contracts\Support\Jsonable contracts, which provide two methods:

Additionally, classes like Channel and Episode provide fromArray static methods to create instances from arrays. These methods allow you to easily serialize and deserialize the objects, making it straightforward to store and retrieve the data in a database or JSON file. For instance, you can create an Eloquent custom cast in Laravel this way:

Then, you can use the cast in your Eloquent model:

Possible Questions

Why does Poddle not include element or value X from the feed?

Poddle follows the PSP-1 standard, which specifies the required and recommended elements for a podcast feed. If an element or value is not part of the standard, it is not included in Poddle. However, you can still access any element or value using the xmlReader property as described above.

How come pubDate is not a required element for episodes?

The PSP-1 standard does not require pubDate for episodes, but it is a recommended element. As a result, pubDate is available as part of the episode's metadata as a nullable \DateTime object. It’s up to you to determine if the value always presents and design your system accordingly.

Why is the episode's GUID an object instead of a string?

Per PSP-1 standard, an item’s <guid> element indeed contains a globally unique string value, but it can also have an attribute isPermaLink that indicates whether the GUID is a permalink. As such, the item GUID in Poddle is represented as an object with two public properties: value (string) and isPermaLink (bool). The object, however, implements the __toString method, so you can cast it to a string for convenience.

Where is an episode’s media URL?

The media URL for an episode is available as part of the episode's enclosure property.

Why are the episodes returned as an EpisodeCollection extends LazyCollection object? What’s a lazy collection anyway?

The LazyCollection class leverages PHP's generators to allow you to work with very large datasets while keeping memory usage low. Since a podcast feed can potentially contain a large number of episodes, returning a LazyCollection allows you to iterate over the episodes without loading them all into memory at once, speeding up the process and reducing memory consumption.

Can you support feature X/Y/Z?

Poddle aims to be a lightweight and efficient podcast feed parser that follows the PSP-1 standard, not a full-blown RSS/Atom parser. That said, if you have a feature request or suggestion, feel free to open an issue. Better yet, you can fork the repository, implement the feature yourself, and submit a pull request.


All versions of poddle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
saloonphp/xml-wrangler Version ^1.2
illuminate/collections Version ^10.48|^11.23
illuminate/http Version ^10.48|^11.23
illuminate/support Version ^10.48|^11.23
guzzlehttp/guzzle Version ^7.8
psr/http-client Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phanan/poddle contains the following files

Loading the files please wait ....