Download the PHP package helick/cache-helpers without Composer

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

Helick Cache Helpers

Helpers for the WordPress object cache and transients.

Latest Version on Packagist Total Downloads Quality Score

Requirements

Make sure all dependencies have been installed before moving on:

Install

Via Composer:

Usage

The package provides the following functions for WordPress:

Each function checks the response of the callback for a WP_Error object, ensuring you're not caching temporary errors for long periods of time. PHP Exceptions will also not be cached.

cache_remember()

Get a value from the object cache, if one doesn't exist, run the given callback to generate and cache the value.

Parameters

(string) $key
The cache key.
(callable) $callback
The callback used to generate and cache the value.
(string) $group
Optional. The cache group. Default is empty.
(int) $expire
Optional. The number of seconds before the cache entry should expire. Default is 0 (as long as possible).

Example

cache_forget()

Get and subsequently delete a value from the object cache.

Parameters

(string) $key
The cache key.
(string) $group
Optional. The cache group. Default is empty.
(mixed) $default
Optional. The default value to return if the given key doesn't exist in the object cache. Default is null.

Example

transient_remember()

Get a value from the transients, if one doesn't exist, run the given callback to generate and cache the value.

Parameters

(string) $key
The cache key.
(callable) $callback
The callback used to generate and cache the value.
(int) $expire
Optional. The number of seconds before the cache entry should expire. Default is 0 (as long as possible).

Example

transient_forget()

Get and subsequently delete a value from the transients.

Parameters

(string) $key
The cache key.
(mixed) $default
Optional. The default value to return if the given key doesn't exist in transients. Default is null.

site_transient_remember()

Get a value from the transients, if one doesn't exist, run the given callback to generate and cache the value.

This function shares arguments and behavior with transient_remember(), but works network-wide when using WordPress Multisite.

Parameters

(string) $key
The cache key.
(mixed) $default
Optional. The default value to return if the given key doesn't exist in transients. Default is null.

site_transient_forget()

Get and subsequently delete a value from the site transients.

This function shares arguments and behavior with transient_forget(), but works network-wide when using WordPress Multisite.

Parameters

(string) $key
The cache key.
(mixed) $default
Optional. The default value to return if the given key doesn't exist in transients. Default is null.

Contributing

Please see CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of cache-helpers with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
composer/installers Version ^1.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 helick/cache-helpers contains the following files

Loading the files please wait ....