Download the PHP package m1/stash-silex without Composer

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

StashSilex

Author Latest Version on Packagist Build Status Coverage Status Quality Score

StashSilex is a Silex service provider and session handler for the popular caching library Stash.

Requirements

StashSilex requires PHP version 5.3+, Silex version 1.* and Stash version 0.11+

Install

Via Composer

Usage

You use the StashServiceProvider to register the service provider with the usual syntax for registering service providers:

There's a few options you can use when registering the service provider.

Pools

You can register either one pool using pool.options or multiple using pools.options, this works like the Doctrine Service Provider.

Registering one pool:

Registering multiple pools:

You can access your pools through $app['pool'] and $app['pools']['the_key_of_your_pool']. If you have multiple pools, then your first pool registered will be available through $app['pool'].

For example, in the above code, the FileSystem pool will be available through $app['pool'] and $app['pools']['fs'].

Drivers

The driver option is based on the class names for the available drivers, see here for the class names defined by Stash. The driver names are case sensitive.

You can set the driver options through options like so:

You can see the full list of the available options for each driver here. The default driver if no driver is defined is the Ephemeral driver.

Logger

You can also set the logger for the pool via the logger option like so:

The logger is monolog due to the MonologServiceProvider populating $app['monolog']. The logger option is a string which your logger service can be accessed through $app.

For example if you decided to not use Monolog through the service provider (not recommended), you can use your custom logger like so:

Sessions

You can choose to handle your sessions through Stash in a couple of different ways.

The first way is via the service provider.

The below creates sessions with defaults:

You can also set the ttl and the session prefix (what namespace it is stored in in stash, more info here) like so:

You can also set the SessionHandler manually via:

Recommendations

Instead of setting the options through an array, think about using a config loader like m1/vars, where you can just load the configuration of your pool(s) via a file like so:

This way makes it so much easier to make small little changes without having to dive into code.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see 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 stash-silex with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
silex/silex Version 1.*
tedivm/stash Version ^0.14
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 m1/stash-silex contains the following files

Loading the files please wait ....