Download the PHP package inpsyde/wp-stash without Composer

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

WP Stash

WP Stash is a bridge between StashPHP and WP's object caching drop-in support. It enables APCu, Redis, SQLite, Memcached, and Filesystem caches, stampede protection, and group invalidation.

After installing, it will copy an object-cache.php file to wp-content/ which will delegate all cache calls to its mu-plugin folder. From there, it will interface with StashPHP.

Installation

This plugin is a Composer package that will be installed as a wordpress-muplugin. As such, there are a few things to note when attempting to install it. Usually, MU-Plugins are single PHP files, sometimes accompanied by a subfolder containing more code. Since WP-Stash assumes it's living in a subfolder, it contains a lot of other dev-related stuff in its root folder.

For WP to pick up WP-Stash as an MU-Plugin, you have to do one of the following:

Composer

As a first step, simply require the package via composer

Since this package will get installed in a subfolder. WordPress will not automatically load it on its own. The following solutions exist:

WP Starter

If you are using the awesome WP Starter package, then everything will work automatically. It contains an MU-Loader which will take care of loading WP Stash. Note that you MUST NOT use WPStarter's drop-in functionality to copy object-cache.php on build time! WPStash must place the drop-in file on its own. If you want to trigger WP-Stash to create the drop-in file just run a command like wp plugin list.

WP Must-Use Plugin Loader

WP Must-Use Plugin Loader is a standalone composer package that will take care of loading mu-plugins for you. Just require the package and follow the usage instructions from the link to set it up.

Without Composer

Direct upload

You can technically use WP-Stash by simply extracting all files into the wp-content/mu-plugins/ folder. However, this is pretty dirty and we strongly discourage doing so. Instead, please look at the WordPress Codex on MU-Plugins to find solutions for loading mu-plugins from folders.

The easiest solution is to add a wp-content/mu-plugins/wp-stash.php file and put the following in it:

Configuration

You can configure WP Stash globally in the configuration file of your WordPress instance. It is possible to set a Cache Driver and configuration values for it.

Please consult the the StashPHP documentation for information on Driver configuration

The following constants (or environment variables) can be used for configuring WP Stash:

WP_STASH_DRIVER - FQCN: The class name of the Stash driver you want to use. Will fall back to Ephemeral (pure memory cache without persistence) if unset or invalid. Available drivers are:

WP_STASH_DRIVER_ARGS - string: Driver constructor args as a serialized array or JSON.

WP_STASH_IN_MEMORY_CACHE - bool: If enabled, keeps an in-memory version of the cache in sync. This enhances performance during a single request. Default true.

WP_STASH_PURGE_INTERVAL - integer: WP Stash runs scheduled maintenance actions on the configured cache driver every 12 hours by default. You can configure a different interval here. Default 3600*12.

WP_STASH_BYPASS - bool: Allows temporarily disabling WP-Stash and falling back to the core WP system.

Environment variables

If you work with Composer-based environments like WPStarter you might want to use environment variables right away. Here are some examples:

Caching with APC:

Caching to filesystem in the /var/www/cache folder:

Caching to a memcached server at localhost:

Don't cache persistently at all (cache lives only within the script lifetime):

wp-config.php

wp-cli

WP Stash has the following CLI commands:

wp stash flush: An improved version of wp cache flush. This command ensures that wp_cache_flush() is called by the web server, not the CLI process (which might run as a different user, or with a different configuration). This ensures compatibility with all caching back-ends.

wp stash purge: Some drivers require that maintenance action be performed regularly. The FileSystem and SQLite drivers, for example, need to remove old data as they can't do it automatically. While this is automatically performed via WP cron, you can trigger the process manually with this command.

Ensure your persistent cache works as expected

To test if your persistent cache works you can use WP-CLI. First, log in to your WordPress site with your user. Now run the following command in WP-CLI:

This has some limitations and might not work on some server setups depending on whether the web server and your console user are the same.

In that case, you could check if common transients are stored in the cache. First, delete all transients just in case there are some left:

Now clear the cache

Now check for updates (to fill the transient) and request the cache object:

Development

This package ships a DDEV configuration containing a complete WordPress installation.

To get started, run

Then install WordPress with the following command:

Now you can visit https://wp-stash.ddev.site/ and log in:

License and Copyright

This repository is a free software, and is released under the terms of the GNU General Public License version 2 or (at your option) any later version. See LICENSE for complete license.


All versions of wp-stash with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
tedivm/stash Version ^0.17.1
psr/log 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 inpsyde/wp-stash contains the following files

Loading the files please wait ....