autostatus

Sign in or create your account | Project List | Help | pwet.fr | Planet eZ Publish.fr | Bioutifoul Photos

autostatus Svn Source Tree

Root/tags/autostatus_0.1/extension/autostatus/classes/autostatusidenticaclient.php

  • Property svn:keywords set to: Id HeadURL
Source at commit HEAD created 3 days 21 hours ago.
By nfrp, --That is what it takes to rely on one's memory for a not-often-used function. http://www.php.net/strpos says : int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) :)
1<?php
2/**
3 * $Id: autostatusidenticaclient.php 10 2009-10-30 21:51:41Z dpobel $
4 * $HeadURL: http://svn.projects.ez.no/autostatus/tags/autostatus_0.1/extension/autostatus/classes/autostatusidenticaclient.php $
5 *
6 * SOFTWARE NAME: autostatus
7 * SOFTWARE RELEASE: 0.1
8 * COPYRIGHT NOTICE: Copyright (C) 2009 Damien POBEL
9 * SOFTWARE LICENSE: GNU General Public License v2.0
10 * NOTICE: >
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of version 2.0 of the GNU General
13 * Public License as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of version 2.0 of the GNU General
21 * Public License along with this program; if not, write to the Free
22 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 * MA 02110-1301, USA.
24 */
25
26/**
27 * Clients class for Identi.ca social network.
28 *
29 * @uses autostatusTwitterClient
30 * @author Damien Pobel
31 */
32class autostatusIdenticaClient extends autostatusTwitterClient
33{
34
35    public function __construct( $username, $password = null )
36    {
37        parent::__construct( $username, $password );
38        $this->setUri('http://identi.ca/api');
39    }
40
41
42    /**
43     * Overload of the Zend_Service_Twitter method
44     * in order to not overwrite the path of the server
45     *
46     * @param string $path
47     * @access protected
48     * @return void
49     */
50    protected function _prepare( $path )
51    {
52        // Get the URI object and configure it
53        if ( !$this->_uri instanceof Zend_Uri_Http )
54        {
55            throw new Zend_Rest_Client_Exception( 'URI object must be set before performing call' );
56        }
57
58        $uri = $this->_uri->getUri();
59
60        if ( $path[0] != '/' && $uri[strlen( $uri )-1] != '/' )
61        {
62            $path = '/' . $path;
63        }
64        $this->_uri->setPath( $this->_uri->getPath() . $path );
65
66        /**
67         * Get the HTTP client and configure it for the endpoint URI. Do this each time
68         * because the Zend_Http_Client instance is shared among all Zend_Service_Abstract subclasses.
69         */
70        $this->_localHttpClient->resetParameters()->setUri( $this->_uri );
71    }
72
73}
74
75?>
76

Archive Download this file

Revision: HEAD