Php/fuelphp/redis
ナビゲーションに移動
検索に移動
redisを使う
- fuel/app/config/db.php
'redis' => array(
'default' => array(
'hostname' => '127.0.0.1',
'port' => 6379
)
),
- fuel/app/config/cache.php
<?php return array( 'driver' => 'redis', 'expiration' => null, 'cache_id' => 'fuel1', // アプリのunique_idなどをいれておく。 'redis' => array( 'database' => 'default' ), );
- fuel/app/controller/sample/php
try {
$test = Cache::get('test');
} catch (\CacheNotFoundException $e) {
$test = 1;
Cache::set('test', $test);
}
これで動くはずだけど
ErrorException [ Error ]: Call to undefined method Redis::instance()
とでた。なぜ?
(未完成)