Download the PHP package micropackage/cache without Composer

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

Cache

BracketSpace Micropackage Latest Stable Version PHP from Packagist Total Downloads License

Micropackage logo

🧬 About Cache

This micropackage is a wrapper for WordPress cache with two drivers implemented:

It provides a unified, object-oriented way to manipulate WordPress Cache, witch the Cache manipulator object for even easier setting and getting the cache.

💾 Installation

🕹 Usage

Object Cache

Constructing the Object Cache driver:

Group parameter allows you to store the cache under the same key across multiple groups. Default is empty string.

By default the expiration is set to 0 which means the transient never expires.

Available methods

Method Description Returns
Sets the cache key $this
Gets the cache key (string) Cache key
Sets the cache group $this
Gets the cache group (string) Default empty string
Sets the cache expiration in seconds $this
Gets the cache expiration (int) Expiration seconds
Default 0 which means the cache
doesn't expire
Sets the cache void
Sets the cache
only if it wasn't set before
void
Gets the cached value mixed|false
False if not set
Gets the cached value
and updates the local cache
from persistent cache
mixed|false
False if not set
Deletes the cache void

Transient Cache

Constructing the Transient Cache driver:

By default the expiration is set to 0 which means the transient never expires.

Available methods

Method Description Returns
Sets the cache key $this
Gets the cache key (string) Cache key
Sets the cache expiration in seconds $this
Gets the cache expiration (int) Expiration seconds
Default 0 which means the cache
doesn't expire
Sets the cache void
Sets the cache only if it wasn't set before void
Gets the cached value mixed|false
False if not set
Deletes the cache void

Cache manipulator

The Cache manipulator object allows you to use the collect method to easily get/store the cache value.

See the below example with Object Cache (you can pass the Transient Driver as well).

The collect method takes a callable function as an argument. If the cache wasn't set for the key provided in cache construtor, the callable is called which should return the value for cache. The value is stored and returned.

Using variables from outside the callable:

📦 About the Micropackage project

Micropackages - as the name suggests - are micro packages with a tiny bit of reusable code, helpful particularly in WordPress development.

The aim is to have multiple packages which can be put together to create something bigger by defining only the structure.

Micropackages are maintained by BracketSpace.

📖 Changelog

See the changelog file.

📃 License

This software is released under MIT license. See the LICENSE file for more information.


All versions of cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 micropackage/cache contains the following files

Loading the files please wait ....