============= 一个轻量级的Swoole框架,引入依赖注入和回调绑定,简洁的路由分发,类似phalcon的缓存封装,类似TP的控制器和模型
使用方法:
// 注入redis缓存服务
$di->setShared('redis' , function(){
$redis = new \Swoole\Cache\Redis(array(
'host' => '127.0.0.1',
'port' => 6379,
'lifetime' => 10
));
return $redis;
});
使用方法:
// 注入redis缓存服务
$di->set('redis' , function(){
$redis = new \Swoole\Cache\Redis(array(
'host' => '127.0.0.1',
'port' => 6379,
'lifetime' => 10
));
return $redis;
});