// $query = 'SELECT age FROM user WHERE user_uid = ' . $GLOBALS['ansel_db']->quote(Horde_Auth::getAuth());
// $result = $GLOBALS['ansel_db']->queryOne($query);
// if (is_a($result, 'PEAR_Error')) {
-// throw new Horde_Exception($result);
+// throw new Horde_Exception_Prior($result);
// }
//
// return (int)$result;
// } catch (Horde_Service_Facebook_Exception $e) {
// // For now, just pass back as a pear error...needs to be cleaned up
// $GLOBALS['notification']->push('Horde_Service_Facebook: ' . $e->getMessage(), 'horde.err');
-// throw new Horde_Exception($e);
+// throw new Horde_Exception_Prior($e);
// }
// if (!empty($GLOBALS['notification'])) {
// $GLOBALS['notification']->push('Notification published to Facebook.', 'horde.success');
// Create db, share, and vfs instances.
$GLOBALS['ansel_db'] = Ansel::getDb();
if (is_a($GLOBALS['ansel_db'], 'PEAR_Error')) {
- throw new Horde_Exception($GLOBALS['ansel_db']);
+ throw new Horde_Exception_Prior($GLOBALS['ansel_db']);
}
$GLOBALS['ansel_storage'] = new Ansel_Storage();
$sql = 'SELECT face_id FROM ansel_faces WHERE image_id = ' . $image->id;
$face = $GLOBALS['ansel_db']->queryCol($sql);
if ($face instanceof PEAR_Error) {
- throw new Horde_Exception($face);
+ throw new Horde_Exception_Prior($face);
}
foreach ($face as $id) {
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
$GLOBALS['ansel_db']->setLimit($count, $from);
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
$img = Ansel::getImageObject();
$data = $GLOBALS['ansel_vfs']->read($vfspath, $vfsname);
if ($data instanceof PEAR_Error) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
}
$img->loadString($face_id, $data);
$new = true;
$face_id = $GLOBALS['ansel_db']->nextId('ansel_faces');
if ($face_id instanceof PEAR_Error) {
- throw new Horde_Exception($face_id);
+ throw new Horde_Exception_Prior($face_id);
}
}
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute($params);
$q->free();
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
// Update gallery and image counts
// Create Face id
$face_id = $GLOBALS['ansel_db']->nextId('ansel_faces');
if ($face_id instanceof PEAR_Error) {
- throw new Horde_Exception($face_id);
+ throw new Horde_Exception_Prior($face_id);
}
// Store face id db
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute($params);
$q->free();
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($create) {
// Process image
$result = $GLOBALS['ansel_vfs']->writeData($path . 'faces', $face_id . $ext,
$image->_image->raw(), true);
if (is_a($result, 'PEAR_Error')) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
return $face_id;
$params = array(puzzle_compress_cvec($signature), $face_id);
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute($params);
$q->free();
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
// create index
$GLOBALS['ansel_db']->exec('DELETE FROM ansel_faces_index WHERE face_id = ' . $face_id);
$q = &$GLOBALS['ansel_db']->prepare('INSERT INTO ansel_faces_index (face_id, index_position, index_part) VALUES (?, ?, ?)');
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$GLOBALS['ansel_db']->loadModule('Extended');
$q = $GLOBALS['ansel_db']->prepare($sql, null, MDB2_PREPARE_MANIP);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
return $q->execute($params);
$sql .= ' FROM ansel_faces WHERE face_id = ?';
$q = $GLOBALS['ansel_db']->prepare($sql);
if ($q instanceof PEAR_Error) {
- throw new Horde_Exception($q);
+ throw new Horde_Exception_Prior($q);
}
$result = $q->execute((int)$face_id);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
throw new Horde_Exception('Face does not exist');
}
$face = $result->fetchRow(MDB2_FETCHMODE_ASSOC);
if (is_a($face, 'PEAR_Error')) {
- throw new Horde_Exception($face);
+ throw new Horde_Exception_Prior($face);
}
// Always return the face_id
$sql = 'SELECT gallery_id, image_id FROM ansel_faces WHERE face_name = ' . $GLOBALS['ansel_db']->quote($face['face_name']);
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
throw new Horde_Exception('Face does not exist');
}
$result = $GLOBALS['ansel_db']->query($sql);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif ($result->numRows() == 0) {
return array();
}
try {
$this->_data[$view] = $this->_image->raw();
} catch (Horde_Image_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$this->_image->loadString($vfspath . '/' . $this->id,
$this->_data[$view]);
$error = sprintf(_("The gallery \"%s\" could not be created: %s"),
$attributes['name'], $result->getMessage());
Horde::logMessage($error, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($error);
+ throw new Horde_Exception_Prior($error);
}
/* Convenience */
$this->_write_db = &DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
$this->_db = &DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
$result = $_db->getRow($query, array($username, $info['extra']['email']), DB_FETCHMODE_ASSOC);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
} elseif (empty($result)) {
return $info;
} elseif ($result['user_uid'] == $username) {
$result = $_db->query($query, $values);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/Folks.php';
$result = $GLOBALS['folks_driver']->addUser($userId, $credentials);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
}
try {
$result = $img->loadFile($file);
} catch (Horde_Image_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$dimensions = $img->getDimensions();
if ($dimensions instanceof PEAR_Error) {
$this->_write_db = DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
$this->_db = DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
$this->_write_db = DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
$this->_db = DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
try {
$response = $client->get($url);
} catch (Horde_Http_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
return array('status' => 200,
'results' => $response->getBody());
* @author Michael Slusarz <slusarz@curecanti.org>
* @package Horde_Auth
*/
-class Horde_Auth_Exception extends Horde_Exception
+class Horde_Auth_Exception extends Horde_Exception_Prior
{
}
unset($params['charset']);
$this->_write_db = MDB2::factory($params);
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Set DB portability options. */
$params = array_merge($params, $this->_params['read']);
$this->_db = MDB2::factory($params);
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
/* Set DB portability options. */
try {
$result = call_user_func_array(array($api, $call), $args);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
} catch (Horde_Exception $e) {
$result = $e;
*/
class Horde_Exception extends Exception
{
- /**
- * Exception constructor
- *
- * @param mixed $message The exception message, a PEAR_Error
- * object, or an Exception object.
- * @param int $code A numeric error code.
- */
- public function __construct($message = null, $code = null)
- {
- if (is_object($message) &&
- method_exists($message, 'getMessage')) {
- if (is_null($code) &&
- method_exists($message, 'getCode')) {
- $code = $message->getCode();
- }
- $message = $message->getMessage();
- }
-
- parent::__construct($message, $code);
- }
-
}
--- /dev/null
+<?php
+/**
+ * Horde exception class that also accepts PEAR errors and exceptions as message
+ * input.
+ *
+ * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package Horde_Exception
+ */
+class Horde_Exception_Prior extends Horde_Exception
+{
+ /**
+ * Exception constructor.
+ *
+ * @param mixed $message The exception message, a PEAR_Error
+ * object, or an Exception object.
+ * @param int $code A numeric error code.
+ */
+ public function __construct($message = null, $code = null)
+ {
+ if (is_object($message) &&
+ method_exists($message, 'getMessage')) {
+ if (is_null($code) &&
+ method_exists($message, 'getCode')) {
+ $code = $message->getCode();
+ }
+ $message = $message->getMessage();
+ }
+
+ parent::__construct($message, $code);
+ }
+
+}
<file name="LastError.php" role="php" />
<file name="NotFound.php" role="php" />
<file name="PermissionDenied.php" role="php" />
+ <file name="Prior.php" role="php" />
</dir> <!-- /lib/Exception -->
<file name="Exception.php" role="php" />
</dir> <!-- /lib/Horde -->
<install name="lib/Horde/Exception.php" as="Horde/Exception.php" />
<install name="lib/Horde/Exception/LastError.php" as="Horde/Exception/LastError.php" />
<install name="lib/Horde/Exception/NotFound.php" as="Horde/Exception/NotFound.php" />
- <install name="lib/Horde/Exception/PermissionDenied.php" as="Horde/Exception/PermissionDenied.php" />
+ <install name="lib/Horde/Exception/PermissionDenied.php" as="Horde/Exception/PermissionDenied.php" <install name="lib/Horde/Exception/Prior.php" as="Horde/Exception/Prior.php" />
+/>
</filelist>
</phprelease>
<changelog/>
* Require the tested classes.
*/
require_once 'Horde/Exception.php';
+require_once 'Horde/Exception/Prior.php';
require_once 'Horde/Exception/LastError.php';
/**
public function testEmptyConstructionYieldsEmptyMessage()
{
- $e = new Horde_Exception();
+ $e = new Horde_Exception_Prior();
$this->assertSame('', $e->getMessage());
}
public function testEmptyConstructionYieldsCodeZero()
{
- $e = new Horde_Exception();
+ $e = new Horde_Exception_Prior();
$this->assertSame(0, $e->getCode());
}
{
require_once dirname(__FILE__) . '/Stub/PearError.php';
$p = new Horde_Exception_Stub_PearError('pear');
- $e = new Horde_Exception($p);
+ $e = new Horde_Exception_Prior($p);
$this->assertSame('pear', $e->getMessage());
}
{
require_once dirname(__FILE__) . '/Stub/PearError.php';
$p = new Horde_Exception_Stub_PearError('pear', 666);
- $e = new Horde_Exception($p);
+ $e = new Horde_Exception_Prior($p);
$this->assertSame(666, $e->getCode());
}
$this->assertSame('An error occurred: get_last_error', $e->getMessage());
}
- public function testStringCodesAreSetToNull()
- {
- $e = new Horde_Exception('test', 'some code');
- $this->assertSame(0, $e->getCode());
- }
-
private function _getLastError()
{
return array(
$this->_db[$source] = &DB::connect($this->_sources[$source]['params'],
array('persistent' => !empty($this->_sources[$source]['params']['persistent'])));
if (is_a($this->_db[$source], 'PEAR_Error')) {
- throw new Horde_Exception($this->_db[$source]);
+ throw new Horde_Exception_Prior($this->_db[$source]);
}
/* Set DB portability options. */
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Set DB portability options. */
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
/* Set DB portability options. */
* @category Horde
* @package Horde_Image
*/
-class Horde_Image_Exception extends Exception {
+class Horde_Image_Exception extends Horde_Exception_Prior {
}
?>
\ No newline at end of file
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server_Exception extends Horde_Exception
+class Horde_Kolab_Server_Exception extends Horde_Exception_Prior
{
/**
* Constants to define the error type.
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Session
*/
-class Horde_Kolab_Session_Exception extends Horde_Exception
+class Horde_Kolab_Session_Exception extends Horde_Exception_Prior
{
}
\ No newline at end of file
* @category Horde
* @package Horde_Mime
*/
-class Horde_Mime_Exception extends Horde_Exception
+class Horde_Mime_Exception extends Horde_Exception_Prior
{
}
* @category Horde
* @package Horde_Perms
*/
-class Horde_Perms_Exception extends Horde_Exception
+class Horde_Perms_Exception extends Horde_Exception_Prior
{
}
$result = $this->_imsp->init();
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$this->_imsp->setLogger($GLOBALS['conf']['log']);
$default = $shares->getDefaultShare();
if ($default instanceof PEAR_Error) {
Horde::logMessage($default, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($default);
+ throw new Horde_Exception_Prior($default);
}
$this->_share = $default->getName();
$connection = new Kolab('h-prefs');
if ($connection instanceof PEAR_Error) {
Horde::logMessage($connection, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($connection);
+ throw new Horde_Exception_Prior($connection);
}
$result = $this->_connection->open($this->_share, 1);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$this->_connection = $connection;
$prefs = $this->_connection->getObjects();
if ($prefs instanceof PEAR_Error) {
Horde::logMessage($prefs, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($prefs);
+ throw new Horde_Exception_Prior($prefs);
}
foreach ($prefs as $pref) {
'ssl' => !empty($this->_params['ssl'])));
if ($this->_write_db instanceof PEAR_Error) {
Horde::logMessage($this->_write_db, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
'ssl' => !empty($params['ssl'])));
if ($this->_db instanceof PEAR_Error) {
Horde::logMessage($this->_db, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
array('Content-Type' => 'application/json'));
} catch (Horde_Http_Exception $e) {
if (strpos($e->getMessage(), '201 Created') === false) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} else {
return '';
}
try {
$response = $http->get('http://freshmeat.net/projects/' . $this->notes['fm']['project'] . '/urls.json?auth_code=' . $this->_options['fm']['user_token']);
} catch (Horde_Http_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$url_response = Horde_Serialize::unserialize($response->getBody(), Horde_Serialize::JSON);
$response = $response->getBody();
} catch (Horde_Http_Exception $e) {
if (strpos($e->getMessage(), '201 Created') === false) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} else {
$response = '';
}
$response = $response->getBody();
// Status: 200???
} catch (Horde_Http_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
}
}
$res = Horde_Rpc::request('jsonrpc', $this->_params['url'], $method, $params, $options);
if ($res instanceof PEAR_Error) {
- throw new Horde_Exception($res);
+ throw new Horde_Exception_Prior($res);
}
}
null, array('user' => $this->_params['user'],
'pass' => $this->_params['pass']));
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
return $result->result;
* @category Horde
* @package Horde_Service_Twitter
*/
-class Horde_Service_Twitter_Exception extends Exception {
+class Horde_Service_Twitter_Exception extends Horde_Exception_Prior {
}
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
$this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
$this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
} else {
unset($params['charset']);
$this->_write_db = MDB2::factory($params);
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Attach debug handler. */
unset($params['charset']);
$this->_db = MDB2::singleton($params);
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
$this->_db->setOption('seqcol_name', 'id');
$result = $GLOBALS['testbackend']->addEntry($service, $data, $contentType);
if (is_a($result, 'PEAR_Error')) {
echo "error importing data into $service:\n$data\n";
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($debuglevel >= 2) {
$result = $GLOBALS['testbackend']->replaceEntry($service, $data, $contentType, $suid);
if (is_a($result, 'PEAR_Error')) {
echo "Error replacing data $locuri suid=$suid!\n";
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($debuglevel >= 2) {
// @TODO: simulate a delete by just faking some history data.
if (is_a($result, 'PEAR_Error')) {
echo "Error deleting data $locuri!";
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
if ($debuglevel >= 2) {
echo "simulated $service delete of $suid!\n";
$result = $this->_write_db->query($query, $values);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
}
$result = $this->_write_db->query($query, $values);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
}
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
throw new Horde_Exception('Unknown database abstraction library');
}
if (is_a($dbh, 'PEAR_Error')) {
- throw new Horde_Exception($dbh);
+ throw new Horde_Exception_Prior($dbh);
}
if (!preg_match('/^\w+$/', $sequence)) {
$dbh = DB::connect($conf['sql']);
if (is_a($dbh, 'PEAR_Error')) {
- throw new Horde_Exception($dbh);
+ throw new Horde_Exception_Prior($dbh);
}
$dbh->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
/* Get the perms tree. */
$nodes = $groups->listGroups(true);
if (is_a($nodes, 'PEAR_Error')) {
- throw new Horde_Exception($nodes);
+ throw new Horde_Exception_Prior($nodes);
}
$nodes[GROUP_ROOT] = GROUP_ROOT;
if ($cid > 0) {
$cid_parents = $groups->getGroupParentList($cid);
if (is_a($cid_parents, 'PEAR_Error')) {
- throw new Horde_Exception($cid_parents);
+ throw new Horde_Exception_Prior($cid_parents);
}
}
if ($action == 'deny') {
$result = $signup->removeQueuedSignup($user);
if (is_a($result, 'PEAR_Error')) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
printf(_("The signup request for user \"%s\" has been removed."), $user);
exit;
$dbh = DB::connect($conf['sql']);
if (is_a($dbh, 'PEAR_Error')) {
- throw new Horde_Exception($dbh);
+ throw new Horde_Exception_Prior($dbh);
}
$dbh->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
$users = $auth->listUsers();
if (is_a($users, 'PEAR_Error')) {
- throw new Horde_Exception($users);
+ throw new Horde_Exception_Prior($users);
}
/* Returns only users that match the specified pattern. */
// $result = $db->query($query);
//
// if ($result instanceof PEAR_Error) {
-// throw new Horde_Exception($result);
+// throw new Horde_Exception_Prior($result);
// }
// }
* @author Michael Slusarz <slusarz@horde.org>
* @package IMP
*/
-class IMP_Compose_Exception extends Horde_Exception
+class IMP_Compose_Exception extends Horde_Exception_Prior
{
/**
* Stores information on whether an encryption dialog window needs
* @author Michael Slusarz <slusarz@horde.org>
* @package IMP
*/
-class IMP_Exception extends Horde_Exception
+class IMP_Exception extends Horde_Exception_Prior
{
}
$this->_params['query_quota']);
$result = $this->_db->query($query);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
$this->_params['query_used']);
$result = $this->_db->query($query);
if ($result instanceof PEAR_Error) {
- throw new Horde_Exception($result);
+ throw new Horde_Exception_Prior($result);
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if ($this->_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
/* Set DB portability options. */
$recipients = $this->_db->getAll($query);
if ($recipients instanceof PEAR_Error) {
Horde::logMessage($recipients, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($recipients);
+ throw new Horde_Exception_Prior($recipients);
}
/* Extract email addresses. */
$recipients = $this->_db->getOne($query, array(time() - $hours * 3600));
if ($recipients instanceof PEAR_Error) {
Horde::logMessage($recipients, __FILE__, __LINE__, PEAR_LOG_ERR);
- throw new Horde_Exception($recipients);
+ throw new Horde_Exception_Prior($recipients);
}
return $recipients;
try {
$recip = $imp_compose->recipientList(array('to' => $to));
} catch (IMP_Compose_Exception $e) {
- throw new Horde_Exception($recip);
+ throw new Horde_Exception_Prior($recip);
}
$recipients = implode(', ', $recip['list']);
try {
$imp_compose->sendMessage($recipients, $headers, $mime_message);
} catch (IMP_Compose_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
}
$entry = sprintf("%s Redirected message sent to %s from %s",
$imp_pgp->reloadWindow(Horde_Util::getFormData('reload'));
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No PGP public key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e, 'horde.error');
$actionID = 'import_public_key';
}
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No personal PGP public key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e->getMessage(), 'horde.error');
$imp_pgp->importKeyDialog('process_import_personal_public_key', Horde_Util::getFormData('reload'));
}
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No personal PGP private key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e->getMessage(), 'horde.error');
$imp_pgp->importKeyDialog('process_import_personal_private_key', Horde_Util::getFormData('reload'));
$imp_smime->reloadWindow(Horde_Util::getFormData('reload'));
} catch (Horde_Browser_Exception $e) {
$notification->push(_("No S/MIME public key imported."), 'horde.error');
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push($e, 'horde.error');
$actionID = 'import_public_key';
$notification->push(_("S/MIME Public/Private Keypair successfully added."), 'horde.success');
$imp_smime->reloadWindow(Horde_Util::getFormData('reload'));
} catch (Horde_Browser_Exception $e) {
- throw new Horde_Exception($e);
+ throw new Horde_Exception_Prior($e);
} catch (Horde_Exception $e) {
$notification->push(_("Personal S/MIME certificates NOT imported: ") . $e->getMessage(), 'horde.error');
$actionID = 'import_personal_certs';
* @author Michael Slusarz <slusarz@horde.org>
* @package Ingo
*/
-class Ingo_Exception extends Horde_Exception
+class Ingo_Exception extends Horde_Exception_Prior
{
}
array('persistent' => !empty($this->_params['persistent']),
'ssl' => !empty($this->_params['ssl'])));
if (is_a($this->_write_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_write_db);
+ throw new Horde_Exception_Prior($this->_write_db);
}
/* Set DB portability options. */
switch ($this->_write_db->phptype) {
array('persistent' => !empty($params['persistent']),
'ssl' => !empty($params['ssl'])));
if (is_a($this->_db, 'PEAR_Error')) {
- throw new Horde_Exception($this->_db);
+ throw new Horde_Exception_Prior($this->_db);
}
switch ($this->_db->phptype) {
* @author Jan Schneider <jan@horde.org>
* @package Kronolith
*/
-class Kronolith_Exception extends Horde_Exception
+class Kronolith_Exception extends Horde_Exception_Prior
{
}
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
if (Horde_Auth::isAdmin('news:admin')) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
} else {
header('HTTP/1.0 404 Not Found');
echo '<h1>HTTP/1.0 404 Not Found</h1>';
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
if (Horde_Auth::isAdmin('news:admin')) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
} else {
header('HTTP/1.0 404 Not Found');
echo '<h1>HTTP/1.0 404 Not Found</h1>';
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
if (Horde_Auth::isAdmin('news:admin')) {
- throw new Horde_Exception($data);
+ throw new Horde_Exception_Prior($data);
} else {
header('HTTP/1.0 404 Not Found');
echo '<h1>HTTP/1.0 404 Not Found</h1>';
$this->write_db = &DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->write_db instanceof PEAR_Error) {
- throw new Horde_Exception($this->write_db);
+ throw new Horde_Exception_Prior($this->write_db);
}
// Set DB portability options.
$this->db = &DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->db instanceof PEAR_Error) {
- throw new Horde_Exception($this->db);
+ throw new Horde_Exception_Prior($this->db);
}
// Set DB portability options.
<?php
-class Shout_Exception extends Horde_Exception {}
+class Shout_Exception extends Horde_Exception_Prior {}
$result = $this->_db->query($query, $values);
if (is_a($result instanceof PEAR_Error)) {
- throw Horde_Exception($result);
+ throw Horde_Exception_Prior($result);
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
if ($row instanceof PEAR_Error) {
- throw Horde_Exception($row);
+ throw Horde_Exception_Prior($row);
}
/* Store the retrieved values in the foo variable. */
$this->_write_db = DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->_write_db instanceof PEAR_Error) {
- throw Horde_Exception($this->_write_db);
+ throw Horde_Exception_Prior($this->_write_db);
}
// Set DB portability options.
$this->_db = DB::connect($params,
array('persistent' => !empty($params['persistent'])));
if ($this->_db instanceof PEAR_Error) {
- throw Horde_Exception($this->_db);
+ throw Horde_Exception_Prior($this->_db);
}
// Set DB portability options.
* @author Jan Schneider <jan@horde.org>
* @package Turba
*/
-class Turba_Exception extends Horde_Exception
+class Turba_Exception extends Horde_Exception_Prior
{
}