Update appbox

This commit is contained in:
Romain Neutron
2012-09-28 13:47:51 +02:00
parent b559d4a454
commit 9e464aea25
3 changed files with 8 additions and 20 deletions

View File

@@ -180,9 +180,11 @@ class Installer implements ControllerProviderInterface
\setup::rollback($conn, $connbas);
$app['phraseanet.registry'] = $setupRegistry;
try {
$appbox = \appbox::create($app, $setupRegistry, $conn, $appbox_name, $app['phraseanet.appbox'], true);
$appbox = \appbox::create($app, $conn, $appbox_name, $app['phraseanet.appbox'], true);
$configuration = Configuration::build();

View File

@@ -55,26 +55,12 @@ class appbox extends base
const CACHE_LIST_BASES = 'list_bases';
const CACHE_SBAS_IDS = 'sbas_ids';
/**
* Singleton pattern
*
* @return appbox
*/
public static function get_instance(Application $app, registryInterface $registry = null)
{
if (!self::$_instance instanceof self) {
self::$_instance = new static($app, $registry);
}
return self::$_instance;
}
/**
* Constructor
*
* @return appbox
*/
public function __construct(Application $app, registryInterface $registry = null)
public function __construct(Application $app)
{
$this->app = $app;
$this->connection = connection::getPDOConnection($app, null, $app['phraseanet.registry']);
@@ -465,7 +451,7 @@ class appbox extends base
* @param type $write_file
* @return type
*/
public static function create(Application $app, registryInterface $registry, connection_interface $conn, $dbname, Version $version, $write_file = false)
public static function create(Application $app, connection_interface $conn, $dbname, Version $version, $write_file = false)
{
$credentials = $conn->get_credentials();
@@ -487,7 +473,7 @@ class appbox extends base
$connexionINI['driver'] = 'pdo_mysql';
$connexionINI['charset'] = 'UTF8';
$serverName = $registry->get('GV_ServerName');
$serverName = $app['phraseanet.registry']->get('GV_ServerName');
$root = __DIR__ . '/../../';
@@ -550,7 +536,7 @@ class appbox extends base
}
try {
$appbox = static::get_instance($app, $registry);
$appbox = new self($app);
$appbox->insert_datas($version);
} catch (Exception $e) {
throw new Exception('Error while installing ' . $e->getMessage());

View File

@@ -95,7 +95,7 @@ class patch_370a7 implements patchInterface
$spec->setResizeMode(ImageSpec::RESIZE_MODE_INBOUND_FIXEDRATIO);
$spec->setDimensions(375, 275);
$thumbPath = $app['phraseanet.registry']->getRegistry()->get('GV_RootPath') . 'tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']);
$thumbPath = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']);
try {
$app['media-alchemyst']