]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - extlib/Net/URL/Mapper/Exception.php
ac3ad172b15eda1eb8ef84a26b5f007dfabbe89a
[quix0rs-gnu-social.git] / extlib / Net / URL / Mapper / Exception.php
1 <?php
2 /**
3  * Exception classes for Net_URL_Mapper
4  *
5  * PHP version 5
6  *
7  * LICENSE:
8  * 
9  * Copyright (c) 2006, Bertrand Mansion <golgote@mamasam.com> 
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  *
16  *    * Redistributions of source code must retain the above copyright
17  *      notice, this list of conditions and the following disclaimer.
18  *    * Redistributions in binary form must reproduce the above copyright
19  *      notice, this list of conditions and the following disclaimer in the 
20  *      documentation and/or other materials provided with the distribution.
21  *    * The names of the authors may not be used to endorse or promote products 
22  *      derived from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
25  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
32  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  * @category   Net
37  * @package    Net_URL_Mapper
38  * @author     Bertrand Mansion <golgote@mamasam.com>
39  * @license    http://opensource.org/licenses/bsd-license.php New BSD License
40  * @version    CVS: $Id: Exception.php,v 1.1 2007/03/28 10:23:04 mansion Exp $
41  * @link       http://pear.php.net/package/Net_URL_Mapper
42  */
43
44 /**
45  * Base class for exceptions in PEAR
46  */
47 require_once 'PEAR/Exception.php'; 
48
49 /**
50  * Base class for exceptions in Net_URL_Mapper package
51  *
52  * Such a base class is required by the Exception RFC:
53  * http://pear.php.net/pepr/pepr-proposal-show.php?id=132
54  * It will rarely be thrown directly, its specialized subclasses will be
55  * thrown most of the time.
56  *
57  * @category   Net
58  * @package    Net_URL_Mapper
59  * @version    Release: @package_version@
60  */
61 class Net_URL_Mapper_Exception extends PEAR_Exception
62 {
63 }
64
65 /**
66  * Exception thrown when a path is invalid
67  *
68  * A path can conform to a given structure, but contain invalid parameters.
69  * <code>
70  * $m = Net_URL_Mapper::getInstance();
71  * $m->connect('hi/:name', null, array('name'=>'[a-z]+'));
72  * $m->match('/hi/FOXY'); // Will throw the exception
73  * </code>
74  *
75  * @category   Net
76  * @package    Net_URL_Mapper
77  * @version    Release: @package_version@
78  */
79 class Net_URL_Mapper_InvalidException extends Net_URL_Mapper_Exception
80 {
81     protected $path;
82     protected $url;
83
84     public function setPath($path)
85     {
86         $this->path = $path;
87     }
88
89     public function getPath()
90     {
91         return $this->path;
92     }
93
94     public function setUrl($url)
95     {
96         $this->url = $url;
97     }
98
99     public function getUrl()
100     {
101         return $this->url;
102     }
103
104 ?>