]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - extlib/libomb/base_url_xrds_mapper.php
Merge branch '0.8.x' into 0.9.x
[quix0rs-gnu-social.git] / extlib / libomb / base_url_xrds_mapper.php
1 <?php
2
3 require_once 'xrds_mapper.php';
4 require_once 'constants.php';
5
6 /**
7  * Map XRDS actions to URLs using base URLs.
8  *
9  * This interface specifies classes which write the XRDS file announcing
10  * the OMB server. An instance of an implementing class should be passed to
11  * OMB_Service_Provider->writeXRDS.
12  *
13  * PHP version 5
14  *
15  * LICENSE: This program is free software: you can redistribute it and/or modify
16  * it under the terms of the GNU Affero General Public License as published by
17  * the Free Software Foundation, either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU Affero General Public License for more details.
24  *
25  * You should have received a copy of the GNU Affero General Public License
26  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
27  *
28  * @package   OMB
29  * @author    Adrian Lang <mail@adrianlang.de>
30  * @copyright 2009 Adrian Lang
31  * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL 3.0
32  **/
33
34 class OMB_Base_URL_XRDS_Mapper implements OMB_XRDS_Mapper {
35
36   protected $urls;
37
38   public function __construct($oauth_base, $omb_base) {
39     $this->urls = array(
40         OAUTH_ENDPOINT_REQUEST => $oauth_base . 'requesttoken',
41         OAUTH_ENDPOINT_AUTHORIZE => $oauth_base . 'userauthorization',
42         OAUTH_ENDPOINT_ACCESS => $oauth_base . 'accesstoken',
43         OMB_ENDPOINT_POSTNOTICE => $omb_base . 'postnotice',
44         OMB_ENDPOINT_UPDATEPROFILE => $omb_base . 'updateprofile');
45   }
46
47   public function getURL($action) {
48     return $this->urls[$action];
49   }
50 }
51 ?>