mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
More checks on cache returned values.
Switched to Redis in tests.
This commit is contained in:
@@ -420,8 +420,7 @@ class appbox extends base
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param <type> $option
|
||||
* @param string $option
|
||||
* @return string
|
||||
*/
|
||||
public function get_cache_key($option = null)
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user