[commits] Horde branch master updated. 0895825aae49e3e41dd4eb5cfa254749c1668096

Chuck Hagenbuch chuck at horde.org
Wed Sep 30 04:15:56 UTC 2009


The branch "master" has been updated.
The following is a summary of the commits.

from: c224d3293b97bc149b381d3e0d9b28fee9f9b640

7fea7de... Add support for http method overriding to the HTTP client. possibly should go in a subclass or decorator instead.
3bb1906... Refactor Horde_Feed to remove the static HTTP client, and to inject it instead. Also use the method override support in the HTTP client instead of hardcoding it at the feed level.
0895825... refactor Horde_Feed tests for recent changes

-----------------------------------------------------------------------

commit 7fea7de25f11a170af32ededf9d2ff0d27ac2b32
Author: Chuck Hagenbuch <chuck at horde.org>
Date:   Wed Sep 30 00:12:48 2009 -0400

    Add support for http method overriding to the HTTP client. possibly should go in
    a subclass or decorator instead.
    
         /**
    +     * Use POST instead of PUT and DELETE, sending X-HTTP-Method-Override with
    +     * the intended method name instead.
    +     *
    +     * @var boolean
    +     */
    +    protected $_httpMethodOverride = false;
    +
    +    /**
          * Horde_Http_Client constructor.
          *
          * @param array $args Any Http_Client settings to initialize in the
          * constructor. Available settings are:
    +     *     client.httpMethodOverride
          *     client.proxyServer
          *     client.proxyUser
          *     client.proxyPass
    @@ -62,7 +71,12 @@ class Horde_Http_Client
    
             foreach ($args as $key => $val) {
                 list($object, $objectkey) = explode('.', $key, 2);
    -            $this->$object->$objectkey = $val;
    +            if ($object == 'request') {
    +                $this->$object->$objectkey = $val;
    +            } elseif ($object == 'client') {
    +                $objectKey = '_' . $objectKey;
    +                $this->$objectKey = $val;
    +            }
             }
         }
    
    @@ -93,7 +107,11 @@ class Horde_Http_Client
          */
         public function put($uri = null, $data = null, $headers = array())
         {
    -        /* @TODO suport method override (X-Method-Override: PUT). */
    +        if ($this->_httpMethodOverride) {
    +            $headers = array_merge(array('X-HTTP-Method-Override' => 'PUT'), $headers);
    +            return $this->post($uri, $data, $headers);
    +        }
    +
             return $this->request('PUT', $uri, $data, $headers);
         }
    
    @@ -104,7 +122,11 @@ class Horde_Http_Client
          */
         public function delete($uri = null, $headers = array())
         {
    -        /* @TODO suport method override (X-Method-Override: DELETE). */
    +        if ($this->_httpMethodOverride) {
    +            $headers = array_merge(array('X-HTTP-Method-Override' => 'DELETE'), $headers);
    +            return $this->post($uri, null, $headers);
    +        }
    +
             return $this->request('DELETE', $uri, null, $headers);
         }

 framework/Http/lib/Horde/Http/Client.php |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

http://git.horde.org/diff.php/framework/Http/lib/Horde/Http/Client.php?rt=horde-git&r1=eb4896b905a309ba7d495de3a1f82d48100796a3&r2=7fea7de25f11a170af32ededf9d2ff0d27ac2b32

-----------------------------------------------------------------------

commit 3bb1906c42bb63f7c8b35b0c402c2b350e4e02d6
Author: Chuck Hagenbuch <chuck at horde.org>
Date:   Wed Sep 30 00:14:38 2009 -0400

    Refactor Horde_Feed to remove the static HTTP client, and to inject it
    instead. Also use the method override support in the HTTP client instead of
    hardcoding it at the feed level.

 framework/Feed/lib/Horde/Feed.php            |   78 +++-----------------------
 framework/Feed/lib/Horde/Feed/Atom.php       |    1 -
 framework/Feed/lib/Horde/Feed/Base.php       |   24 ++++++++-
 framework/Feed/lib/Horde/Feed/Entry/Atom.php |   32 +++--------
 framework/Feed/lib/Horde/Feed/Entry/Base.php |   13 ++++-
 5 files changed, 50 insertions(+), 98 deletions(-)

http://git.horde.org/diff.php/framework/Feed/lib/Horde/Feed.php?rt=horde-git&r1=67d66158c228dd6ba6691092332bacf9c6a8fd57&r2=3bb1906c42bb63f7c8b35b0c402c2b350e4e02d6
http://git.horde.org/diff.php/framework/Feed/lib/Horde/Feed/Atom.php?rt=horde-git&r1=67d66158c228dd6ba6691092332bacf9c6a8fd57&r2=3bb1906c42bb63f7c8b35b0c402c2b350e4e02d6
http://git.horde.org/diff.php/framework/Feed/lib/Horde/Feed/Base.php?rt=horde-git&r1=67d66158c228dd6ba6691092332bacf9c6a8fd57&r2=3bb1906c42bb63f7c8b35b0c402c2b350e4e02d6
http://git.horde.org/diff.php/framework/Feed/lib/Horde/Feed/Entry/Atom.php?rt=horde-git&r1=67d66158c228dd6ba6691092332bacf9c6a8fd57&r2=3bb1906c42bb63f7c8b35b0c402c2b350e4e02d6
http://git.horde.org/diff.php/framework/Feed/lib/Horde/Feed/Entry/Base.php?rt=horde-git&r1=67d66158c228dd6ba6691092332bacf9c6a8fd57&r2=3bb1906c42bb63f7c8b35b0c402c2b350e4e02d6

-----------------------------------------------------------------------

commit 0895825aae49e3e41dd4eb5cfa254749c1668096
Author: Chuck Hagenbuch <chuck at horde.org>
Date:   Wed Sep 30 00:15:39 2009 -0400

    refactor Horde_Feed tests for recent changes

 framework/Feed/test/Horde/Feed/AllTests.php           |   10 +++-
 framework/Feed/test/Horde/Feed/AtomPublishingTest.php |   43 +++++++---------
 2 files changed, 26 insertions(+), 27 deletions(-)

http://git.horde.org/diff.php/framework/Feed/test/Horde/Feed/AllTests.php?rt=horde-git&r1=f0aa090bb7a1c56202f038af0ad2e7a56cb41637&r2=0895825aae49e3e41dd4eb5cfa254749c1668096
http://git.horde.org/diff.php/framework/Feed/test/Horde/Feed/AtomPublishingTest.php?rt=horde-git&r1=f0aa090bb7a1c56202f038af0ad2e7a56cb41637&r2=0895825aae49e3e41dd4eb5cfa254749c1668096




More information about the commits mailing list