Download the PHP package snicco/better-wp-cache without Composer

On this page you can find all versions of the php package snicco/better-wp-cache. 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 better-wp-cache

BetterWPCache - A PSR-16/PSR-6 cache implementation using the WordPress object cache

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

BetterWPCache is a tiny library that allows you to use the persistent WordPress object cache as a PSR-16 cache or a PSR-6 cache.

Additionally, BetterWPCache supports cache tagging.

This library is 100% integration tested against the official php-cache/integration-tests using the Redis Object Cache plugin by Till Krüss.

Table of contents

  1. Motivation
  2. Installation
  3. Usage
    1. [Does this work with any caching plugin?]()
    2. PSR-6
    3. PSR-16
    4. Cache Tagging
  4. Contributing
  5. Issues and PR's
  6. Security

Motivation

We developed this library because many WordPress related components of the Snicco project require some form of caching.

To offer the greatest flexibility for users, they all only depend on the PSR cache interfaces.

But using these interfaces' meant that there was no way of using these components inside WordPress with the already connected WP_Object_Cache.

BetterWPCache solves this need.

This library has three main use cases:

  1. You are developing a distributed WordPress library and don't want to depend on the WP_Object_Cache.
  2. You are using any PHP package that depends on the PSR cache interface, and you want to use your WordPress caching plugin for it.
  3. You want cache-tagging, which is something that the WP_Object_Cache does not support.

Ideally, WordPress core would replace the custom WP_Object_Cache with the PSR cache interface instead, so that the need for this library vanishes. In the meantime BetterWPCache will do the job.

Installation

Usage

Does this work with any caching plugin?

Short answer: Yes!

Long answer: As long as your caching plugin correctly implements the wp_cache_xxx functions. This library only uses the official WordPress cache functions.


Creating a PSR-6 cache

This is how you create a PSR-6 cache from your favorite WordPress cache plugin.


Creating a PSR-16 cache

This is how you create a PSR-16 cache from your favorite WordPress cache plugin.


Cache tagging

For cache tagging a PSR-6 cache is needed.

$taggable_cache is an instance of TaggableCacheItemPoolInterface which is in the process of becoming a PSR standard.

Taken from the official documentation:

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability within BetterWPCache, please follow our disclosure procedure.


All versions of better-wp-cache with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
cache/simple-cache-bridge Version ^1.2.0
cache/tag-interop Version ^1.1
cache/taggable-cache Version 1.2.0
psr/cache Version ^1.0.0
psr/simple-cache Version ^1.0.0
snicco/better-wp-api Version ^2.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 snicco/better-wp-cache contains the following files

Loading the files please wait ....