Download the PHP package kargnas/alternative-laravel-cache without Composer

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

What is this?

This is full-featured replacement for Laravel's Redis and file cache storages. All storages support proper tagging. Cache pools provided by http://www.php-cache.com/ + I've added HierarchialFilesystemCachePool based on code of FilesystemCachePool provided by http://www.php-cache.com/. All classes in this lib only proxies between Laravel's cache system and cache pools from http://www.php-cache.com/ and my own pools.

What is proper tagging?

For example you have:

Cache::tags(['tag1', 'tag2'])->put('tag-test1', 'ok', 20);

How Laravel's native cache works with tags and Redis (Laravel 5.2):

Cache::tags(['tag1', 'tag2'])->get('tag-test1');    //< 'ok'
Cache::tags(['tag2', 'tag1'])->get('tag-test1');    //< null
Cache::tags(['tag1'])->get('tag-test1');            //< null
Cache::tags(['tag2'])->get('tag-test1');            //< null
Cache::get('tag-test1');                            //< null
Cache::forget('tag-test1');                         //< won't delete anything
Cache::tags(['tag1', 'tag2'])->forget('tag-test1'); //< deleted
Cache::tags(['tag2', 'tag1'])->forget('tag-test1'); //< won't delete anything
Cache::tags(['tag1'])->forget('tag-test1');         //< won't delete anything
Cache::tags(['tag2'])->forget('tag-test1');         //< won't delete anything
Cache::tags(['tag1'])->flush();                     //< won't delete anything
Cache::tags(['tag2'])->flush();                     //< won't delete anything
Cache::tags(['tag1', 'tag2'])->flush();             //< flushed
Cache::tags(['tag2', 'tag1'])->flush();             //< won't delete anything

If you think that this is correct behavior - go away, you don't need this lib.

How it works with this lib:

Cache::tags(['tag1', 'tag2'])->get('tag-test1');    //< 'ok' - use Cache::get('tag-test1') instead
Cache::tags(['tag2', 'tag1'])->get('tag-test1');    //< 'ok' - use Cache::get('tag-test1') instead
Cache::tags(['tag1'])->get('tag-test1');            //< 'ok' - use Cache::get('tag-test1') instead
Cache::tags(['tag2'])->get('tag-test1');            //< 'ok' - use Cache::get('tag-test1') instead
Cache::get('tag-test1');                            //< 'ok'
Cache::forget('tag-test1');                         //< deleted
Cache::tags(['tag1', 'tag2'])->forget('tag-test1'); //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag2', 'tag1'])->forget('tag-test1'); //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag1'])->forget('tag-test1');         //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag2'])->forget('tag-test1');         //< deleted - use Cache::forget('tag-test1') instead
Cache::tags(['tag1'])->flush();                     //< deleted all cache entries with tag 'tag1'
Cache::tags(['tag2'])->flush();                     //< deleted all cache entries with tag 'tag2'
Cache::tags(['tag1', 'tag2'])->flush();             //< deleted all cache entries with tag 'tag1' or 'tag2'
Cache::tags(['tag2', 'tag1'])->flush();             //< deleted all cache entries with tag 'tag2' or 'tag1'

How to use it:

Add to composer.json:

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/swayok/alternativelaravelcache.git"
    }
],
"require": {
    "swayok/alternativelaravelcache": "master@dev"
}

Add to config/app.php:

$providers = [
    \AlternativeLaravelCache\Provider\AlternativeCacheStoresServiceProvider::class,
]

Notes

By default service provider will replace Laravel's redis and file cache stores. You can alter this behavior like this:

class MyAlternativeCacheStoresServiceProvider extends AlternativeCacheStoresServiceProvider {
    static protected $redisDriverName = 'altredis';
    static protected $fileDriverName = 'altfile';
}

File cache storage currently supports only 'driver' => 'file'. You can extend list of file cache drivers by
overwriting AlternativeCacheStoresServiceProvider->makeFileCacheAdapter()

Yep, there is no tests right now and possibly they will never appear.


All versions of alternative-laravel-cache with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
laravel/framework Version >=5.2
cache/predis-adapter Version ^0.4.0
cache/filesystem-adapter Version ^0.3.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 kargnas/alternative-laravel-cache contains the following files

Loading the files please wait ....