diff --git a/module/VuFind/src/VuFind/Exception/Auth.php b/module/VuFind/src/VuFind/Exception/Auth.php new file mode 100644 index 0000000000000000000000000000000000000000..aea31d38b56c5a7171a0907f739502d9165959e3 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/Auth.php @@ -0,0 +1,41 @@ +<?php +/** + * Authentication Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * Authentication Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class Auth extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/Date.php b/module/VuFind/src/VuFind/Exception/Date.php new file mode 100644 index 0000000000000000000000000000000000000000..acbb01a97cb7614db89d767e51a274bd3e300c2a --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/Date.php @@ -0,0 +1,41 @@ +<?php +/** + * Date Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * Date Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class Date extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/FileAccess.php b/module/VuFind/src/VuFind/Exception/FileAccess.php new file mode 100644 index 0000000000000000000000000000000000000000..fa96a6c6c1c32d4b22c6f7fc3b9ee7ca623c84b1 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/FileAccess.php @@ -0,0 +1,41 @@ +<?php +/** + * File Access Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * File Access Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class FileAccess extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/Forbidden.php b/module/VuFind/src/VuFind/Exception/Forbidden.php new file mode 100644 index 0000000000000000000000000000000000000000..ba218cea3baa0d0c6f5ef39f1b0fd1267276b0d3 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/Forbidden.php @@ -0,0 +1,41 @@ +<?php +/** + * "Forbidden Access" Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * "Forbidden Access" Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class Forbidden extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/ILS.php b/module/VuFind/src/VuFind/Exception/ILS.php new file mode 100644 index 0000000000000000000000000000000000000000..636cba14430509cb672fa66a86f380c4f1302ee7 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/ILS.php @@ -0,0 +1,41 @@ +<?php +/** + * ILS Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * ILS Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class ILS extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/ListPermission.php b/module/VuFind/src/VuFind/Exception/ListPermission.php new file mode 100644 index 0000000000000000000000000000000000000000..a97ec8647de4178e9847907213b2033bfce11d67 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/ListPermission.php @@ -0,0 +1,41 @@ +<?php +/** + * List Permission Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * List Permission Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class ListPermission extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/LoginRequired.php b/module/VuFind/src/VuFind/Exception/LoginRequired.php new file mode 100644 index 0000000000000000000000000000000000000000..d8540a5cd0bd4ac2debd10ba9dc780bea6036f4c --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/LoginRequired.php @@ -0,0 +1,41 @@ +<?php +/** + * Login Required Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * Login Required Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class LoginRequired extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/Mail.php b/module/VuFind/src/VuFind/Exception/Mail.php new file mode 100644 index 0000000000000000000000000000000000000000..2c9f02abd3fe4c8acd02088c154dde8bca037883 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/Mail.php @@ -0,0 +1,41 @@ +<?php +/** + * Mail Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * Mail Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class Mail extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/MissingField.php b/module/VuFind/src/VuFind/Exception/MissingField.php new file mode 100644 index 0000000000000000000000000000000000000000..21b54be5cd1bbabb7d6a4aa682dcca57630ed2e4 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/MissingField.php @@ -0,0 +1,41 @@ +<?php +/** + * Missing Field Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * Missing Field Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class MissingField extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/RecordMissing.php b/module/VuFind/src/VuFind/Exception/RecordMissing.php new file mode 100644 index 0000000000000000000000000000000000000000..fdb3571792be32c4c318d970cb05943a8662e804 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/RecordMissing.php @@ -0,0 +1,41 @@ +<?php +/** + * Record Missing Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * Record Missing Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class RecordMissing extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/SessionExpired.php b/module/VuFind/src/VuFind/Exception/SessionExpired.php new file mode 100644 index 0000000000000000000000000000000000000000..92180190d0b0ee17b0500f7469a0fb43c02a914c --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/SessionExpired.php @@ -0,0 +1,41 @@ +<?php +/** + * Session Expired Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +namespace VuFind\Exception; + +/** + * Session Expired Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/system_classes#index_interface Wiki + */ +class SessionExpired extends \Exception +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Exception/Solr.php b/module/VuFind/src/VuFind/Exception/Solr.php new file mode 100644 index 0000000000000000000000000000000000000000..a82293cf82464a2452a5a556326605e9e88ed113 --- /dev/null +++ b/module/VuFind/src/VuFind/Exception/Solr.php @@ -0,0 +1,72 @@ +<?php +/** + * Solr Exception + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.vufind.org Main Page + */ +namespace VuFind\Exception; + +/** + * Solr Exception + * + * @category VuFind2 + * @package Exceptions + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.vufind.org Main Page + */ +class Solr extends \Exception +{ + /** + * Is this exception caused by a Solr parse error? + * + * @return bool + */ + public function isParseError() + { + $error = $this->getMessage(); + if (stristr($error, 'org.apache.lucene.queryParser.ParseException') + || stristr($error, 'undefined field') + ) { + return true; + } + return false; + } + + /** + * Is this exception caused by a missing browse index? + * + * @return bool + */ + public function isMissingBrowseIndex() + { + $error = $this->getMessage(); + if (strstr($error, 'does not exist') || strstr($error, 'no such table') + || strstr($error, 'couldn\'t find a browse index') + ) { + return true; + } + return false; + } +} \ No newline at end of file