+++ /dev/null
-<?php
-/**
- * Horde base exception class, which includes the ability to take the
- * output of error_get_last() as $code and mask itself as that error.
- *
- * Copyright 2008-2009 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 Core
- */
-class Horde_Exception extends Exception
-{
- /**
- * Exception constructor
- *
- * If $code_or_lasterror is passed the return value of
- * error_get_last() (or a matching format), the exception will be
- * rewritten to have its file and line parameters match that of
- * the array, and any message in the array will be appended to
- * $message.
- *
- * @param mixed $message The exception message, a PEAR_Error
- * object, or an Exception object.
- * @param mixed $code_or_lasterror Either a numeric error code, or
- * an array from error_get_last().
- */
- public function __construct($message = null, $code_or_lasterror = null)
- {
- if (is_object($message) &&
- method_exists($message, 'getMessage')) {
- if (is_null($code_or_lasterror) &&
- method_exists($message, 'getCode')) {
- $code_or_lasterror = $message->getCode();
- }
- $message = $message->getMessage();
- }
-
- if (is_null($code_or_lasterror)) {
- $code_or_lasterror = 0;
- }
-
- if (is_array($code_or_lasterror)) {
- if ($message) {
- $message .= $code_or_lasterror['message'];
- } else {
- $message = $code_or_lasterror['message'];
- }
-
- $this->file = $code_or_lasterror['file'];
- $this->line = $code_or_lasterror['line'];
- $code = $code_or_lasterror['type'];
- } else {
- $code = $code_or_lasterror;
- }
-
- if (is_string($code)) {
- $code = null;
- }
-
- parent::__construct($message, $code);
- }
-
-}
<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Renamed Menu:: as Horde_Menu::.
+ <notes>* Moved Horde_Exception to Exception package.
+ * Renamed Menu:: as Horde_Menu::.
* Renamed Help:: as Horde_Help::.
* Removed Text::/Horde_Text::.
* Converted Horde to Horde 4 coding conventions.
<dir name="Horde">
<file name="Config.php" role="php" />
<file name="ErrorHandler.php" role="php" />
- <file name="Exception.php" role="php" />
<file name="Help.php" role="php" />
<file name="Menu.php" role="php" />
<file name="Registry.php" role="php" />
<channel>pear.horde.org</channel>
</package>
<package>
+ <name>Exception</name>
+ <channel>pear.horde.org</channel>
+ </package>
+ <package>
<name>Prefs</name>
<channel>pear.horde.org</channel>
</package>
<filelist>
<install name="lib/Horde/Config.php" as="Horde/Config.php" />
<install name="lib/Horde/ErrorHandler.php" as="Horde/ErrorHandler.php" />
- <install name="lib/Horde/Exception.php" as="Horde/Exception.php" />
<install name="lib/Horde/Help.php" as="Horde/Help.php" />
<install name="lib/Horde/Menu.php" as="Horde/Menu.php" />
<install name="lib/Horde/Registry.php" as="Horde/Registry.php" />
--- /dev/null
+<?php
+/**
+ * Horde base exception class, which includes the ability to take the
+ * output of error_get_last() as $code and mask itself as that error.
+ *
+ * Copyright 2008-2009 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 extends Exception
+{
+ /**
+ * Exception constructor
+ *
+ * If $code_or_lasterror is passed the return value of
+ * error_get_last() (or a matching format), the exception will be
+ * rewritten to have its file and line parameters match that of
+ * the array, and any message in the array will be appended to
+ * $message.
+ *
+ * @param mixed $message The exception message, a PEAR_Error
+ * object, or an Exception object.
+ * @param mixed $code_or_lasterror Either a numeric error code, or
+ * an array from error_get_last().
+ */
+ public function __construct($message = null, $code_or_lasterror = null)
+ {
+ if (is_object($message) &&
+ method_exists($message, 'getMessage')) {
+ if (is_null($code_or_lasterror) &&
+ method_exists($message, 'getCode')) {
+ $code_or_lasterror = $message->getCode();
+ }
+ $message = $message->getMessage();
+ }
+
+ if (is_null($code_or_lasterror)) {
+ $code_or_lasterror = 0;
+ }
+
+ if (is_array($code_or_lasterror)) {
+ if ($message) {
+ $message .= $code_or_lasterror['message'];
+ } else {
+ $message = $code_or_lasterror['message'];
+ }
+
+ $this->file = $code_or_lasterror['file'];
+ $this->line = $code_or_lasterror['line'];
+ $code = $code_or_lasterror['type'];
+ } else {
+ $code = $code_or_lasterror;
+ }
+
+ if (is_string($code)) {
+ $code = null;
+ }
+
+ parent::__construct($message, $code);
+ }
+
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
+http://pear.php.net/dtd/tasks-1.0.xsd
+http://pear.php.net/dtd/package-2.0
+http://pear.php.net/dtd/package-2.0.xsd">
+ <name>Exception</name>
+ <channel>pear.horde.org</channel>
+ <summary>Horde Exception Handler</summary>
+ <description>This class provides the default exception handler for the Horde Application Framework.
+ </description>
+ <lead>
+ <name>Chuck Hagenbuch</name>
+ <user>chuck</user>
+ <email>chuck@horde.org</email>
+ <active>yes</active>
+ </lead>
+ <lead>
+ <name>Jan Schneider</name>
+ <user>jan</user>
+ <email>jan@horde.org</email>
+ <active>yes</active>
+ </lead>
+ <developer>
+ <name>Michael Slusarz</name>
+ <user>slusarz</user>
+ <email>slusarz@horde.org</email>
+ <active>yes</active>
+ </developer>
+ <date>2009-07-12</date>
+ <version>
+ <release>0.1.0</release>
+ <api>0.1.0</api>
+ </version>
+ <stability>
+ <release>beta</release>
+ <api>beta</api>
+ </stability>
+ <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
+ <notes>* Initial package.
+ </notes>
+ <contents>
+ <dir name="/">
+ <dir name="lib">
+ <dir name="Horde">
+ <file name="Exception.php" role="php" />
+ </dir> <!-- /lib/Horde -->
+ </dir> <!-- /lib -->
+ </dir> <!-- / -->
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.2.0</min>
+ </php>
+ <pearinstaller>
+ <min>1.5.4</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <phprelease>
+ <filelist>
+ <install name="lib/Horde/Exception.php" as="Horde/Exception.php" />
+ </filelist>
+ </phprelease>
+ <changelog/>
+</package>