Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

#860574 by fago, Hugo Wetterberg, klausi, voxpelli: Port to Drupal 7

by fago: Change to use drupal_json_encode(), breaking change
  • Loading branch information...
commit 1ce6b4761db805a69aa46e0f8de6fc30dae438fa 1 parent 3684444
authored November 19, 2010
4  CHANGELOG
... ...
@@ -1,7 +1,9 @@
1 1
 // $Id$
2 2
 
3  
-Http Client 6.x-2.2, XXXX-XX-XX
  3
+Http Client 7.x-2.2, XXXX-XX-XX
4 4
 ------------------------------
  5
+by fago, Hugo Wetterberg, klausi, voxpelli: Port to Drupal 7
  6
+by fago: Change to use drupal_json_encode(), breaking change
5 7
 by klausi: Coding style fixes
6 8
 
7 9
 Http Client 6.x-2.1, 2010-09-25
6  README
@@ -4,10 +4,6 @@ Comes with support for authenticating with OAuth.module version 3.x for easy to
4 4
 
5 5
 Http Client has extensible support for different request and response body formats. That lets you send PHP data structures and have them serialized and deserialized automatically. JSON and serialized PHP is supported out of the box. This makes it a good companion to REST servers and very well suited for use with the version 2+ of the REST Server.
6 6
 
7  
-Required modules
8  
-
9  
-* Autoload
10  
-
11 7
 Optional modules
12 8
 
13  
-* OAuth 3.x
  9
+* OAuth 3.x (Not ported to Drupal 7 yet)
9  http_client.info
... ...
@@ -1,8 +1,11 @@
1 1
 ; $Id$
2 2
 name = Http Client
3 3
 description = Provides a Http client for use with the services Http server
4  
-dependencies[] = autoload
  4
+
  5
+files[] = http_client.module
  6
+files[] = includes/HttpClient.inc
  7
+files[] = includes/HttpClientXMLFormatter.inc
  8
+files[] = includes/HttpClientCurlDelegate.inc
5 9
 
6 10
 package = Services - clients
7  
-core = 6.x
8  
-php = 5.x
  11
+core = 7.x
23  http_client.module
... ...
@@ -1,20 +1,6 @@
1 1
 <?php
2 2
 
3 3
 /**
4  
- * Implementation hook_autoload_info().
5  
- */
6  
-function http_client_autoload_info() {
7  
-  return array(
8  
-    'HttpClient'                => array('file' => 'includes/HttpClient.inc'),
9  
-    'HttpClientAuthentication'  => array('file' => 'includes/HttpClient.inc'),
10  
-    'HttpClientRequest'         => array('file' => 'includes/HttpClient.inc'),
11  
-    'HttpClientBaseFormatter'   => array('file' => 'includes/HttpClient.inc'),
12  
-    'HttpClientCurlDelegate'     => array('file' => 'includes/HttpClientCurlDelegate.inc'),
13  
-    'HttpClientXMLFormatter'    => array('file' => 'includes/HttpClientXMLFormatter.inc'),
14  
-  );
15  
-}
16  
-
17  
-/**
18 4
  * Factory method for the HttpClient. Use this if you don't want to select a
19 5
  * Http client delegate yourself.
20 6
  *
@@ -43,7 +29,7 @@ function http_client($authentication = NULL, $formatter = NULL, $request_alter =
43 29
 }
44 30
 
45 31
 /**
46  
- * Implementation of hook_http_client_delegates().
  32
+ * Implements hook_http_client_delegates().
47 33
  */
48 34
 function http_client_http_client_delegates() {
49 35
   $delegates = array();
@@ -52,10 +38,3 @@ function http_client_http_client_delegates() {
52 38
   }
53 39
   return $delegates;
54 40
 }
55  
-
56  
-/**
57  
- * Implementation of hook_enable().
58  
- */
59  
-function http_client_enable() {
60  
-  autoload_flush_caches();
61  
-}
4  includes/HttpClient.inc
@@ -319,7 +319,7 @@ class HttpClientBaseFormatter implements HttpClientFormatter {
319 319
         return serialize($data);
320 320
         break;
321 321
       case self::FORMAT_JSON:
322  
-        return json_encode($data);
  322
+        return drupal_json_encode($data);
323 323
         break;
324 324
       case self::FORMAT_FORM:
325 325
         return http_build_query($data, NULL, '&');
@@ -346,7 +346,7 @@ class HttpClientBaseFormatter implements HttpClientFormatter {
346 346
         }
347 347
         break;
348 348
       case self::FORMAT_JSON:
349  
-        $response = json_decode($data);
  349
+        $response = drupal_json_decode($data);
350 350
         if ($response === NULL) {
351 351
           throw new Exception(t('Unserialization of response body failed.'), 1);
352 352
         }

0 notes on commit 1ce6b47

Please sign in to comment.
Something went wrong with that request. Please try again.