| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function register(DiInterface $container) |
||
| 14 | {
|
||
| 15 | $container->setShared( |
||
| 16 | 'session', |
||
| 17 | function () {
|
||
| 18 | $memcache = new \Phalcon\Session\Adapter\Memcache([ |
||
| 19 | 'host' => envValue('DATA_API_MEMCACHED_HOST', '127.0.0.1'),
|
||
| 20 | 'post' => envValue('DATA_API_MEMCACHED_PORT', 11211),
|
||
| 21 | 'lifetime' => 8600, // optional (standard: 8600) |
||
| 22 | 'prefix' => 'baka-api', // optional (standard: [empty_string]), means memcache key is my-app_31231jkfsdfdsfds3 |
||
| 23 | 'persistent' => false, // optional (standard: false) |
||
| 24 | ]); |
||
| 25 | |||
| 26 | $memcache->start(); |
||
| 27 | |||
| 28 | return $memcache; |
||
| 29 | } |
||
| 33 |