More checks on cache returned values.

Switched to Redis in tests.
This commit is contained in:
Benoît Burnichon
2015-06-12 12:09:00 +02:00
parent 4241fd0e6c
commit 43d93eef36
4 changed files with 9 additions and 8 deletions

View File

@@ -420,8 +420,7 @@ class appbox extends base
}
/**
*
* @param <type> $option
* @param string $option
* @return string
*/
public function get_cache_key($option = null)

View File

@@ -100,7 +100,11 @@ class phrasea
{
if (!self::$_bas2sbas) {
try {
self::$_bas2sbas = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_FROM_BAS);
$data = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_FROM_BAS);
if (!$data) {
throw new \Exception('Could not get sbas from cache');
}
self::$_bas2sbas = $data;
} catch (\Exception $e) {
$sql = 'SELECT base_id, sbas_id FROM bas';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);

View File

@@ -18,10 +18,10 @@ main:
path: '/tmp/db.sqlite'
charset: UTF8
cache:
type: MemcacheCache
type: RedisCache
options:
host: localhost
port: 11211
port: 6379
search-engine:
type: elasticsearch
# type: phrasea

View File

@@ -6,8 +6,6 @@
use Alchemy\Phrasea\CLI;
return call_user_func(function (CLI $cli) {
$app = $cli; if ($app['plugins.manager']->isEnabled('web-gallery-plugin')) {
$cli->command(Alchemy\WebGallery\Command\InstallCommand::create()); $cli->command(Alchemy\WebGallery\Command\UninstallCommand::create()); $cli->command(Alchemy\WebGallery\Command\UpdateCommand::create()); }
$app = $cli;
return $cli;
}, $cli);