@@ -37,6 +37,7 @@ class Google_Client
3737{
3838 const LIBVER = "1.0.1-alpha " ;
3939 const USER_AGENT_SUFFIX = "google-api-php-client/ " ;
40+ const GZIP_UA = " (gzip) " ;
4041 /**
4142 * @var Google_Auth_Abstract $auth
4243 */
@@ -107,16 +108,6 @@ public function getLibraryVersion()
107108 {
108109 return self ::LIBVER ;
109110 }
110-
111- /**
112- * Shim function until templates are updated.
113- * @todo(ianbarber): remove this.
114- * @deprecated
115- */
116- public function addService ($ a , $ b , $ c )
117- {
118- return ;
119- }
120111
121112 /**
122113 * Attempt to exchange a code for an valid authentication token.
@@ -483,10 +474,16 @@ public function setDefer($defer)
483474 public function execute ($ request )
484475 {
485476 if ($ request instanceof Google_Http_Request) {
477+ $ userAgentGzipSuffix = "" ;
478+ if (!$ this ->getClassConfig ("Google_Http_Request " , "disable_gzip " )) {
479+ $ request ->setRequestHeaders (array ("Accept-Encoding " => "gzip " ));
480+ $ userAgentGzipSuffix = self ::GZIP_UA ;
481+ }
486482 $ request ->setUserAgent (
487483 $ this ->getApplicationName ()
488484 . " " . self ::USER_AGENT_SUFFIX
489485 . $ this ->getLibraryVersion ()
486+ . $ userAgentGzipSuffix
490487 );
491488 $ request ->maybeMoveParametersToBody ();
492489 return Google_Http_REST::execute ($ this , $ request );
0 commit comments