mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00
Avoid errors by explicitely namespacing root exception
This commit is contained in:
@@ -457,7 +457,7 @@ class Basket
|
||||
$totSize += $basket_element->getRecord($app)
|
||||
->get_subdef('document')
|
||||
->get_size();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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'));
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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';
|
||||
|
@@ -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
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -69,7 +69,7 @@ class collection implements cache_cacheableInterface
|
||||
$this->labels = $datas['labels'];
|
||||
|
||||
return $this;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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');
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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(
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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');
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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');
|
||||
}
|
||||
|
||||
|
@@ -200,7 +200,7 @@ class ftpclient
|
||||
echo "Resume seems not to be supported, try again from scratch\n<br>";
|
||||
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<br>";
|
||||
try {
|
||||
$this->unlink($localfile);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
echo $e;
|
||||
}
|
||||
$ret = $this->nb_get($localfile, $remotefile, 0);
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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('<error>Wrong id</error>');
|
||||
}
|
||||
}
|
||||
|
@@ -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('<error>' . $e->getMessage() . '</error>');
|
||||
$n_error ++;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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());
|
||||
|
@@ -850,7 +850,7 @@ class module_report
|
||||
$this->setReport();
|
||||
|
||||
return $this->report;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
@@ -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')
|
||||
|
@@ -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 ++;
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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') {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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') {
|
||||
|
@@ -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') {
|
||||
|
@@ -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') {
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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(
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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());
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -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']);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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());
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user