diff --git a/lib/Doctrine/Entities/Basket.php b/lib/Doctrine/Entities/Basket.php index f401b31d55..b50a400d1e 100644 --- a/lib/Doctrine/Entities/Basket.php +++ b/lib/Doctrine/Entities/Basket.php @@ -457,7 +457,7 @@ class Basket $totSize += $basket_element->getRecord($app) ->get_subdef('document') ->get_size(); - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/lib/classes/ACL.php b/lib/classes/ACL.php index 88a7953edc..8cc43770d3 100644 --- a/lib/classes/ACL.php +++ b/lib/classes/ACL.php @@ -240,7 +240,7 @@ class ACL implements cache_cacheableInterface $subdef_class = $record->get_databox()->get_subdef_structure() ->get_subdef($record->get_type(), $subdef_name) ->get_class(); - } catch (Exception $e) { + } catch (\Exception $e) { return false; } @@ -748,7 +748,7 @@ class ACL implements cache_cacheableInterface try { $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']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } $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); return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } $sql = 'SELECT create_db @@ -935,7 +935,7 @@ class ACL implements cache_cacheableInterface $this->_limited = $this->get_data_from_cache(self::CACHE_LIMITS_BAS); return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/API/OAuth2/Adapter.php b/lib/classes/API/OAuth2/Adapter.php index 03b206f3ae..6443990f78 100644 --- a/lib/classes/API/OAuth2/Adapter.php +++ b/lib/classes/API/OAuth2/Adapter.php @@ -192,7 +192,7 @@ class API_OAuth2_Adapter extends OAuth2 } 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() ); - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -306,7 +306,7 @@ class API_OAuth2_Adapter extends OAuth2 , 'expires' => $code->get_expires() , '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') , '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 { $user = User_Adapter::getInstance($usr_id, $this->app); $account = API_OAuth2_Account::load_with_user($this->app, $this->client, $user); - } catch (Exception $e) { + } catch (\Exception $e) { $account = $this->createAccount($usr_id); } @@ -586,7 +586,7 @@ class API_OAuth2_Adapter extends OAuth2 $token->set_session_id($ses_id); return true; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/API/V1/adapter.php b/lib/classes/API/V1/adapter.php index bf3045c642..7e6f0756c2 100644 --- a/lib/classes/API/V1/adapter.php +++ b/lib/classes/API/V1/adapter.php @@ -1101,7 +1101,7 @@ class API_V1_adapter extends API_V1_Abstract $record->set_metadatas($metadatas); $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')); } @@ -1147,7 +1147,7 @@ class API_V1_adapter extends API_V1_Abstract $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')); } @@ -1173,7 +1173,7 @@ class API_V1_adapter extends API_V1_Abstract $record->move_to_collection($collection, $this->app['phraseanet.appbox']); $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()); } @@ -1197,7 +1197,7 @@ class API_V1_adapter extends API_V1_Abstract $result->set_datas(array('record' => $this->list_record($record))); } catch (NotFoundHttpException $e) { $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')); } @@ -1221,7 +1221,7 @@ class API_V1_adapter extends API_V1_Abstract $result->set_datas(array('story' => $this->list_story($story))); } catch (NotFoundHttpException $e) { $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')); } diff --git a/lib/classes/Bridge/Account.php b/lib/classes/Bridge/Account.php index ee535d2ba3..aa43e7a241 100644 --- a/lib/classes/Bridge/Account.php +++ b/lib/classes/Bridge/Account.php @@ -334,7 +334,7 @@ class Bridge_Account if ( ! isset($apis[$api_id])) { try { $apis[$api_id] = new Bridge_Api($app, $api_id); - } catch (Exception $e) { + } catch (\Exception $e) { continue; } } diff --git a/lib/classes/Bridge/Api.php b/lib/classes/Bridge/Api.php index 552c2cf203..e2b72a0b4d 100644 --- a/lib/classes/Bridge/Api.php +++ b/lib/classes/Bridge/Api.php @@ -436,7 +436,7 @@ class Bridge_Api $ret = $action($this); return $ret; - } catch (Exception $e) { + } catch (\Exception $e) { $this->get_connector()->handle_Exception($e); if ($e instanceof Bridge_Exception_ActionAuthNeedReconnect) { @@ -532,7 +532,7 @@ class Bridge_Api foreach ($rs as $row) { try { $results[] = new Bridge_Api($app, $row['id']); - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/lib/classes/Bridge/Api/Flickr.php b/lib/classes/Bridge/Api/Flickr.php index a87cff5fe2..64466833c2 100644 --- a/lib/classes/Bridge/Api/Flickr.php +++ b/lib/classes/Bridge/Api/Flickr.php @@ -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()); $element->set_dist_id($ticket["dist_id"]); } - } catch (Exception $e) { + } catch (\Exception $e) { return self::UPLOAD_STATE_FAILED; } diff --git a/lib/classes/Bridge/Element.php b/lib/classes/Bridge/Element.php index e17449db74..8865fabe52 100644 --- a/lib/classes/Bridge/Element.php +++ b/lib/classes/Bridge/Element.php @@ -301,7 +301,7 @@ class Bridge_Element if (! $this->connector_element) { try { $this->connector_element = $this->account->get_api()->get_element_from_id($this->dist_id, $this->type); - } catch (Exception $e) { + } catch (\Exception $e) { return null; } } diff --git a/lib/classes/Feed/Adapter.php b/lib/classes/Feed/Adapter.php index 610be2ea99..950d672867 100644 --- a/lib/classes/Feed/Adapter.php +++ b/lib/classes/Feed/Adapter.php @@ -83,7 +83,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea $this->public = $datas['public']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -476,7 +476,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea { try { 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) { return $this->get_data_from_cache($cache_key); } - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/Feed/Collection.php b/lib/classes/Feed/Collection.php index 69bfa496d3..5a43f0631f 100644 --- a/lib/classes/Feed/Collection.php +++ b/lib/classes/Feed/Collection.php @@ -122,7 +122,7 @@ class Feed_Collection implements Feed_CollectionInterface, cache_cacheableInterf try { return $appbox->get_data_from_cache($key); - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/Feed/Entry/Adapter.php b/lib/classes/Feed/Entry/Adapter.php index b4a9df7243..2c2dea8a7e 100644 --- a/lib/classes/Feed/Entry/Adapter.php +++ b/lib/classes/Feed/Entry/Adapter.php @@ -130,7 +130,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa $this->created_on = $datas['created_on']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -467,7 +467,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa { try { return $this->get_data_from_cache(self::CACHE_ELEMENTS); - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/Feed/Entry/Item.php b/lib/classes/Feed/Entry/Item.php index 7c72c415b6..b811a5125c 100644 --- a/lib/classes/Feed/Entry/Item.php +++ b/lib/classes/Feed/Entry/Item.php @@ -85,7 +85,7 @@ class Feed_Entry_Item implements Feed_Entry_ItemInterface, cache_cacheableInterf $this->ord = $datas['ord']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/Feed/Publisher/Adapter.php b/lib/classes/Feed/Publisher/Adapter.php index 5a703aefb4..cc5caff00b 100644 --- a/lib/classes/Feed/Publisher/Adapter.php +++ b/lib/classes/Feed/Publisher/Adapter.php @@ -85,7 +85,7 @@ class Feed_Publisher_Adapter implements Feed_Publisher_Interface, cache_cacheabl $this->owner = $datas['owner']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/User/Adapter.php b/lib/classes/User/Adapter.php index f2c7b235c1..decfdd9cb0 100644 --- a/lib/classes/User/Adapter.php +++ b/lib/classes/User/Adapter.php @@ -370,7 +370,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface try { self::$_instance[$id] = $app['phraseanet.appbox']->get_data_from_cache('_user_' . $id); self::$_instance[$id]->set_app($app); - } catch (Exception $e) { + } catch (\Exception $e) { self::$_instance[$id] = new self($id, $app); $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') $app['authentication']->getUser()->setPrefs('start_page_query', $query); - } catch (Exception $e) { + } catch (\Exception $e) { return false; } @@ -1421,7 +1421,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface ':value' => $value )); $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->execute($params); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { } } @@ -1639,7 +1639,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface $stmt->closeCursor(); return true; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/appbox.php b/lib/classes/appbox.php index 1c2b4de9dd..85d3d55ab9 100644 --- a/lib/classes/appbox.php +++ b/lib/classes/appbox.php @@ -446,7 +446,7 @@ class appbox extends base { try { return $this->get_data_from_cache(self::CACHE_SBAS_IDS); - } catch (Exception $e) { + } catch (\Exception $e) { } $sql = 'SELECT sbas_id FROM sbas'; diff --git a/lib/classes/base.php b/lib/classes/base.php index 35dc6e61ee..682f4837af 100644 --- a/lib/classes/base.php +++ b/lib/classes/base.php @@ -296,7 +296,7 @@ abstract class base implements cache_cacheableInterface $stmt = $this->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { $recommends[] = array( 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'sql' => $sql @@ -352,7 +352,7 @@ abstract class base implements cache_cacheableInterface return true; } - } catch (Exception $e) { + } catch (\Exception $e) { 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->execute($def['params']); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { $recommends[] = array( 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'sql' => $def['sql'] @@ -732,7 +732,7 @@ abstract class base implements cache_cacheableInterface $stmt = $this->get_connection()->prepare($a); $stmt->execute(); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { $return[] = array( 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'sql' => $a @@ -745,7 +745,7 @@ abstract class base implements cache_cacheableInterface $stmt = $this->get_connection()->prepare($a); $stmt->execute(); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { $return[] = array( 'message' => sprintf(_('Erreur lors de la tentative ; errreur : %s'), $e->getMessage()), 'sql' => $a diff --git a/lib/classes/caption/field.php b/lib/classes/caption/field.php index cb0c08db35..82d9e4a3b1 100644 --- a/lib/classes/caption/field.php +++ b/lib/classes/caption/field.php @@ -340,7 +340,7 @@ class caption_field implements cache_cacheableInterface */ $app['phraseanet.SE']->updateRecord($record); unset($record); - } catch (Exception $e) { + } catch (\Exception $e) { } } @@ -394,7 +394,7 @@ class caption_field implements cache_cacheableInterface $app['phraseanet.SE']->updateRecord($record); unset($caption_field); unset($record); - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/lib/classes/caption/record.php b/lib/classes/caption/record.php index 49ed724691..422245605c 100644 --- a/lib/classes/caption/record.php +++ b/lib/classes/caption/record.php @@ -196,7 +196,7 @@ class caption_record implements caption_interface, cache_cacheableInterface $fields = array(); try { $fields = $this->get_data_from_cache(); - } catch (Exception $e) { + } catch (\Exception $e) { $sql = "SELECT m.id as meta_id, s.id as structure_id FROM metadatas m, metadatas_structure s WHERE m.record_id = :record_id AND s.id = m.meta_struct_id diff --git a/lib/classes/collection.php b/lib/classes/collection.php index ed99d9d45b..910e771e41 100644 --- a/lib/classes/collection.php +++ b/lib/classes/collection.php @@ -69,7 +69,7 @@ class collection implements cache_cacheableInterface $this->labels = $datas['labels']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/connection.php b/lib/classes/connection.php index df4055a296..cd7effcc3e 100644 --- a/lib/classes/connection.php +++ b/lib/classes/connection.php @@ -148,7 +148,7 @@ class connection try { 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'); } } diff --git a/lib/classes/connection/pdoStatementDebugger.php b/lib/classes/connection/pdoStatementDebugger.php index 79dbda8c14..8a71dcbacf 100644 --- a/lib/classes/connection/pdoStatementDebugger.php +++ b/lib/classes/connection/pdoStatementDebugger.php @@ -35,7 +35,7 @@ class connection_pdoStatementDebugger $exception = null; try { $result = $this->statement->execute($params); - } catch (Exception $e) { + } catch (\Exception $e) { $exception = $e; } $time = microtime(true) - $start; diff --git a/lib/classes/databox.php b/lib/classes/databox.php index da8ff31f6c..5a8a10b58a 100644 --- a/lib/classes/databox.php +++ b/lib/classes/databox.php @@ -207,7 +207,7 @@ class databox extends base foreach ($this->get_available_collections() as $coll_id) { try { $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 { 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->execute(); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -649,7 +649,7 @@ class databox extends base try { $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'; $stmt = $this->get_connection()->prepare($sql); $stmt->execute(); @@ -960,7 +960,7 @@ class databox extends base try { $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'])) { file_put_contents($this->app['root.path'] . '/config/minilogos/' . $base_id, $row['logo']); } - } catch (Exception $e) { + } catch (\Exception $e) { unset($e); } } @@ -1136,7 +1136,7 @@ class databox extends base $this->thesaurus = $this->get_data_from_cache(self::CACHE_THESAURUS); return $this->thesaurus; - } catch (Exception $e) { + } catch (\Exception $e) { unset($e); } @@ -1149,7 +1149,7 @@ class databox extends base $stmt->closeCursor(); $this->thesaurus = $row['thesaurus']; $this->set_data_to_cache($this->thesaurus, self::CACHE_THESAURUS); - } catch (Exception $e) { + } catch (\Exception $e) { unset($e); } @@ -1174,7 +1174,7 @@ class databox extends base { try { 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); return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/databox/cgu.php b/lib/classes/databox/cgu.php index d7fa62a43e..ae09969798 100644 --- a/lib/classes/databox/cgu.php +++ b/lib/classes/databox/cgu.php @@ -72,7 +72,7 @@ class databox_cgu if ($userValidation) $terms[$name] = array('sbas_id' => $databox->get_sbas_id(), 'terms' => $value, 'date' => $update); - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/lib/classes/databox/field.php b/lib/classes/databox/field.php index 326f6aec99..ef2f729ef7 100644 --- a/lib/classes/databox/field.php +++ b/lib/classes/databox/field.php @@ -282,7 +282,7 @@ class databox_field implements cache_cacheableInterface if ( ! isset(self::$_instance[$instance_id]) || (self::$_instance[$instance_id] instanceof self) === false) { try { 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); $databox->set_data_to_cache(self::$_instance[$instance_id], $cache_key); } diff --git a/lib/classes/databox/status.php b/lib/classes/databox/status.php index dc2b3b17d1..cd4365ac34 100644 --- a/lib/classes/databox/status.php +++ b/lib/classes/databox/status.php @@ -143,7 +143,7 @@ class databox_status foreach ($sbas_ids as $databox) { try { $statuses[$databox->get_sbas_id()] = $databox->get_statusbits(); - } catch (Exception $e) { + } catch (\Exception $e) { } } @@ -172,7 +172,7 @@ class databox_status } try { $statuses[$databox->get_sbas_id()] = $databox->get_statusbits(); - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/lib/classes/eventsmanager/broker.php b/lib/classes/eventsmanager/broker.php index 0d99174bb8..ff41923674 100644 --- a/lib/classes/eventsmanager/broker.php +++ b/lib/classes/eventsmanager/broker.php @@ -104,7 +104,7 @@ class eventsmanager_broker $stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt->execute($params); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { return false; } diff --git a/lib/classes/eventsmanager/notify/autoregister.php b/lib/classes/eventsmanager/notify/autoregister.php index caa54b6d2f..675f4eeed9 100644 --- a/lib/classes/eventsmanager/notify/autoregister.php +++ b/lib/classes/eventsmanager/notify/autoregister.php @@ -79,7 +79,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract $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 { $registered_user = User_Adapter::getInstance($params['usr_id'], $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return; } @@ -121,7 +121,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract if ($this->shouldSendNotificationFor($usr_id)) { try { $admin_user = User_Adapter::getInstance($usr_id, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { continue; } @@ -148,7 +148,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract $usr_id = (string) $sx->usr_id; try { $registered_user = User_Adapter::getInstance($usr_id, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } @@ -201,7 +201,7 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract try { $receiver = Receiver::fromUser($to); $readyToSend = true; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/eventsmanager/notify/bridgeuploadfail.php b/lib/classes/eventsmanager/notify/bridgeuploadfail.php index 4c578725cd..c9f19e2fbb 100644 --- a/lib/classes/eventsmanager/notify/bridgeuploadfail.php +++ b/lib/classes/eventsmanager/notify/bridgeuploadfail.php @@ -126,7 +126,7 @@ class eventsmanager_notify_bridgeuploadfail extends eventsmanager_notifyAbstract try { $account = Bridge_Account::load_account($this->app, $account_id); $record = new record_adapter($this->app, $sbas_id, $rid); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/order.php b/lib/classes/eventsmanager/notify/order.php index 6847504911..f91d2839ac 100644 --- a/lib/classes/eventsmanager/notify/order.php +++ b/lib/classes/eventsmanager/notify/order.php @@ -72,7 +72,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract $users = $query->on_base_ids($base_ids) ->who_have_right(array('order_master')) ->execute()->get_results(); - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -149,7 +149,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract try { $registered_user = User_Adapter::getInstance($usr_id, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/orderdeliver.php b/lib/classes/eventsmanager/notify/orderdeliver.php index c875704994..52e183acef 100644 --- a/lib/classes/eventsmanager/notify/orderdeliver.php +++ b/lib/classes/eventsmanager/notify/orderdeliver.php @@ -152,7 +152,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract try { $registered_user = User_Adapter::getInstance($from, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } @@ -162,7 +162,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract $repository = $this->app['EM']->getRepository('\Entities\Basket'); $basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } $ret = array( diff --git a/lib/classes/eventsmanager/notify/ordernotdelivered.php b/lib/classes/eventsmanager/notify/ordernotdelivered.php index 8d3e6a4fdd..c7210f0096 100644 --- a/lib/classes/eventsmanager/notify/ordernotdelivered.php +++ b/lib/classes/eventsmanager/notify/ordernotdelivered.php @@ -87,7 +87,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac $emitter = Emitter::fromUser($user_from); $readyToSend = true; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -114,7 +114,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac try { $registered_user = User_Adapter::getInstance($from, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/push.php b/lib/classes/eventsmanager/notify/push.php index e5c0deb494..fa5e54003d 100644 --- a/lib/classes/eventsmanager/notify/push.php +++ b/lib/classes/eventsmanager/notify/push.php @@ -127,7 +127,7 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract try { $registered_user = User_Adapter::getInstance($from, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/register.php b/lib/classes/eventsmanager/notify/register.php index 18a915fade..aaa99b4386 100644 --- a/lib/classes/eventsmanager/notify/register.php +++ b/lib/classes/eventsmanager/notify/register.php @@ -80,7 +80,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract $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 { $registered_user = User_Adapter::getInstance($usr_id, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/validate.php b/lib/classes/eventsmanager/notify/validate.php index 5caebcb84d..05879bb2e5 100644 --- a/lib/classes/eventsmanager/notify/validate.php +++ b/lib/classes/eventsmanager/notify/validate.php @@ -139,7 +139,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract try { $registered_user = User_Adapter::getInstance($from, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { 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_name = trim($basket->getName()) ? : _('Une selection'); - } catch (Exception $e) { + } catch (\Exception $e) { $basket_name = _('Une selection'); } diff --git a/lib/classes/eventsmanager/notify/validationdone.php b/lib/classes/eventsmanager/notify/validationdone.php index 30f45d2d84..8513f0aa75 100644 --- a/lib/classes/eventsmanager/notify/validationdone.php +++ b/lib/classes/eventsmanager/notify/validationdone.php @@ -133,7 +133,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract try { $registered_user = User_Adapter::getInstance($from, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } @@ -143,7 +143,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract $repository = $this->app['EM']->getRepository('\Entities\Basket'); $basket = $repository->findUserBasket($this->app, $ssel_id, $this->app['authentication']->getUser(), false); - } catch (Exception $e) { + } catch (\Exception $e) { return array(); } diff --git a/lib/classes/eventsmanager/notify/validationreminder.php b/lib/classes/eventsmanager/notify/validationreminder.php index 7f9518cbda..a4fd4006c2 100644 --- a/lib/classes/eventsmanager/notify/validationreminder.php +++ b/lib/classes/eventsmanager/notify/validationreminder.php @@ -89,7 +89,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra try { $user_from = User_Adapter::getInstance($params['from'], $this->app); $user_to = User_Adapter::getInstance($params['to'], $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { return false; } @@ -138,7 +138,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra try { $registered_user = User_Adapter::getInstance($from, $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { 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_name = trim($basket->getName()) ? : _('Une selection'); - } catch (Exception $e) { + } catch (\Exception $e) { $basket_name = _('Une selection'); } diff --git a/lib/classes/ftpclient.php b/lib/classes/ftpclient.php index 13dd95d1e9..4063d6edeb 100644 --- a/lib/classes/ftpclient.php +++ b/lib/classes/ftpclient.php @@ -200,7 +200,7 @@ class ftpclient echo "Resume seems not to be supported, try again from scratch\n
"; try { $this->unlink($remotefile); - } catch (Exception $e) { + } catch (\Exception $e) { echo $e; } $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
"; try { $this->unlink($localfile); - } catch (Exception $e) { + } catch (\Exception $e) { echo $e; } $ret = $this->nb_get($localfile, $remotefile, 0); diff --git a/lib/classes/media/Permalink/Adapter.php b/lib/classes/media/Permalink/Adapter.php index 7bb4a699e2..313b3dc740 100644 --- a/lib/classes/media/Permalink/Adapter.php +++ b/lib/classes/media/Permalink/Adapter.php @@ -259,7 +259,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea $this->label = $datas['label']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -307,7 +307,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea { try { return new self($app, $databox, $media_subdef); - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php index 0be3199f8a..0849875302 100644 --- a/lib/classes/media/subdef.php +++ b/lib/classes/media/subdef.php @@ -179,7 +179,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $this->creation_date = $datas['creation_date']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/module/console/sphinxGenerateSuggestion.php b/lib/classes/module/console/sphinxGenerateSuggestion.php index f83277f111..da2a0f294b 100644 --- a/lib/classes/module/console/sphinxGenerateSuggestion.php +++ b/lib/classes/module/console/sphinxGenerateSuggestion.php @@ -78,7 +78,7 @@ class module_console_sphinxGenerateSuggestion extends Command try { $connbas = connection::getPDOConnection($this->container, $sbas_id); - } catch (Exception $e) { + } catch (\Exception $e) { continue; } diff --git a/lib/classes/module/console/systemMailCheck.php b/lib/classes/module/console/systemMailCheck.php index 9040aef5a0..34ac0872a8 100644 --- a/lib/classes/module/console/systemMailCheck.php +++ b/lib/classes/module/console/systemMailCheck.php @@ -93,7 +93,7 @@ class module_console_systemMailCheck extends Command $tmp_user->set_email(null); unset($users[$id]); - } catch (Exception $e) { + } catch (\Exception $e) { $output->writeln('Wrong id'); } } diff --git a/lib/classes/module/console/systemTemplateGenerator.php b/lib/classes/module/console/systemTemplateGenerator.php index 818713ae9f..e130c55f85 100644 --- a/lib/classes/module/console/systemTemplateGenerator.php +++ b/lib/classes/module/console/systemTemplateGenerator.php @@ -55,7 +55,7 @@ class module_console_systemTemplateGenerator extends Command $this->container['twig']->loadTemplate(str_replace($tplDir, '', $file->getPathname())); $output->writeln('' . $file . ''); $n_ok ++; - } catch (Exception $e) { + } catch (\Exception $e) { $output->writeln('' . $e->getMessage() . ''); $n_error ++; } diff --git a/lib/classes/module/console/taskState.php b/lib/classes/module/console/taskState.php index acc9de3880..c25cd886b4 100644 --- a/lib/classes/module/console/taskState.php +++ b/lib/classes/module/console/taskState.php @@ -85,7 +85,7 @@ class module_console_taskState extends Command $output->writeln($input->getOption('short') ? 'unknown_id' : $e->getMessage()); return self::EXITCODE_TASK_UNKNOWN; - } catch (Exception $e) { + } catch (\Exception $e) { $output->writeln($input->getOption('short') ? 'fatal_error' : $e->getMessage()); return self::EXITCODE_FATAL_ERROR; diff --git a/lib/classes/module/console/taskrun.php b/lib/classes/module/console/taskrun.php index e6e05c083e..85a2d040c3 100644 --- a/lib/classes/module/console/taskrun.php +++ b/lib/classes/module/console/taskrun.php @@ -148,7 +148,7 @@ class module_console_taskrun extends Command try { $this->task->run($runner); - } catch (Exception $e) { + } catch (\Exception $e) { $this->task->log(sprintf("taskrun : exception from 'run()', %s \n", $e->getMessage())); return($e->getCode()); diff --git a/lib/classes/module/report.php b/lib/classes/module/report.php index d8fdf31734..f94d66bd07 100644 --- a/lib/classes/module/report.php +++ b/lib/classes/module/report.php @@ -850,7 +850,7 @@ class module_report $this->setReport(); return $this->report; - } catch (Exception $e) { + } catch (\Exception $e) { echo $e->getMessage(); } } diff --git a/lib/classes/module/report/add.php b/lib/classes/module/report/add.php index 83a84533bc..69a9a74e02 100644 --- a/lib/classes/module/report/add.php +++ b/lib/classes/module/report/add.php @@ -80,7 +80,7 @@ class module_report_add extends module_report try { $user = User_Adapter::getInstance($value, $this->app); $caption = $user->get_display_name(); - } catch (Exception $e) { + } catch (\Exception $e) { } } elseif ($field == 'date') diff --git a/lib/classes/module/report/dashboard.php b/lib/classes/module/report/dashboard.php index 17a3464c9a..f04e40f72c 100644 --- a/lib/classes/module/report/dashboard.php +++ b/lib/classes/module/report/dashboard.php @@ -328,7 +328,7 @@ class module_report_dashboard implements module_report_dashboard_componentInterf $this->app, $sbasid, $coll, $this->dmin, $this->dmax ); } - } catch (Exception $e) { + } catch (\Exception $e) { } $i ++; diff --git a/lib/classes/module/report/dashboard/feed.php b/lib/classes/module/report/dashboard/feed.php index 589f59bd5c..95f55564d8 100644 --- a/lib/classes/module/report/dashboard/feed.php +++ b/lib/classes/module/report/dashboard/feed.php @@ -76,7 +76,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI $result->setApplication($app); return $result; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/module/report/download.php b/lib/classes/module/report/download.php index 23fe7e9291..de06639877 100644 --- a/lib/classes/module/report/download.php +++ b/lib/classes/module/report/download.php @@ -114,7 +114,7 @@ class module_report_download extends module_report if (array_key_exists('record_id', $row)) { try { $record = new \record_adapter($app, $this->sbas_id, $row['record_id']); - } catch (Exception_Record_AdapterNotFound $e) { + } catch (\Exception_Record_AdapterNotFound $e) { continue; } diff --git a/lib/classes/module/report/edit.php b/lib/classes/module/report/edit.php index 6bb505da31..095fa30495 100644 --- a/lib/classes/module/report/edit.php +++ b/lib/classes/module/report/edit.php @@ -80,7 +80,7 @@ class module_report_edit extends module_report try { $user = User_Adapter::getInstance($value, $this->app); $caption = $user->get_display_name(); - } catch (Exception $e) { + } catch (\Exception $e) { } } elseif ($field == 'date') { diff --git a/lib/classes/module/report/nav.php b/lib/classes/module/report/nav.php index 93c06cb20d..1e499c8d45 100644 --- a/lib/classes/module/report/nav.php +++ b/lib/classes/module/report/nav.php @@ -498,7 +498,7 @@ class module_report_nav extends module_report try { $record = new record_adapter($this->app, $sbas_id, $rid); - } catch (Exception_Record_AdapterNotFound $e) { + } catch (\Exception_Record_AdapterNotFound $e) { return $this->report; } diff --git a/lib/classes/module/report/push.php b/lib/classes/module/report/push.php index 01bde0f9cc..372940b619 100644 --- a/lib/classes/module/report/push.php +++ b/lib/classes/module/report/push.php @@ -81,7 +81,7 @@ class module_report_push extends module_report try { $user = User_Adapter::getInstance($value, $this->app); $caption = $user->get_display_name(); - } catch (Exception $e) { + } catch (\Exception $e) { } } elseif ($field == 'date') { diff --git a/lib/classes/module/report/sent.php b/lib/classes/module/report/sent.php index 2932e30638..a24ac1e81e 100644 --- a/lib/classes/module/report/sent.php +++ b/lib/classes/module/report/sent.php @@ -81,7 +81,7 @@ class module_report_sent extends module_report try { $user = User_Adapter::getInstance($value, $this->app); $caption = $user->get_display_name(); - } catch (Exception $e) { + } catch (\Exception $e) { } } elseif ($field == 'date') { diff --git a/lib/classes/module/report/validate.php b/lib/classes/module/report/validate.php index e6458e81be..6f4e31692f 100644 --- a/lib/classes/module/report/validate.php +++ b/lib/classes/module/report/validate.php @@ -81,7 +81,7 @@ class module_report_validate extends module_report try { $user = User_Adapter::getInstance($value, $this->app); $caption = $user->get_display_name(); - } catch (Exception $e) { + } catch (\Exception $e) { } } elseif ($field == 'date') { diff --git a/lib/classes/patch/320alpha4b.php b/lib/classes/patch/320alpha4b.php index e5c4f0a2d6..91a352df64 100644 --- a/lib/classes/patch/320alpha4b.php +++ b/lib/classes/patch/320alpha4b.php @@ -63,7 +63,7 @@ class patch_320alpha4b implements patchInterface $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/phrasea.php b/lib/classes/phrasea.php index 23dd7c3db8..90ae0d7fb0 100644 --- a/lib/classes/phrasea.php +++ b/lib/classes/phrasea.php @@ -66,7 +66,7 @@ class phrasea self::$_sbas_params = $app['phraseanet.appbox']->get_data_from_cache(self::CACHE_SBAS_PARAMS); return self::$_sbas_params; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -132,7 +132,7 @@ class phrasea if (!self::$_bas2sbas) { try { 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'; $stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt->execute(); @@ -223,7 +223,7 @@ class phrasea if (!self::$_sbas_names) { try { 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) { self::$_sbas_names[$databox->get_sbas_id()] = $databox->get_viewname(); } @@ -239,7 +239,7 @@ class phrasea if (!self::$_sbas_labels) { try { 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) { self::$_sbas_labels[$databox->get_sbas_id()] = array( 'fr' => $databox->get_label('fr'), @@ -264,7 +264,7 @@ class phrasea if (!self::$_bas_labels) { try { 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 ($databox->get_collections() as $collection) { self::$_bas_labels[$collection->get_base_id()] = array( diff --git a/lib/classes/random.php b/lib/classes/random.php index fb2c841812..89e59b5c53 100644 --- a/lib/classes/random.php +++ b/lib/classes/random.php @@ -76,7 +76,7 @@ class random $stmt->closeCursor(); return true; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -185,7 +185,7 @@ class random $stmt->closeCursor(); return true; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -205,7 +205,7 @@ class random $stmt->closeCursor(); return true; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index 358ade43dd..2563c29e98 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -192,7 +192,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface $this->base_id = $datas['base_id']; return $this; - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -522,7 +522,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface try { return $this->get_subdef('thumbnailGIF'); - } catch (Exception $e) { + } catch (\Exception $e) { } @@ -568,7 +568,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface { try { return $this->get_data_from_cache(self::CACHE_STATUS); - } catch (Exception $e) { + } catch (\Exception $e) { } $sql = 'SELECT BIN(status) as status FROM record @@ -714,7 +714,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface { try { 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) { try { $this->technical_datas = $this->get_data_from_cache(self::CACHE_TECHNICAL_DATAS); - } catch (Exception $e) { + } catch (\Exception $e) { $this->technical_datas = array(); $connbas = $this->get_databox()->get_connection(); $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'); return $this->get_subdef('preview')->is_physically_present(); - } catch (Exception $e) { + } catch (\Exception $e) { unset($e); } @@ -1282,7 +1282,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface ':coll_id' => $collection->get_coll_id() )); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { unset($e); } @@ -1337,7 +1337,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface ':coll_id' => $file->getCollection()->get_coll_id() )); $stmt->closeCursor(); - } catch (Exception $e) { + } catch (\Exception $e) { unset($e); } diff --git a/lib/classes/record/preview.php b/lib/classes/record/preview.php index 9c42f50606..b5c41c1351 100644 --- a/lib/classes/record/preview.php +++ b/lib/classes/record/preview.php @@ -381,7 +381,7 @@ class record_preview extends record_adapter try { $user = \User_Adapter::getInstance($row['usr_id'], $this->app); - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/recordutils/image.php b/lib/classes/recordutils/image.php index f3f3074e26..569c4dfda6 100644 --- a/lib/classes/recordutils/image.php +++ b/lib/classes/recordutils/image.php @@ -58,7 +58,7 @@ class recordutils_image extends recordutils if (MediaInterface::TYPE_IMAGE === $image->getType()) { $rotation = $image->getOrientation(); } - } catch (Exception $e) { + } catch (\Exception $e) { // getting orientation failed but we don't care the reason } diff --git a/lib/classes/registry.php b/lib/classes/registry.php index 6ea4aab7ac..f2892bea43 100644 --- a/lib/classes/registry.php +++ b/lib/classes/registry.php @@ -77,7 +77,7 @@ class registry implements registryInterface $rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->closeCursor(); $loaded = true; - } catch (Exception $e) { + } catch (\Exception $e) { } foreach ($rs as $row) { diff --git a/lib/classes/set/export.php b/lib/classes/set/export.php index 8a0aacb96c..f1e55b2bf1 100644 --- a/lib/classes/set/export.php +++ b/lib/classes/set/export.php @@ -100,7 +100,7 @@ class set_export extends set_abstract try { $record = new record_adapter($this->app, $basrec[0], $basrec[1]); - } catch (Exception_Record_AdapterNotFound $e) { + } catch (\Exception_Record_AdapterNotFound $e) { continue; } diff --git a/lib/classes/set/order.php b/lib/classes/set/order.php index fe821b8ba1..74df8ead3b 100644 --- a/lib/classes/set/order.php +++ b/lib/classes/set/order.php @@ -116,7 +116,7 @@ class set_order extends set_abstract $stmt->closeCursor(); $app['phraseanet.appbox']->get_connection()->commit(); - } catch (Exception $e) { + } catch (\Exception $e) { $app['phraseanet.appbox']->get_connection()->rollBack(); return false; @@ -431,7 +431,7 @@ class set_order extends set_abstract $this->user->ACL()->grant_hd_on($record, $app['authentication']->getUser(), 'order'); unset($record); - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/lib/classes/set/selection.php b/lib/classes/set/selection.php index ee03757b6b..d6a3218da7 100644 --- a/lib/classes/set/selection.php +++ b/lib/classes/set/selection.php @@ -106,7 +106,7 @@ class set_selection extends set_abstract if ($num_rows == 0) { $to_remove[] = $id; } - } catch (Exception $e) { + } catch (\Exception $e) { } } @@ -131,7 +131,7 @@ class set_selection extends set_abstract if (count($basrec) == 2) { try { $record = new record_adapter($this->app, (int) $basrec[0], (int) $basrec[1], count($this->elements)); - } catch (Exception $e) { + } catch (\Exception $e) { continue; } if ($record->is_grouping() && $flatten_groupings === true) { diff --git a/lib/classes/task/abstract.php b/lib/classes/task/abstract.php index ef95588812..a2280a6754 100644 --- a/lib/classes/task/abstract.php +++ b/lib/classes/task/abstract.php @@ -135,7 +135,7 @@ abstract class task_abstract try { $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->sleep(60 * 10); @@ -691,7 +691,7 @@ abstract class task_abstract try { // process one record $this->processOneContent($box, $row); - } catch (Exception $e) { + } catch (\Exception $e) { $this->log("Exception : " . $e->getMessage() . " " . basename($e->getFile()) . " " . $e->getLine(), self::LOG_ERROR); } @@ -721,7 +721,7 @@ abstract class task_abstract $this->running = FALSE; $ret = self::STATE_TOSTOP; } - } catch (Exception $e) { + } catch (\Exception $e) { $this->running = FALSE; } @@ -752,7 +752,7 @@ abstract class task_abstract $this->running = FALSE; $ret = self::STATE_TOSTOP; } - } catch (Exception $e) { + } catch (\Exception $e) { $this->running = FALSE; } } @@ -917,7 +917,7 @@ abstract class task_abstract )); $stmt->closeCursor(); $this->completed_percentage = $p; - } catch (Exception $e) { + } catch (\Exception $e) { } diff --git a/lib/classes/task/appboxAbstract.php b/lib/classes/task/appboxAbstract.php index 18aa8ccfc0..69895c0e99 100644 --- a/lib/classes/task/appboxAbstract.php +++ b/lib/classes/task/appboxAbstract.php @@ -29,7 +29,7 @@ abstract class task_appboxAbstract extends task_abstract while ($this->running) { try { $conn = connection::getPDOConnection($this->dependencyContainer); - } catch (Exception $e) { + } catch (\Exception $e) { $this->log($e->getMessage()); if ($this->getRunner() == self::RUNNER_SCHEDULER) { $this->log(("Warning : abox connection lost, restarting in 10 min.")); @@ -59,7 +59,7 @@ abstract class task_appboxAbstract extends task_abstract $stmt->closeCursor(); $this->records_done = 0; $duration = time(); - } catch (Exception $e) { + } catch (\Exception $e) { // failed sql, simply return $this->running = FALSE; @@ -73,7 +73,7 @@ abstract class task_appboxAbstract extends task_abstract try { $this->loadSettings(simplexml_load_string($row['settings'])); - } catch (Exception $e) { + } catch (\Exception $e) { $this->log($e->getMessage()); continue; } @@ -125,7 +125,7 @@ abstract class task_appboxAbstract extends task_abstract // process the records $ret = $this->processLoop($appbox, $rs); - } catch (Exception $e) { + } catch (\Exception $e) { $this->log('Error : ' . $e->getMessage()); } diff --git a/lib/classes/task/databoxAbstract.php b/lib/classes/task/databoxAbstract.php index 79cc6e8e0e..ae09b0f535 100644 --- a/lib/classes/task/databoxAbstract.php +++ b/lib/classes/task/databoxAbstract.php @@ -69,7 +69,7 @@ abstract class task_databoxAbstract extends task_abstract $stmt->closeCursor(); $this->records_done = 0; $duration = time(); - } catch (Exception $e) { + } catch (\Exception $e) { // failed sql, simply return $this->running = FALSE; @@ -87,7 +87,7 @@ abstract class task_databoxAbstract extends task_abstract try { // get the records to process $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"', $row['sbas_id'], $e->getMessage()), @@ -98,7 +98,7 @@ abstract class task_databoxAbstract extends task_abstract try { $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"', $e->getMessage()), self::LOG_WARNING @@ -167,7 +167,7 @@ abstract class task_databoxAbstract extends task_abstract // process the records $ret = $this->processLoop($databox, $rs); - } catch (Exception $e) { + } catch (\Exception $e) { $this->log($e->getMessage(), self::LOG_ERROR); } diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index 67d85170a8..1f090c5000 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -108,7 +108,7 @@ class task_manager } try { $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 ); } - } catch (Exception $e) { + } catch (\Exception $e) { } } diff --git a/lib/classes/task/period/RecordMover.php b/lib/classes/task/period/RecordMover.php index 5b70b11554..841205d96b 100644 --- a/lib/classes/task/period/RecordMover.php +++ b/lib/classes/task/period/RecordMover.php @@ -351,7 +351,7 @@ class task_period_RecordMover extends task_appboxAbstract try { $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); continue; } @@ -513,7 +513,7 @@ class task_period_RecordMover extends task_appboxAbstract $ret['err_htmlencoded'] = htmlentities($ret['err']); break; } - } catch (Exception $e) { + } catch (\Exception $e) { $ret['err'] = "bad sbas '" . $sbas_id . "'"; $ret['err_htmlencoded'] = htmlentities($ret['err']); } diff --git a/lib/classes/task/period/apibridge.php b/lib/classes/task/period/apibridge.php index 8e2309839f..0e7ed02bfd 100644 --- a/lib/classes/task/period/apibridge.php +++ b/lib/classes/task/period/apibridge.php @@ -77,7 +77,7 @@ class task_period_apibridge extends task_appboxAbstract } else { $this->update_element($element); } - } catch (Exception $e) { + } catch (\Exception $e) { $sql = 'UPDATE bridge_elements SET status = :status WHERE id = :id'; $params = array( @@ -117,7 +117,7 @@ class task_period_apibridge extends task_appboxAbstract try { $dist_id = $account->get_api()->upload($element->get_record(), $element->get_datas()); $element->set_uploaded_on(new DateTime()); - } catch (Exception $e) { + } catch (\Exception $e) { $this->log('Error while uploading : ' . $e->getMessage()); $element->set_status(Bridge_Element::STATUS_ERROR); } diff --git a/lib/classes/task/period/archive.php b/lib/classes/task/period/archive.php index 145fb051a8..dd75782035 100644 --- a/lib/classes/task/period/archive.php +++ b/lib/classes/task/period/archive.php @@ -379,7 +379,7 @@ class task_period_archive extends task_abstract while ($this->running) { try { $conn = connection::getPDOConnection($this->dependencyContainer); - } catch (Exception $e) { + } catch (\Exception $e) { $this->log($e->getMessage()); if ($this->getRunner() == self::RUNNER_SCHEDULER) { $this->log(("Warning : abox connection lost, restarting in 10 min.")); @@ -436,7 +436,7 @@ class task_period_archive extends task_abstract $cold = 30; } } - } catch (Exception $e) { + } catch (\Exception $e) { 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())); @@ -787,7 +787,7 @@ class task_period_archive extends task_abstract $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++; } $node->setAttribute('grp', 'tocomplete'); - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->addDebug($e->getMessage()); } } diff --git a/lib/classes/task/period/ftp.php b/lib/classes/task/period/ftp.php index c9cf290baf..c7429d0bfa 100644 --- a/lib/classes/task/period/ftp.php +++ b/lib/classes/task/period/ftp.php @@ -241,7 +241,7 @@ class task_period_ftp extends task_appboxAbstract $stmt->closeCursor(); return true; - } catch (Exception $e) { + } catch (\Exception $e) { return false; } } else { @@ -362,7 +362,7 @@ class task_period_ftp extends task_appboxAbstract if ($ftp_export["passif"] == "1") { try { $ftp_client->passive(true); - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->addDebug($e->getMessage()); } } @@ -371,7 +371,7 @@ class task_period_ftp extends task_appboxAbstract try { $ftp_client->chdir($ftp_export["destfolder"]); $ftp_export["destfolder"] = '/' . $ftp_export["destfolder"]; - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->addDebug($e->getMessage()); } } else { @@ -381,14 +381,14 @@ class task_period_ftp extends task_appboxAbstract if (trim($ftp_export["foldertocreate"]) != '') { try { $ftp_client->mkdir($ftp_export["foldertocreate"]); - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->addDebug($e->getMessage()); } try { $new_dir = $ftp_client->add_end_slash($ftp_export["destfolder"]) . $ftp_export["foldertocreate"]; $ftp_client->chdir($new_dir); - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->addDebug($e->getMessage()); } } @@ -451,7 +451,7 @@ class task_period_ftp extends task_appboxAbstract if ($ftp_client->pwd() != $current_folder) { try { $ftp_client->chdir($current_folder); - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->addDebug($e->getMessage()); } } @@ -473,7 +473,7 @@ class task_period_ftp extends task_appboxAbstract $stmt->execute(array(':file_id' => $file['id'])); $stmt->closeCursor(); $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"' . ' (Export du Document) : Transfert cancelled (le document n\'existe plus)') , basename($localfile), $record_id @@ -533,7 +533,7 @@ class task_period_ftp extends task_appboxAbstract $ftp_client->close(); unset($ftp_client); - } catch (Exception $e) { + } catch (\Exception $e) { $state .= $line = $e . "\n"; $this->logger->addDebug($line); diff --git a/lib/classes/task/period/ftpPull.php b/lib/classes/task/period/ftpPull.php index c1361b303a..06e9ad6e1c 100644 --- a/lib/classes/task/period/ftpPull.php +++ b/lib/classes/task/period/ftpPull.php @@ -325,7 +325,7 @@ class task_period_ftpPull extends task_appboxAbstract $stmt->closeCursor(); return true; - } catch (Exception $e) { + } catch (\Exception $e) { return false; } } else { @@ -423,7 +423,7 @@ class task_period_ftpPull extends task_appboxAbstract $ftp->get($finalpath, $filepath); $ftp->delete($filepath); - } catch (Exception $e) { + } catch (\Exception $e) { $this->logger->addDebug("Erreur lors du rappatriement de $filepath : " . $e->getMessage()); } } @@ -431,7 +431,7 @@ class task_period_ftpPull extends task_appboxAbstract $ftp->close(); $this->setProgress(0, 0); - } catch (Exception $e) { + } catch (\Exception $e) { if (isset($ftp) && $ftp instanceof ftpclient) { $ftp->close(); }