Download the PHP package baraja-core/wordpress-post-feed without Composer

On this page you can find all versions of the php package baraja-core/wordpress-post-feed. 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 wordpress-post-feed

BRJ logo
BRJ organisation

Wordpress post feed

API service for downloading a list of new blog posts.

The library downloads the feed of posts from Wordpress and provides a simple API for reading them.

Posts from the feed are automatically cached for a set period of time, so they don't have to be downloaded again in each request.

📦 Installation

It's best to use Composer for installation, and you can also find the package on Packagist and GitHub.

To install, simply use the command:

You can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.

Configuration

If you are installing the package into the Nette Framework, you can simply register the extension:

However, the extension is not required, as you can create an instance manually:

By default, no dependencies are required. Feed will take care of all dependencies by itself.

How to use

Basic usage is simple:

The feed will be downloaded automatically, then cached and further requests will be handled instantly straight from the cache.

If you only need to retrieve some posts from the feed, you can use the limit and offset arguments:

Posts are automatically cached for the set period (default 2 hours). If the period expires, the cache is automatically invalidated and the next request will have to retrieve the data and rebuild the cache. This retrieval may slow down this request. If you want to handle all requests instantly, the cache for the feed needs to be automatically refreshed by cron.

Cron will call the following method to refresh the cache:

Image manipulation

When downloading posts from the feed, images are also automatically downloaded and copied to disk. The image storage is provided by the \Baraja\WordPressPostFeed\ImageStorage service, which is automatically registered by the library. The default directory for storing images is wordpress-post-feed relative to your index.php.

The service provides the following methods:

Method Description
save(string $url): void Downloads the image from the URL and saves it to disk
getInternalPath(string $url): string Returns the absolute path for the internal data store.
getAbsoluteInternalUrl(string $url): string Returns the absolute URL to retrieve the image
getRelativeInternalUrl(string $url): string Returns the relative URL to retrieve the image

Working with images is also available directly from the Post entity via methods:

📄 License

baraja-core/wordpress-post-feed is licensed under the MIT license. See the LICENSE file for more details.


All versions of wordpress-post-feed with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
baraja-core/url Version ^1.0
nette/di Version ^3.0
nette/caching Version ^3.0
ext-curl Version *
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 baraja-core/wordpress-post-feed contains the following files

Loading the files please wait ....