[packages/php-google-api] avoid registering autoload under composer

glen glen at pld-linux.org
Fri Jan 23 10:00:40 CET 2015


commit ac1caa17572997f5845c6b9cc5beb25a0a932e47
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Jan 23 11:00:20 2015 +0200

    avoid registering autoload under composer
    
    https://github.com/google/google-api-php-client/issues/440#issuecomment-71164196

 autoload.patch | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/autoload.patch b/autoload.patch
index d978079..5864a68 100644
--- a/autoload.patch
+++ b/autoload.patch
@@ -1,12 +1,16 @@
 --- google-api-php-client-1.1.2/autoload.php	2015-01-23 00:06:59.492462347 +0200
-+++ google-api-php-client-1.1.2/autoload.php	2015-01-23 00:06:59.492462347 +0200
-@@ -24,7 +24,8 @@
-     // Maximum class file path depth in this project is 3.
-     $classPath = array_slice($classPath, 0, 3);
-   }
++++ google-api-php-client-1.1.2/autoload.php	2015-01-23 10:59:15.270389353 +0200
+@@ -27,7 +27,11 @@
 -  $filePath = dirname(__FILE__) . '/src/' . implode('/', $classPath) . '.php';
 +  array_shift($classPath);
 +  $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php';
    if (file_exists($filePath)) {
      require_once($filePath);
    }
+ }
+ 
+-spl_autoload_register('google_api_php_client_autoload');
++// avoid registering twice under composer
++if (!class_exists('Composer\Autoload\ClassLoader', false)) {
++	spl_autoload_register('google_api_php_client_autoload');
++}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-google-api.git/commitdiff/ac1caa17572997f5845c6b9cc5beb25a0a932e47



More information about the pld-cvs-commit mailing list