From b729da795258e207768dd616f162890d7fc05bae Mon Sep 17 00:00:00 2001 From: zYne Date: Sat, 30 Dec 2006 11:01:49 +0000 Subject: [PATCH] Exception classes for the export drivers, also added export reporter class --- lib/Doctrine/Export/Informix/Exception.php | 34 ++++++++++++++++ lib/Doctrine/Export/Mssql/Exception.php | 34 ++++++++++++++++ lib/Doctrine/Export/Oracle/Exception.php | 34 ++++++++++++++++ lib/Doctrine/Export/Pgsql/Exception.php | 33 ++++++++++++++++ lib/Doctrine/Export/Reporter.php | 45 ++++++++++++++++++++++ lib/Doctrine/Export/Sqlite/Exception.php | 34 ++++++++++++++++ 6 files changed, 214 insertions(+) create mode 100644 lib/Doctrine/Export/Informix/Exception.php create mode 100644 lib/Doctrine/Export/Mssql/Exception.php create mode 100644 lib/Doctrine/Export/Oracle/Exception.php create mode 100644 lib/Doctrine/Export/Pgsql/Exception.php create mode 100644 lib/Doctrine/Export/Reporter.php create mode 100644 lib/Doctrine/Export/Sqlite/Exception.php diff --git a/lib/Doctrine/Export/Informix/Exception.php b/lib/Doctrine/Export/Informix/Exception.php new file mode 100644 index 000000000..44acf0cd7 --- /dev/null +++ b/lib/Doctrine/Export/Informix/Exception.php @@ -0,0 +1,34 @@ +. + */ +Doctrine::autoload('Doctrine_Export_Exception'); +/** + * Doctrine_Export_Informix_Exception + * + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Export_Informix_Exception extends Doctrine_Export_Exception +{ } diff --git a/lib/Doctrine/Export/Mssql/Exception.php b/lib/Doctrine/Export/Mssql/Exception.php new file mode 100644 index 000000000..d39911afd --- /dev/null +++ b/lib/Doctrine/Export/Mssql/Exception.php @@ -0,0 +1,34 @@ +. + */ +Doctrine::autoload('Doctrine_Export_Exception'); +/** + * Doctrine_Export_Mssql_Exception + * + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Export_Mssql_Exception extends Doctrine_Export_Exception +{ } diff --git a/lib/Doctrine/Export/Oracle/Exception.php b/lib/Doctrine/Export/Oracle/Exception.php new file mode 100644 index 000000000..715487ff8 --- /dev/null +++ b/lib/Doctrine/Export/Oracle/Exception.php @@ -0,0 +1,34 @@ +. + */ +Doctrine::autoload('Doctrine_Export_Exception'); +/** + * Doctrine_Export_Oracle_Exception + * + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Export_Oracle_Exception extends Doctrine_Export_Exception +{ } diff --git a/lib/Doctrine/Export/Pgsql/Exception.php b/lib/Doctrine/Export/Pgsql/Exception.php new file mode 100644 index 000000000..8fa31afed --- /dev/null +++ b/lib/Doctrine/Export/Pgsql/Exception.php @@ -0,0 +1,33 @@ +. + */ +Doctrine::autoload('Doctrine_Export_Exception'); +/** + * Doctrine_Export_Pgsql_Exception + * + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Export_Pgsql_Exception extends Doctrine_Export_Exception { } diff --git a/lib/Doctrine/Export/Reporter.php b/lib/Doctrine/Export/Reporter.php new file mode 100644 index 000000000..180783ed0 --- /dev/null +++ b/lib/Doctrine/Export/Reporter.php @@ -0,0 +1,45 @@ +. + */ + +/** + * Doctrine_Export_Reporter + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_Export_Reporter implements IteratorAggregate { + protected $messages = array(); + + public function add($code, $message) { + $this->messages[] = array($code, $message); + } + public function pop() { + return array_pop($this->messages); + } + public function getIterator() { + return new ArrayIterator($this->messages); + } +} diff --git a/lib/Doctrine/Export/Sqlite/Exception.php b/lib/Doctrine/Export/Sqlite/Exception.php new file mode 100644 index 000000000..64e372743 --- /dev/null +++ b/lib/Doctrine/Export/Sqlite/Exception.php @@ -0,0 +1,34 @@ +. + */ +Doctrine::autoload('Doctrine_Export_Exception'); +/** + * Doctrine_Export_Sqlite_Exception + * + * @package Doctrine + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + * @author Konsta Vesterinen + */ +class Doctrine_Export_Sqlite_Exception extends Doctrine_Export_Exception +{ }