mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
Fix #1619 Upgrade migration, checks if sbas exists before getting connection
This commit is contained in:
@@ -110,15 +110,16 @@ class databox extends base
|
|||||||
assert($sbas_id > 0);
|
assert($sbas_id > 0);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->connection = connection::getPDOConnection($app, $sbas_id);
|
|
||||||
$this->id = $sbas_id;
|
$this->id = $sbas_id;
|
||||||
|
|
||||||
$connection_params = phrasea::sbas_params($this->app);
|
$connection_params = phrasea::sbas_params($this->app);
|
||||||
|
|
||||||
if ( ! isset($connection_params[$sbas_id])) {
|
if (! isset($connection_params[$sbas_id])) {
|
||||||
throw new NotFoundHttpException(sprintf('databox %d not found', $sbas_id));
|
throw new NotFoundHttpException(sprintf('databox %d not found', $sbas_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->connection = connection::getPDOConnection($app, $sbas_id);
|
||||||
|
|
||||||
$this->host = $connection_params[$sbas_id]['host'];
|
$this->host = $connection_params[$sbas_id]['host'];
|
||||||
$this->port = $connection_params[$sbas_id]['port'];
|
$this->port = $connection_params[$sbas_id]['port'];
|
||||||
$this->user = $connection_params[$sbas_id]['user'];
|
$this->user = $connection_params[$sbas_id]['user'];
|
||||||
|
Reference in New Issue
Block a user