Download the PHP package easyswoole/cache without Composer

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

Coroutine Cache

StyleCI Latest Stable Version Total Downloads License

一个轻量级(PSR-16规范)的缓存实现,目前已支持 File Redis Memcached SwooleTable 四种储存模式

安装

composer require easyswoole/cache

快速开始

支持开箱即用的快速缓存,默认使用File驱动,该驱动可以通用协程与非协程模式,所有内置驱动均以PSR16规范实现,静态调用时默认均为调用default驱动,当没有手动注册default驱动时,默认的default驱动为File驱动

注册驱动

系统提供了四种默认驱动,除文件驱动可以在非Swoole环境使用,其他驱动因使用了Sw相关特性或客户端实现,必须在Swoole环境下使用

文件驱动

文件驱动是最洒脱(无任何依赖通杀所有环节)的驱动,性能较其他驱动相对来说比较低,这里演示文件驱动的注册方法,其他驱动的注册方法一致,只是配置项上会有区别

Redis驱动

该驱动使用Swoole内置的Redis协程客户端,内部已实现自动连接池管理,可以在协程模式下安全的使用

注意: 当一次请求存在多个协程时(比如说手动create了协程),则会为每一个协程都分配一个链接,Memcache驱动也一样,实际上不会影响使用,因为并没有用到事务相关特性:),但需要注意避免创建大量嵌套协程导致瞬间取空连接池

Memcache驱动

以Swoole的协程Client实现了Memcache的TCP二进制驱动,不依赖PHP本身的Memcached驱动和libmemcache,同样需要协程环境,二进制协议仅支持Memcached(即Server)v1.3版本以上

SwooleTable

基于SwooleTable内存表实现的快速内存缓存,注意该缓存暂不支持数据落地,服务停止后缓存数据会立即丢失,适用于做一些计数器类或能容忍缓存重建而不雪崩的一些场景(如储存公众号Token等),由于Table创建时需要立即申请内存,请确保足够的内存,否则会因Table创建失败导致不可用

注意: 由于Swoole进程隔离特性,当使用SwooleTable作为驱动时,需要在Sw的全局期进行驱动的初始化,否则缓存数据会被隔离在各个独立的Worker进程中,另外各配置项受到SwooleTable本身的限制,不能超过本身的限制最大值

关于配置项

配置项均由EasySwoole/Spl/SplBean实现,因此可以链式设置和获取

单元测试

尚未支持单元测试,欢迎提交Pull Request!


All versions of cache with dependencies

PHP Build Version
Package Version
Requires ext-swoole Version ^4.4.0
psr/simple-cache Version ^1.0
easyswoole/component Version ^1.9
opis/closure Version ^3.4
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 easyswoole/cache contains the following files

Loading the files please wait ....