Avoid errors by explicitely namespacing root exception

This commit is contained in:
Romain Neutron
2014-02-20 11:28:31 +01:00
parent fab9a64ae0
commit 2af21c064c
73 changed files with 164 additions and 164 deletions

View File

@@ -457,7 +457,7 @@ class Basket
$totSize += $basket_element->getRecord($app) $totSize += $basket_element->getRecord($app)
->get_subdef('document') ->get_subdef('document')
->get_size(); ->get_size();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }

View File

@@ -240,7 +240,7 @@ class ACL implements cache_cacheableInterface
$subdef_class = $record->get_databox()->get_subdef_structure() $subdef_class = $record->get_databox()->get_subdef_structure()
->get_subdef($record->get_type(), $subdef_name) ->get_subdef($record->get_type(), $subdef_name)
->get_class(); ->get_class();
} catch (Exception $e) { } catch (\Exception $e) {
return false; return false;
} }
@@ -748,7 +748,7 @@ class ACL implements cache_cacheableInterface
try { try {
$ret[$sbas_id] = $this->app['phraseanet.appbox']->get_databox((int) $sbas_id); $ret[$sbas_id] = $this->app['phraseanet.appbox']->get_databox((int) $sbas_id);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -799,7 +799,7 @@ class ACL implements cache_cacheableInterface
$this->_rights_records_document = $tmp_rights['document']; $this->_rights_records_document = $tmp_rights['document'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }
$sql = 'SELECT sbas_id, record_id, preview, document $sql = 'SELECT sbas_id, record_id, preview, document
@@ -841,7 +841,7 @@ class ACL implements cache_cacheableInterface
$this->is_admin = $this->get_data_from_cache(self::CACHE_IS_ADMIN); $this->is_admin = $this->get_data_from_cache(self::CACHE_IS_ADMIN);
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }
$sql = 'SELECT create_db $sql = 'SELECT create_db
@@ -935,7 +935,7 @@ class ACL implements cache_cacheableInterface
$this->_limited = $this->get_data_from_cache(self::CACHE_LIMITS_BAS); $this->_limited = $this->get_data_from_cache(self::CACHE_LIMITS_BAS);
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -192,7 +192,7 @@ class API_OAuth2_Adapter extends OAuth2
} }
return ($application->get_client_secret() === $client_secret); return ($application->get_client_secret() === $client_secret);
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -237,7 +237,7 @@ class API_OAuth2_Adapter extends OAuth2
, 'oauth_token' => $token->get_value() , 'oauth_token' => $token->get_value()
); );
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -306,7 +306,7 @@ class API_OAuth2_Adapter extends OAuth2
, 'expires' => $code->get_expires() , 'expires' => $code->get_expires()
, 'account_id' => $code->get_account()->get_id() , 'account_id' => $code->get_account()->get_id()
); );
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -357,7 +357,7 @@ class API_OAuth2_Adapter extends OAuth2
, 'expires' => $token->get_expires()->format('U') , 'expires' => $token->get_expires()->format('U')
, 'client_id' => $token->get_account()->get_application()->get_client_id() , 'client_id' => $token->get_account()->get_application()->get_client_id()
); );
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -519,7 +519,7 @@ class API_OAuth2_Adapter extends OAuth2
try { try {
$user = User_Adapter::getInstance($usr_id, $this->app); $user = User_Adapter::getInstance($usr_id, $this->app);
$account = API_OAuth2_Account::load_with_user($this->app, $this->client, $user); $account = API_OAuth2_Account::load_with_user($this->app, $this->client, $user);
} catch (Exception $e) { } catch (\Exception $e) {
$account = $this->createAccount($usr_id); $account = $this->createAccount($usr_id);
} }
@@ -586,7 +586,7 @@ class API_OAuth2_Adapter extends OAuth2
$token->set_session_id($ses_id); $token->set_session_id($ses_id);
return true; return true;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -1101,7 +1101,7 @@ class API_V1_adapter extends API_V1_Abstract
$record->set_metadatas($metadatas); $record->set_metadatas($metadatas);
$result->set_datas(array("record_metadatas" => $this->list_record_caption($record->get_caption()))); $result->set_datas(array("record_metadatas" => $this->list_record_caption($record->get_caption())));
} catch (Exception $e) { } catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured')); $result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
} }
@@ -1147,7 +1147,7 @@ class API_V1_adapter extends API_V1_Abstract
$this->list_record_status($databox, $record->get_status()) $this->list_record_status($databox, $record->get_status())
) )
); );
} catch (Exception $e) { } catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured')); $result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
} }
@@ -1173,7 +1173,7 @@ class API_V1_adapter extends API_V1_Abstract
$record->move_to_collection($collection, $this->app['phraseanet.appbox']); $record->move_to_collection($collection, $this->app['phraseanet.appbox']);
$result->set_datas(array("record" => $this->list_record($record))); $result->set_datas(array("record" => $this->list_record($record)));
} catch (Exception $e) { } catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $e->getMessage()); $result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, $e->getMessage());
} }
@@ -1197,7 +1197,7 @@ class API_V1_adapter extends API_V1_Abstract
$result->set_datas(array('record' => $this->list_record($record))); $result->set_datas(array('record' => $this->list_record($record)));
} catch (NotFoundHttpException $e) { } catch (NotFoundHttpException $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('Record Not Found')); $result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('Record Not Found'));
} catch (Exception $e) { } catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured')); $result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
} }
@@ -1221,7 +1221,7 @@ class API_V1_adapter extends API_V1_Abstract
$result->set_datas(array('story' => $this->list_story($story))); $result->set_datas(array('story' => $this->list_story($story)));
} catch (NotFoundHttpException $e) { } catch (NotFoundHttpException $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('Story Not Found')); $result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('Story Not Found'));
} catch (Exception $e) { } catch (\Exception $e) {
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured')); $result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
} }

View File

@@ -334,7 +334,7 @@ class Bridge_Account
if ( ! isset($apis[$api_id])) { if ( ! isset($apis[$api_id])) {
try { try {
$apis[$api_id] = new Bridge_Api($app, $api_id); $apis[$api_id] = new Bridge_Api($app, $api_id);
} catch (Exception $e) { } catch (\Exception $e) {
continue; continue;
} }
} }

View File

@@ -436,7 +436,7 @@ class Bridge_Api
$ret = $action($this); $ret = $action($this);
return $ret; return $ret;
} catch (Exception $e) { } catch (\Exception $e) {
$this->get_connector()->handle_Exception($e); $this->get_connector()->handle_Exception($e);
if ($e instanceof Bridge_Exception_ActionAuthNeedReconnect) { if ($e instanceof Bridge_Exception_ActionAuthNeedReconnect) {
@@ -532,7 +532,7 @@ class Bridge_Api
foreach ($rs as $row) { foreach ($rs as $row) {
try { try {
$results[] = new Bridge_Api($app, $row['id']); $results[] = new Bridge_Api($app, $row['id']);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }

View File

@@ -469,7 +469,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
$this->get_element_from_id($ticket["dist_id"], $element->get_type()); $this->get_element_from_id($ticket["dist_id"], $element->get_type());
$element->set_dist_id($ticket["dist_id"]); $element->set_dist_id($ticket["dist_id"]);
} }
} catch (Exception $e) { } catch (\Exception $e) {
return self::UPLOAD_STATE_FAILED; return self::UPLOAD_STATE_FAILED;
} }

View File

@@ -301,7 +301,7 @@ class Bridge_Element
if (! $this->connector_element) { if (! $this->connector_element) {
try { try {
$this->connector_element = $this->account->get_api()->get_element_from_id($this->dist_id, $this->type); $this->connector_element = $this->account->get_api()->get_element_from_id($this->dist_id, $this->type);
} catch (Exception $e) { } catch (\Exception $e) {
return null; return null;
} }
} }

View File

@@ -83,7 +83,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
$this->public = $datas['public']; $this->public = $datas['public'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -476,7 +476,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
{ {
try { try {
return $this->get_data_from_cache(self::CACHE_ENTRY_NUMBER); return $this->get_data_from_cache(self::CACHE_ENTRY_NUMBER);
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -619,7 +619,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
if (!$renew) { if (!$renew) {
return $this->get_data_from_cache($cache_key); return $this->get_data_from_cache($cache_key);
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -122,7 +122,7 @@ class Feed_Collection implements Feed_CollectionInterface, cache_cacheableInterf
try { try {
return $appbox->get_data_from_cache($key); return $appbox->get_data_from_cache($key);
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -130,7 +130,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
$this->created_on = $datas['created_on']; $this->created_on = $datas['created_on'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -467,7 +467,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
{ {
try { try {
return $this->get_data_from_cache(self::CACHE_ELEMENTS); return $this->get_data_from_cache(self::CACHE_ELEMENTS);
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -85,7 +85,7 @@ class Feed_Entry_Item implements Feed_Entry_ItemInterface, cache_cacheableInterf
$this->ord = $datas['ord']; $this->ord = $datas['ord'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -85,7 +85,7 @@ class Feed_Publisher_Adapter implements Feed_Publisher_Interface, cache_cacheabl
$this->owner = $datas['owner']; $this->owner = $datas['owner'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -370,7 +370,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
try { try {
self::$_instance[$id] = $app['phraseanet.appbox']->get_data_from_cache('_user_' . $id); self::$_instance[$id] = $app['phraseanet.appbox']->get_data_from_cache('_user_' . $id);
self::$_instance[$id]->set_app($app); self::$_instance[$id]->set_app($app);
} catch (Exception $e) { } catch (\Exception $e) {
self::$_instance[$id] = new self($id, $app); self::$_instance[$id] = new self($id, $app);
$app['phraseanet.appbox']->set_data_to_cache(self::$_instance[$id], '_user_' . $id); $app['phraseanet.appbox']->set_data_to_cache(self::$_instance[$id], '_user_' . $id);
} }
@@ -517,7 +517,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
if ($app['authentication']->getUser()->getPrefs('start_page') == 'LAST_QUERY') if ($app['authentication']->getUser()->getPrefs('start_page') == 'LAST_QUERY')
$app['authentication']->getUser()->setPrefs('start_page_query', $query); $app['authentication']->getUser()->setPrefs('start_page_query', $query);
} catch (Exception $e) { } catch (\Exception $e) {
return false; return false;
} }
@@ -1421,7 +1421,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
':value' => $value ':value' => $value
)); ));
$this->delete_data_from_cache(); $this->delete_data_from_cache();
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -1596,7 +1596,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$stmt = $connbas->prepare($sql); $stmt = $connbas->prepare($sql);
$stmt->execute($params); $stmt->execute($params);
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -1639,7 +1639,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$stmt->closeCursor(); $stmt->closeCursor();
return true; return true;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -446,7 +446,7 @@ class appbox extends base
{ {
try { try {
return $this->get_data_from_cache(self::CACHE_SBAS_IDS); return $this->get_data_from_cache(self::CACHE_SBAS_IDS);
} catch (Exception $e) { } catch (\Exception $e) {
} }
$sql = 'SELECT sbas_id FROM sbas'; $sql = 'SELECT sbas_id FROM sbas';

View File

@@ -296,7 +296,7 @@ abstract class base implements cache_cacheableInterface
$stmt = $this->get_connection()->prepare($sql); $stmt = $this->get_connection()->prepare($sql);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
$recommends[] = array( $recommends[] = array(
'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()),
'sql' => $sql 'sql' => $sql
@@ -352,7 +352,7 @@ abstract class base implements cache_cacheableInterface
return true; return true;
} }
} catch (Exception $e) { } catch (\Exception $e) {
throw new Exception('Unable to set the database version : '.$e->getMessage()); throw new Exception('Unable to set the database version : '.$e->getMessage());
} }
@@ -518,7 +518,7 @@ abstract class base implements cache_cacheableInterface
$stmt = $this->get_connection()->prepare($def['sql']); $stmt = $this->get_connection()->prepare($def['sql']);
$stmt->execute($def['params']); $stmt->execute($def['params']);
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
$recommends[] = array( $recommends[] = array(
'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()),
'sql' => $def['sql'] 'sql' => $def['sql']
@@ -732,7 +732,7 @@ abstract class base implements cache_cacheableInterface
$stmt = $this->get_connection()->prepare($a); $stmt = $this->get_connection()->prepare($a);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
$return[] = array( $return[] = array(
'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()),
'sql' => $a 'sql' => $a
@@ -745,7 +745,7 @@ abstract class base implements cache_cacheableInterface
$stmt = $this->get_connection()->prepare($a); $stmt = $this->get_connection()->prepare($a);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
$return[] = array( $return[] = array(
'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()),
'sql' => $a 'sql' => $a

View File

@@ -340,7 +340,7 @@ class caption_field implements cache_cacheableInterface
*/ */
$app['phraseanet.SE']->updateRecord($record); $app['phraseanet.SE']->updateRecord($record);
unset($record); unset($record);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -394,7 +394,7 @@ class caption_field implements cache_cacheableInterface
$app['phraseanet.SE']->updateRecord($record); $app['phraseanet.SE']->updateRecord($record);
unset($caption_field); unset($caption_field);
unset($record); unset($record);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }

View File

@@ -196,7 +196,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
$fields = array(); $fields = array();
try { try {
$fields = $this->get_data_from_cache(); $fields = $this->get_data_from_cache();
} catch (Exception $e) { } catch (\Exception $e) {
$sql = "SELECT m.id as meta_id, s.id as structure_id $sql = "SELECT m.id as meta_id, s.id as structure_id
FROM metadatas m, metadatas_structure s FROM metadatas m, metadatas_structure s
WHERE m.record_id = :record_id AND s.id = m.meta_struct_id WHERE m.record_id = :record_id AND s.id = m.meta_struct_id

View File

@@ -69,7 +69,7 @@ class collection implements cache_cacheableInterface
$this->labels = $datas['labels']; $this->labels = $datas['labels'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -148,7 +148,7 @@ class connection
try { try {
self::$_PDO_instance[$name] = new connection_pdo($name, $hostname, $port, $user, $password, $dbname, array(), $app['debug']); self::$_PDO_instance[$name] = new connection_pdo($name, $hostname, $port, $user, $password, $dbname, array(), $app['debug']);
} catch (Exception $e) { } catch (\Exception $e) {
throw new Exception('Connection not available'); throw new Exception('Connection not available');
} }
} }

View File

@@ -35,7 +35,7 @@ class connection_pdoStatementDebugger
$exception = null; $exception = null;
try { try {
$result = $this->statement->execute($params); $result = $this->statement->execute($params);
} catch (Exception $e) { } catch (\Exception $e) {
$exception = $e; $exception = $e;
} }
$time = microtime(true) - $start; $time = microtime(true) - $start;

View File

@@ -207,7 +207,7 @@ class databox extends base
foreach ($this->get_available_collections() as $coll_id) { foreach ($this->get_available_collections() as $coll_id) {
try { try {
$ret[] = collection::get_from_coll_id($this->app, $this, $coll_id); $ret[] = collection::get_from_coll_id($this->app, $this, $coll_id);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -219,7 +219,7 @@ class databox extends base
{ {
try { try {
return $this->get_data_from_cache(self::CACHE_COLLECTIONS); return $this->get_data_from_cache(self::CACHE_COLLECTIONS);
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -532,7 +532,7 @@ class databox extends base
$stmt = $connection->prepare($sql); $stmt = $connection->prepare($sql);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -649,7 +649,7 @@ class databox extends base
try { try {
$metaStructData = $this->get_data_from_cache(self::CACHE_META_STRUCT); $metaStructData = $this->get_data_from_cache(self::CACHE_META_STRUCT);
} catch (Exception $e) { } catch (\Exception $e) {
$sql = 'SELECT id, name FROM metadatas_structure ORDER BY sorter ASC'; $sql = 'SELECT id, name FROM metadatas_structure ORDER BY sorter ASC';
$stmt = $this->get_connection()->prepare($sql); $stmt = $this->get_connection()->prepare($sql);
$stmt->execute(); $stmt->execute();
@@ -960,7 +960,7 @@ class databox extends base
try { try {
$meta_struct_field->set_tag(\databox_field::loadClassFromTagName($src))->save(); $meta_struct_field->set_tag(\databox_field::loadClassFromTagName($src))->save();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -1005,7 +1005,7 @@ class databox extends base
if ( ! empty($row['logo'])) { if ( ! empty($row['logo'])) {
file_put_contents($this->app['root.path'] . '/config/minilogos/' . $base_id, $row['logo']); file_put_contents($this->app['root.path'] . '/config/minilogos/' . $base_id, $row['logo']);
} }
} catch (Exception $e) { } catch (\Exception $e) {
unset($e); unset($e);
} }
} }
@@ -1136,7 +1136,7 @@ class databox extends base
$this->thesaurus = $this->get_data_from_cache(self::CACHE_THESAURUS); $this->thesaurus = $this->get_data_from_cache(self::CACHE_THESAURUS);
return $this->thesaurus; return $this->thesaurus;
} catch (Exception $e) { } catch (\Exception $e) {
unset($e); unset($e);
} }
@@ -1149,7 +1149,7 @@ class databox extends base
$stmt->closeCursor(); $stmt->closeCursor();
$this->thesaurus = $row['thesaurus']; $this->thesaurus = $row['thesaurus'];
$this->set_data_to_cache($this->thesaurus, self::CACHE_THESAURUS); $this->set_data_to_cache($this->thesaurus, self::CACHE_THESAURUS);
} catch (Exception $e) { } catch (\Exception $e) {
unset($e); unset($e);
} }
@@ -1174,7 +1174,7 @@ class databox extends base
{ {
try { try {
return $this->get_data_from_cache(self::CACHE_STRUCTURE); return $this->get_data_from_cache(self::CACHE_STRUCTURE);
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -1365,7 +1365,7 @@ class databox extends base
$this->cgus = $this->get_data_from_cache(self::CACHE_CGUS); $this->cgus = $this->get_data_from_cache(self::CACHE_CGUS);
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -72,7 +72,7 @@ class databox_cgu
if ($userValidation) if ($userValidation)
$terms[$name] = array('sbas_id' => $databox->get_sbas_id(), 'terms' => $value, 'date' => $update); $terms[$name] = array('sbas_id' => $databox->get_sbas_id(), 'terms' => $value, 'date' => $update);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }

View File

@@ -282,7 +282,7 @@ class databox_field implements cache_cacheableInterface
if ( ! isset(self::$_instance[$instance_id]) || (self::$_instance[$instance_id] instanceof self) === false) { if ( ! isset(self::$_instance[$instance_id]) || (self::$_instance[$instance_id] instanceof self) === false) {
try { try {
self::$_instance[$instance_id] = $databox->get_data_from_cache($cache_key); self::$_instance[$instance_id] = $databox->get_data_from_cache($cache_key);
} catch (Exception $e) { } catch (\Exception $e) {
self::$_instance[$instance_id] = new self($app, $databox, $id); self::$_instance[$instance_id] = new self($app, $databox, $id);
$databox->set_data_to_cache(self::$_instance[$instance_id], $cache_key); $databox->set_data_to_cache(self::$_instance[$instance_id], $cache_key);
} }

View File

@@ -143,7 +143,7 @@ class databox_status
foreach ($sbas_ids as $databox) { foreach ($sbas_ids as $databox) {
try { try {
$statuses[$databox->get_sbas_id()] = $databox->get_statusbits(); $statuses[$databox->get_sbas_id()] = $databox->get_statusbits();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -172,7 +172,7 @@ class databox_status
} }
try { try {
$statuses[$databox->get_sbas_id()] = $databox->get_statusbits(); $statuses[$databox->get_sbas_id()] = $databox->get_statusbits();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }

View File

@@ -104,7 +104,7 @@ class eventsmanager_broker
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute($params); $stmt->execute($params);
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
return false; return false;
} }

View File

@@ -79,7 +79,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
$mailColl[$row['usr_id']][] = $row['base_id']; $mailColl[$row['usr_id']][] = $row['base_id'];
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -110,7 +110,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
try { try {
$registered_user = User_Adapter::getInstance($params['usr_id'], $this->app); $registered_user = User_Adapter::getInstance($params['usr_id'], $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return; return;
} }
@@ -121,7 +121,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
if ($this->shouldSendNotificationFor($usr_id)) { if ($this->shouldSendNotificationFor($usr_id)) {
try { try {
$admin_user = User_Adapter::getInstance($usr_id, $this->app); $admin_user = User_Adapter::getInstance($usr_id, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
continue; continue;
} }
@@ -148,7 +148,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
$usr_id = (string) $sx->usr_id; $usr_id = (string) $sx->usr_id;
try { try {
$registered_user = User_Adapter::getInstance($usr_id, $this->app); $registered_user = User_Adapter::getInstance($usr_id, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }
@@ -201,7 +201,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
try { try {
$receiver = Receiver::fromUser($to); $receiver = Receiver::fromUser($to);
$readyToSend = true; $readyToSend = true;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -126,7 +126,7 @@ class eventsmanager_notify_bridgeuploadfail extends eventsmanager_notifyAbstract
try { try {
$account = Bridge_Account::load_account($this->app, $account_id); $account = Bridge_Account::load_account($this->app, $account_id);
$record = new record_adapter($this->app, $sbas_id, $rid); $record = new record_adapter($this->app, $sbas_id, $rid);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }

View File

@@ -72,7 +72,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
$users = $query->on_base_ids($base_ids) $users = $query->on_base_ids($base_ids)
->who_have_right(array('order_master')) ->who_have_right(array('order_master'))
->execute()->get_results(); ->execute()->get_results();
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -149,7 +149,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
try { try {
$registered_user = User_Adapter::getInstance($usr_id, $this->app); $registered_user = User_Adapter::getInstance($usr_id, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }

View File

@@ -152,7 +152,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); $registered_user = User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }
@@ -162,7 +162,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
$repository = $this->app['EM']->getRepository('\Entities\Basket'); $repository = $this->app['EM']->getRepository('\Entities\Basket');
$basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false); $basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }
$ret = array( $ret = array(

View File

@@ -87,7 +87,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
$emitter = Emitter::fromUser($user_from); $emitter = Emitter::fromUser($user_from);
$readyToSend = true; $readyToSend = true;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -114,7 +114,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); $registered_user = User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }

View File

@@ -127,7 +127,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); $registered_user = User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }

View File

@@ -80,7 +80,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
$mailColl[$row['usr_id']][] = $row['base_id']; $mailColl[$row['usr_id']][] = $row['base_id'];
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -158,7 +158,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
try { try {
$registered_user = User_Adapter::getInstance($usr_id, $this->app); $registered_user = User_Adapter::getInstance($usr_id, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }

View File

@@ -139,7 +139,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); $registered_user = User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }
@@ -151,7 +151,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
$basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false); $basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false);
$basket_name = trim($basket->getName()) ? : _('Une selection'); $basket_name = trim($basket->getName()) ? : _('Une selection');
} catch (Exception $e) { } catch (\Exception $e) {
$basket_name = _('Une selection'); $basket_name = _('Une selection');
} }

View File

@@ -133,7 +133,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); $registered_user = User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }
@@ -143,7 +143,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
$repository = $this->app['EM']->getRepository('\Entities\Basket'); $repository = $this->app['EM']->getRepository('\Entities\Basket');
$basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false); $basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }

View File

@@ -89,7 +89,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
try { try {
$user_from = User_Adapter::getInstance($params['from'], $this->app); $user_from = User_Adapter::getInstance($params['from'], $this->app);
$user_to = User_Adapter::getInstance($params['to'], $this->app); $user_to = User_Adapter::getInstance($params['to'], $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return false; return false;
} }
@@ -138,7 +138,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
try { try {
$registered_user = User_Adapter::getInstance($from, $this->app); $registered_user = User_Adapter::getInstance($from, $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
return array(); return array();
} }
@@ -150,7 +150,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
$basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false); $basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false);
$basket_name = trim($basket->getName()) ? : _('Une selection'); $basket_name = trim($basket->getName()) ? : _('Une selection');
} catch (Exception $e) { } catch (\Exception $e) {
$basket_name = _('Une selection'); $basket_name = _('Une selection');
} }

View File

@@ -200,7 +200,7 @@ class ftpclient
echo "Resume seems not to be supported, try again from scratch\n<br>"; echo "Resume seems not to be supported, try again from scratch\n<br>";
try { try {
$this->unlink($remotefile); $this->unlink($remotefile);
} catch (Exception $e) { } catch (\Exception $e) {
echo $e; echo $e;
} }
$ret = $this->nb_put($remotefile, $localfile, 0); $ret = $this->nb_put($remotefile, $localfile, 0);
@@ -243,7 +243,7 @@ class ftpclient
echo "Resume seems not to be supported, try again from scratch\n<br>"; echo "Resume seems not to be supported, try again from scratch\n<br>";
try { try {
$this->unlink($localfile); $this->unlink($localfile);
} catch (Exception $e) { } catch (\Exception $e) {
echo $e; echo $e;
} }
$ret = $this->nb_get($localfile, $remotefile, 0); $ret = $this->nb_get($localfile, $remotefile, 0);

View File

@@ -259,7 +259,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
$this->label = $datas['label']; $this->label = $datas['label'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -307,7 +307,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
{ {
try { try {
return new self($app, $databox, $media_subdef); return new self($app, $databox, $media_subdef);
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -179,7 +179,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->creation_date = $datas['creation_date']; $this->creation_date = $datas['creation_date'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -78,7 +78,7 @@ class module_console_sphinxGenerateSuggestion extends Command
try { try {
$connbas = connection::getPDOConnection($this->container, $sbas_id); $connbas = connection::getPDOConnection($this->container, $sbas_id);
} catch (Exception $e) { } catch (\Exception $e) {
continue; continue;
} }

View File

@@ -93,7 +93,7 @@ class module_console_systemMailCheck extends Command
$tmp_user->set_email(null); $tmp_user->set_email(null);
unset($users[$id]); unset($users[$id]);
} catch (Exception $e) { } catch (\Exception $e) {
$output->writeln('<error>Wrong id</error>'); $output->writeln('<error>Wrong id</error>');
} }
} }

View File

@@ -55,7 +55,7 @@ class module_console_systemTemplateGenerator extends Command
$this->container['twig']->loadTemplate(str_replace($tplDir, '', $file->getPathname())); $this->container['twig']->loadTemplate(str_replace($tplDir, '', $file->getPathname()));
$output->writeln('' . $file . ''); $output->writeln('' . $file . '');
$n_ok ++; $n_ok ++;
} catch (Exception $e) { } catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>'); $output->writeln('<error>' . $e->getMessage() . '</error>');
$n_error ++; $n_error ++;
} }

View File

@@ -85,7 +85,7 @@ class module_console_taskState extends Command
$output->writeln($input->getOption('short') ? 'unknown_id' : $e->getMessage()); $output->writeln($input->getOption('short') ? 'unknown_id' : $e->getMessage());
return self::EXITCODE_TASK_UNKNOWN; return self::EXITCODE_TASK_UNKNOWN;
} catch (Exception $e) { } catch (\Exception $e) {
$output->writeln($input->getOption('short') ? 'fatal_error' : $e->getMessage()); $output->writeln($input->getOption('short') ? 'fatal_error' : $e->getMessage());
return self::EXITCODE_FATAL_ERROR; return self::EXITCODE_FATAL_ERROR;

View File

@@ -148,7 +148,7 @@ class module_console_taskrun extends Command
try { try {
$this->task->run($runner); $this->task->run($runner);
} catch (Exception $e) { } catch (\Exception $e) {
$this->task->log(sprintf("taskrun : exception from 'run()', %s \n", $e->getMessage())); $this->task->log(sprintf("taskrun : exception from 'run()', %s \n", $e->getMessage()));
return($e->getCode()); return($e->getCode());

View File

@@ -850,7 +850,7 @@ class module_report
$this->setReport(); $this->setReport();
return $this->report; return $this->report;
} catch (Exception $e) { } catch (\Exception $e) {
echo $e->getMessage(); echo $e->getMessage();
} }
} }

View File

@@ -80,7 +80,7 @@ class module_report_add extends module_report
try { try {
$user = User_Adapter::getInstance($value, $this->app); $user = User_Adapter::getInstance($value, $this->app);
$caption = $user->get_display_name(); $caption = $user->get_display_name();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} elseif ($field == 'date') } elseif ($field == 'date')

View File

@@ -328,7 +328,7 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
$this->app, $sbasid, $coll, $this->dmin, $this->dmax $this->app, $sbasid, $coll, $this->dmin, $this->dmax
); );
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }
$i ++; $i ++;

View File

@@ -76,7 +76,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
$result->setApplication($app); $result->setApplication($app);
return $result; return $result;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -114,7 +114,7 @@ class module_report_download extends module_report
if (array_key_exists('record_id', $row)) { if (array_key_exists('record_id', $row)) {
try { try {
$record = new \record_adapter($app, $this->sbas_id, $row['record_id']); $record = new \record_adapter($app, $this->sbas_id, $row['record_id']);
} catch (Exception_Record_AdapterNotFound $e) { } catch (\Exception_Record_AdapterNotFound $e) {
continue; continue;
} }

View File

@@ -80,7 +80,7 @@ class module_report_edit extends module_report
try { try {
$user = User_Adapter::getInstance($value, $this->app); $user = User_Adapter::getInstance($value, $this->app);
$caption = $user->get_display_name(); $caption = $user->get_display_name();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} elseif ($field == 'date') { } elseif ($field == 'date') {

View File

@@ -498,7 +498,7 @@ class module_report_nav extends module_report
try { try {
$record = new record_adapter($this->app, $sbas_id, $rid); $record = new record_adapter($this->app, $sbas_id, $rid);
} catch (Exception_Record_AdapterNotFound $e) { } catch (\Exception_Record_AdapterNotFound $e) {
return $this->report; return $this->report;
} }

View File

@@ -81,7 +81,7 @@ class module_report_push extends module_report
try { try {
$user = User_Adapter::getInstance($value, $this->app); $user = User_Adapter::getInstance($value, $this->app);
$caption = $user->get_display_name(); $caption = $user->get_display_name();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} elseif ($field == 'date') { } elseif ($field == 'date') {

View File

@@ -81,7 +81,7 @@ class module_report_sent extends module_report
try { try {
$user = User_Adapter::getInstance($value, $this->app); $user = User_Adapter::getInstance($value, $this->app);
$caption = $user->get_display_name(); $caption = $user->get_display_name();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} elseif ($field == 'date') { } elseif ($field == 'date') {

View File

@@ -81,7 +81,7 @@ class module_report_validate extends module_report
try { try {
$user = User_Adapter::getInstance($value, $this->app); $user = User_Adapter::getInstance($value, $this->app);
$caption = $user->get_display_name(); $caption = $user->get_display_name();
} catch (Exception $e) { } catch (\Exception $e) {
} }
} elseif ($field == 'date') { } elseif ($field == 'date') {

View File

@@ -63,7 +63,7 @@ class patch_320alpha4b implements patchInterface
$stmt = $appbox->get_connection()->prepare($sql); $stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -66,7 +66,7 @@ class phrasea
self::$_sbas_params = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_PARAMS); self::$_sbas_params = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_PARAMS);
return self::$_sbas_params; return self::$_sbas_params;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -132,7 +132,7 @@ class phrasea
if (!self::$_bas2sbas) { if (!self::$_bas2sbas) {
try { try {
self::$_bas2sbas = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_FROM_BAS); self::$_bas2sbas = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_FROM_BAS);
} catch (Exception $e) { } catch (\Exception $e) {
$sql = 'SELECT base_id, sbas_id FROM bas'; $sql = 'SELECT base_id, sbas_id FROM bas';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute(); $stmt->execute();
@@ -223,7 +223,7 @@ class phrasea
if (!self::$_sbas_names) { if (!self::$_sbas_names) {
try { try {
self::$_sbas_names = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_NAMES); self::$_sbas_names = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_NAMES);
} catch (Exception $e) { } catch (\Exception $e) {
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) { foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
self::$_sbas_names[$databox->get_sbas_id()] = $databox->get_viewname(); self::$_sbas_names[$databox->get_sbas_id()] = $databox->get_viewname();
} }
@@ -239,7 +239,7 @@ class phrasea
if (!self::$_sbas_labels) { if (!self::$_sbas_labels) {
try { try {
self::$_sbas_labels = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_LABELS); self::$_sbas_labels = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_LABELS);
} catch (Exception $e) { } catch (\Exception $e) {
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) { foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
self::$_sbas_labels[$databox->get_sbas_id()] = array( self::$_sbas_labels[$databox->get_sbas_id()] = array(
'fr' => $databox->get_label('fr'), 'fr' => $databox->get_label('fr'),
@@ -264,7 +264,7 @@ class phrasea
if (!self::$_bas_labels) { if (!self::$_bas_labels) {
try { try {
self::$_bas_labels = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_BAS_LABELS); self::$_bas_labels = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_BAS_LABELS);
} catch (Exception $e) { } catch (\Exception $e) {
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) { foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
foreach ($databox->get_collections() as $collection) { foreach ($databox->get_collections() as $collection) {
self::$_bas_labels[$collection->get_base_id()] = array( self::$_bas_labels[$collection->get_base_id()] = array(

View File

@@ -76,7 +76,7 @@ class random
$stmt->closeCursor(); $stmt->closeCursor();
return true; return true;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -185,7 +185,7 @@ class random
$stmt->closeCursor(); $stmt->closeCursor();
return true; return true;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -205,7 +205,7 @@ class random
$stmt->closeCursor(); $stmt->closeCursor();
return true; return true;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -192,7 +192,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$this->base_id = $datas['base_id']; $this->base_id = $datas['base_id'];
return $this; return $this;
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -522,7 +522,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
try { try {
return $this->get_subdef('thumbnailGIF'); return $this->get_subdef('thumbnailGIF');
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -568,7 +568,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{ {
try { try {
return $this->get_data_from_cache(self::CACHE_STATUS); return $this->get_data_from_cache(self::CACHE_STATUS);
} catch (Exception $e) { } catch (\Exception $e) {
} }
$sql = 'SELECT BIN(status) as status FROM record $sql = 'SELECT BIN(status) as status FROM record
@@ -714,7 +714,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{ {
try { try {
return $this->get_data_from_cache(self::CACHE_SUBDEFS); return $this->get_data_from_cache(self::CACHE_SUBDEFS);
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -759,7 +759,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
if (!$this->technical_datas) { if (!$this->technical_datas) {
try { try {
$this->technical_datas = $this->get_data_from_cache(self::CACHE_TECHNICAL_DATAS); $this->technical_datas = $this->get_data_from_cache(self::CACHE_TECHNICAL_DATAS);
} catch (Exception $e) { } catch (\Exception $e) {
$this->technical_datas = array(); $this->technical_datas = array();
$connbas = $this->get_databox()->get_connection(); $connbas = $this->get_databox()->get_connection();
$sql = 'SELECT name, value FROM technical_datas WHERE record_id = :record_id'; $sql = 'SELECT name, value FROM technical_datas WHERE record_id = :record_id';
@@ -944,7 +944,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$this->get_subdef('preview'); $this->get_subdef('preview');
return $this->get_subdef('preview')->is_physically_present(); return $this->get_subdef('preview')->is_physically_present();
} catch (Exception $e) { } catch (\Exception $e) {
unset($e); unset($e);
} }
@@ -1282,7 +1282,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
':coll_id' => $collection->get_coll_id() ':coll_id' => $collection->get_coll_id()
)); ));
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
unset($e); unset($e);
} }
@@ -1337,7 +1337,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
':coll_id' => $file->getCollection()->get_coll_id() ':coll_id' => $file->getCollection()->get_coll_id()
)); ));
$stmt->closeCursor(); $stmt->closeCursor();
} catch (Exception $e) { } catch (\Exception $e) {
unset($e); unset($e);
} }

View File

@@ -381,7 +381,7 @@ class record_preview extends record_adapter
try { try {
$user = \User_Adapter::getInstance($row['usr_id'], $this->app); $user = \User_Adapter::getInstance($row['usr_id'], $this->app);
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -58,7 +58,7 @@ class recordutils_image extends recordutils
if (MediaInterface::TYPE_IMAGE === $image->getType()) { if (MediaInterface::TYPE_IMAGE === $image->getType()) {
$rotation = $image->getOrientation(); $rotation = $image->getOrientation();
} }
} catch (Exception $e) { } catch (\Exception $e) {
// getting orientation failed but we don't care the reason // getting orientation failed but we don't care the reason
} }

View File

@@ -77,7 +77,7 @@ class registry implements registryInterface
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$loaded = true; $loaded = true;
} catch (Exception $e) { } catch (\Exception $e) {
} }
foreach ($rs as $row) { foreach ($rs as $row) {

View File

@@ -100,7 +100,7 @@ class set_export extends set_abstract
try { try {
$record = new record_adapter($this->app, $basrec[0], $basrec[1]); $record = new record_adapter($this->app, $basrec[0], $basrec[1]);
} catch (Exception_Record_AdapterNotFound $e) { } catch (\Exception_Record_AdapterNotFound $e) {
continue; continue;
} }

View File

@@ -116,7 +116,7 @@ class set_order extends set_abstract
$stmt->closeCursor(); $stmt->closeCursor();
$app['phraseanet.appbox']->get_connection()->commit(); $app['phraseanet.appbox']->get_connection()->commit();
} catch (Exception $e) { } catch (\Exception $e) {
$app['phraseanet.appbox']->get_connection()->rollBack(); $app['phraseanet.appbox']->get_connection()->rollBack();
return false; return false;
@@ -431,7 +431,7 @@ class set_order extends set_abstract
$this->user->ACL()->grant_hd_on($record, $app['authentication']->getUser(), 'order'); $this->user->ACL()->grant_hd_on($record, $app['authentication']->getUser(), 'order');
unset($record); unset($record);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }

View File

@@ -106,7 +106,7 @@ class set_selection extends set_abstract
if ($num_rows == 0) { if ($num_rows == 0) {
$to_remove[] = $id; $to_remove[] = $id;
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -131,7 +131,7 @@ class set_selection extends set_abstract
if (count($basrec) == 2) { if (count($basrec) == 2) {
try { try {
$record = new record_adapter($this->app, (int) $basrec[0], (int) $basrec[1], count($this->elements)); $record = new record_adapter($this->app, (int) $basrec[0], (int) $basrec[1], count($this->elements));
} catch (Exception $e) { } catch (\Exception $e) {
continue; continue;
} }
if ($record->is_grouping() && $flatten_groupings === true) { if ($record->is_grouping() && $flatten_groupings === true) {

View File

@@ -135,7 +135,7 @@ abstract class task_abstract
try { try {
$conn = connection::getPDOConnection($this->dependencyContainer); $conn = connection::getPDOConnection($this->dependencyContainer);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log(("Warning : abox connection lost : ".$e->getMessage().", restarting in 10 min."), self::LOG_ERROR); $this->log(("Warning : abox connection lost : ".$e->getMessage().", restarting in 10 min."), self::LOG_ERROR);
$this->sleep(60 * 10); $this->sleep(60 * 10);
@@ -691,7 +691,7 @@ abstract class task_abstract
try { try {
// process one record // process one record
$this->processOneContent($box, $row); $this->processOneContent($box, $row);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log("Exception : " . $e->getMessage() . " " . basename($e->getFile()) . " " . $e->getLine(), self::LOG_ERROR); $this->log("Exception : " . $e->getMessage() . " " . basename($e->getFile()) . " " . $e->getLine(), self::LOG_ERROR);
} }
@@ -721,7 +721,7 @@ abstract class task_abstract
$this->running = FALSE; $this->running = FALSE;
$ret = self::STATE_TOSTOP; $ret = self::STATE_TOSTOP;
} }
} catch (Exception $e) { } catch (\Exception $e) {
$this->running = FALSE; $this->running = FALSE;
} }
@@ -752,7 +752,7 @@ abstract class task_abstract
$this->running = FALSE; $this->running = FALSE;
$ret = self::STATE_TOSTOP; $ret = self::STATE_TOSTOP;
} }
} catch (Exception $e) { } catch (\Exception $e) {
$this->running = FALSE; $this->running = FALSE;
} }
} }
@@ -917,7 +917,7 @@ abstract class task_abstract
)); ));
$stmt->closeCursor(); $stmt->closeCursor();
$this->completed_percentage = $p; $this->completed_percentage = $p;
} catch (Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -29,7 +29,7 @@ abstract class task_appboxAbstract extends task_abstract
while ($this->running) { while ($this->running) {
try { try {
$conn = connection::getPDOConnection($this->dependencyContainer); $conn = connection::getPDOConnection($this->dependencyContainer);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log($e->getMessage()); $this->log($e->getMessage());
if ($this->getRunner() == self::RUNNER_SCHEDULER) { if ($this->getRunner() == self::RUNNER_SCHEDULER) {
$this->log(("Warning : abox connection lost, restarting in 10 min.")); $this->log(("Warning : abox connection lost, restarting in 10 min."));
@@ -59,7 +59,7 @@ abstract class task_appboxAbstract extends task_abstract
$stmt->closeCursor(); $stmt->closeCursor();
$this->records_done = 0; $this->records_done = 0;
$duration = time(); $duration = time();
} catch (Exception $e) { } catch (\Exception $e) {
// failed sql, simply return // failed sql, simply return
$this->running = FALSE; $this->running = FALSE;
@@ -73,7 +73,7 @@ abstract class task_appboxAbstract extends task_abstract
try { try {
$this->loadSettings(simplexml_load_string($row['settings'])); $this->loadSettings(simplexml_load_string($row['settings']));
} catch (Exception $e) { } catch (\Exception $e) {
$this->log($e->getMessage()); $this->log($e->getMessage());
continue; continue;
} }
@@ -125,7 +125,7 @@ abstract class task_appboxAbstract extends task_abstract
// process the records // process the records
$ret = $this->processLoop($appbox, $rs); $ret = $this->processLoop($appbox, $rs);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log('Error : ' . $e->getMessage()); $this->log('Error : ' . $e->getMessage());
} }

View File

@@ -69,7 +69,7 @@ abstract class task_databoxAbstract extends task_abstract
$stmt->closeCursor(); $stmt->closeCursor();
$this->records_done = 0; $this->records_done = 0;
$duration = time(); $duration = time();
} catch (Exception $e) { } catch (\Exception $e) {
// failed sql, simply return // failed sql, simply return
$this->running = FALSE; $this->running = FALSE;
@@ -87,7 +87,7 @@ abstract class task_databoxAbstract extends task_abstract
try { try {
// get the records to process // get the records to process
$databox = $this->dependencyContainer['phraseanet.appbox']->get_databox((int) $row['sbas_id']); $databox = $this->dependencyContainer['phraseanet.appbox']->get_databox((int) $row['sbas_id']);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log(sprintf('can\'t connect to sbas(%s) because "%s"', $this->log(sprintf('can\'t connect to sbas(%s) because "%s"',
$row['sbas_id'], $row['sbas_id'],
$e->getMessage()), $e->getMessage()),
@@ -98,7 +98,7 @@ abstract class task_databoxAbstract extends task_abstract
try { try {
$this->loadSettings(simplexml_load_string($row['settings'])); $this->loadSettings(simplexml_load_string($row['settings']));
} catch (Exception $e) { } catch (\Exception $e) {
$this->log(sprintf('can\'t get get settings of task because "%s"', $this->log(sprintf('can\'t get get settings of task because "%s"',
$e->getMessage()), $e->getMessage()),
self::LOG_WARNING self::LOG_WARNING
@@ -167,7 +167,7 @@ abstract class task_databoxAbstract extends task_abstract
// process the records // process the records
$ret = $this->processLoop($databox, $rs); $ret = $this->processLoop($databox, $rs);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log($e->getMessage(), self::LOG_ERROR); $this->log($e->getMessage(), self::LOG_ERROR);
} }

View File

@@ -108,7 +108,7 @@ class task_manager
} }
try { try {
$tasks[$row['task_id']] = new $classname($row['task_id'], $this->app, $this->logger); $tasks[$row['task_id']] = new $classname($row['task_id'], $this->app, $this->logger);
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -259,7 +259,7 @@ class task_manager
"err" => null "err" => null
); );
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }
} }

View File

@@ -351,7 +351,7 @@ class task_period_RecordMover extends task_appboxAbstract
try { try {
$connbas = connection::getPDOConnection($this->dependencyContainer, $task['sbas_id']); $connbas = connection::getPDOConnection($this->dependencyContainer, $task['sbas_id']);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log(sprintf("can't connect sbas %s", $task['sbas_id']), self::LOG_ERROR); $this->log(sprintf("can't connect sbas %s", $task['sbas_id']), self::LOG_ERROR);
continue; continue;
} }
@@ -513,7 +513,7 @@ class task_period_RecordMover extends task_appboxAbstract
$ret['err_htmlencoded'] = htmlentities($ret['err']); $ret['err_htmlencoded'] = htmlentities($ret['err']);
break; break;
} }
} catch (Exception $e) { } catch (\Exception $e) {
$ret['err'] = "bad sbas '" . $sbas_id . "'"; $ret['err'] = "bad sbas '" . $sbas_id . "'";
$ret['err_htmlencoded'] = htmlentities($ret['err']); $ret['err_htmlencoded'] = htmlentities($ret['err']);
} }

View File

@@ -77,7 +77,7 @@ class task_period_apibridge extends task_appboxAbstract
} else { } else {
$this->update_element($element); $this->update_element($element);
} }
} catch (Exception $e) { } catch (\Exception $e) {
$sql = 'UPDATE bridge_elements SET status = :status WHERE id = :id'; $sql = 'UPDATE bridge_elements SET status = :status WHERE id = :id';
$params = array( $params = array(
@@ -117,7 +117,7 @@ class task_period_apibridge extends task_appboxAbstract
try { try {
$dist_id = $account->get_api()->upload($element->get_record(), $element->get_datas()); $dist_id = $account->get_api()->upload($element->get_record(), $element->get_datas());
$element->set_uploaded_on(new DateTime()); $element->set_uploaded_on(new DateTime());
} catch (Exception $e) { } catch (\Exception $e) {
$this->log('Error while uploading : ' . $e->getMessage()); $this->log('Error while uploading : ' . $e->getMessage());
$element->set_status(Bridge_Element::STATUS_ERROR); $element->set_status(Bridge_Element::STATUS_ERROR);
} }

View File

@@ -379,7 +379,7 @@ class task_period_archive extends task_abstract
while ($this->running) { while ($this->running) {
try { try {
$conn = connection::getPDOConnection($this->dependencyContainer); $conn = connection::getPDOConnection($this->dependencyContainer);
} catch (Exception $e) { } catch (\Exception $e) {
$this->log($e->getMessage()); $this->log($e->getMessage());
if ($this->getRunner() == self::RUNNER_SCHEDULER) { if ($this->getRunner() == self::RUNNER_SCHEDULER) {
$this->log(("Warning : abox connection lost, restarting in 10 min.")); $this->log(("Warning : abox connection lost, restarting in 10 min."));
@@ -436,7 +436,7 @@ class task_period_archive extends task_abstract
$cold = 30; $cold = 30;
} }
} }
} catch (Exception $e) { } catch (\Exception $e) {
if ($this->getRunner() == self::RUNNER_SCHEDULER) { if ($this->getRunner() == self::RUNNER_SCHEDULER) {
$this->log(sprintf(('Warning : error fetching or reading settings of the task \'%d\', restarting in 10 min.'), $this->getID())); $this->log(sprintf(('Warning : error fetching or reading settings of the task \'%d\', restarting in 10 min.'), $this->getID()));
@@ -787,7 +787,7 @@ class task_period_archive extends task_abstract
$n->setAttribute('temperature', 'hot'); $n->setAttribute('temperature', 'hot');
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -893,7 +893,7 @@ class task_period_archive extends task_abstract
} }
} }
} }
} catch (Exception $e) { } catch (\Exception $e) {
} }
@@ -1585,7 +1585,7 @@ class task_period_archive extends task_abstract
$this->movedFiles++; $this->movedFiles++;
} }
$node->setAttribute('grp', 'tocomplete'); $node->setAttribute('grp', 'tocomplete');
} catch (Exception $e) { } catch (\Exception $e) {
$this->logger->addDebug($e->getMessage()); $this->logger->addDebug($e->getMessage());
} }
} }

View File

@@ -241,7 +241,7 @@ class task_period_ftp extends task_appboxAbstract
$stmt->closeCursor(); $stmt->closeCursor();
return true; return true;
} catch (Exception $e) { } catch (\Exception $e) {
return false; return false;
} }
} else { } else {
@@ -362,7 +362,7 @@ class task_period_ftp extends task_appboxAbstract
if ($ftp_export["passif"] == "1") { if ($ftp_export["passif"] == "1") {
try { try {
$ftp_client->passive(true); $ftp_client->passive(true);
} catch (Exception $e) { } catch (\Exception $e) {
$this->logger->addDebug($e->getMessage()); $this->logger->addDebug($e->getMessage());
} }
} }
@@ -371,7 +371,7 @@ class task_period_ftp extends task_appboxAbstract
try { try {
$ftp_client->chdir($ftp_export["destfolder"]); $ftp_client->chdir($ftp_export["destfolder"]);
$ftp_export["destfolder"] = '/' . $ftp_export["destfolder"]; $ftp_export["destfolder"] = '/' . $ftp_export["destfolder"];
} catch (Exception $e) { } catch (\Exception $e) {
$this->logger->addDebug($e->getMessage()); $this->logger->addDebug($e->getMessage());
} }
} else { } else {
@@ -381,14 +381,14 @@ class task_period_ftp extends task_appboxAbstract
if (trim($ftp_export["foldertocreate"]) != '') { if (trim($ftp_export["foldertocreate"]) != '') {
try { try {
$ftp_client->mkdir($ftp_export["foldertocreate"]); $ftp_client->mkdir($ftp_export["foldertocreate"]);
} catch (Exception $e) { } catch (\Exception $e) {
$this->logger->addDebug($e->getMessage()); $this->logger->addDebug($e->getMessage());
} }
try { try {
$new_dir = $ftp_client->add_end_slash($ftp_export["destfolder"]) $new_dir = $ftp_client->add_end_slash($ftp_export["destfolder"])
. $ftp_export["foldertocreate"]; . $ftp_export["foldertocreate"];
$ftp_client->chdir($new_dir); $ftp_client->chdir($new_dir);
} catch (Exception $e) { } catch (\Exception $e) {
$this->logger->addDebug($e->getMessage()); $this->logger->addDebug($e->getMessage());
} }
} }
@@ -451,7 +451,7 @@ class task_period_ftp extends task_appboxAbstract
if ($ftp_client->pwd() != $current_folder) { if ($ftp_client->pwd() != $current_folder) {
try { try {
$ftp_client->chdir($current_folder); $ftp_client->chdir($current_folder);
} catch (Exception $e) { } catch (\Exception $e) {
$this->logger->addDebug($e->getMessage()); $this->logger->addDebug($e->getMessage());
} }
} }
@@ -473,7 +473,7 @@ class task_period_ftp extends task_appboxAbstract
$stmt->execute(array(':file_id' => $file['id'])); $stmt->execute(array(':file_id' => $file['id']));
$stmt->closeCursor(); $stmt->closeCursor();
$this->logexport($record, $obj, $ftpLog); $this->logexport($record, $obj, $ftpLog);
} catch (Exception $e) { } catch (\Exception $e) {
$state .= $line = sprintf(_('task::ftp:File "%1$s" (record %2$s) de la base "%3$s"' . $state .= $line = sprintf(_('task::ftp:File "%1$s" (record %2$s) de la base "%3$s"' .
' (Export du Document) : Transfert cancelled (le document n\'existe plus)') ' (Export du Document) : Transfert cancelled (le document n\'existe plus)')
, basename($localfile), $record_id , basename($localfile), $record_id
@@ -533,7 +533,7 @@ class task_period_ftp extends task_appboxAbstract
$ftp_client->close(); $ftp_client->close();
unset($ftp_client); unset($ftp_client);
} catch (Exception $e) { } catch (\Exception $e) {
$state .= $line = $e . "\n"; $state .= $line = $e . "\n";
$this->logger->addDebug($line); $this->logger->addDebug($line);

View File

@@ -325,7 +325,7 @@ class task_period_ftpPull extends task_appboxAbstract
$stmt->closeCursor(); $stmt->closeCursor();
return true; return true;
} catch (Exception $e) { } catch (\Exception $e) {
return false; return false;
} }
} else { } else {
@@ -423,7 +423,7 @@ class task_period_ftpPull extends task_appboxAbstract
$ftp->get($finalpath, $filepath); $ftp->get($finalpath, $filepath);
$ftp->delete($filepath); $ftp->delete($filepath);
} catch (Exception $e) { } catch (\Exception $e) {
$this->logger->addDebug("Erreur lors du rappatriement de $filepath : " . $e->getMessage()); $this->logger->addDebug("Erreur lors du rappatriement de $filepath : " . $e->getMessage());
} }
} }
@@ -431,7 +431,7 @@ class task_period_ftpPull extends task_appboxAbstract
$ftp->close(); $ftp->close();
$this->setProgress(0, 0); $this->setProgress(0, 0);
} catch (Exception $e) { } catch (\Exception $e) {
if (isset($ftp) && $ftp instanceof ftpclient) { if (isset($ftp) && $ftp instanceof ftpclient) {
$ftp->close(); $ftp->close();
} }