3 require_once 'xrds_mapper.php';
4 require_once 'constants.php';
7 * Map XRDS actions to URLs using base URLs.
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.
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.
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.
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/>.
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
34 class OMB_Base_URL_XRDS_Mapper implements OMB_XRDS_Mapper {
38 public function __construct($oauth_base, $omb_base) {
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');
47 public function getURL($action) {
48 return $this->urls[$action];