I am trying to use Google-API-PHP-Client and its base class is throwing following error:
Severity: Warning
Message: array_merge() [function.array-merge]: Argument #1 is not an array
Filename: libraries/Google_Client.php
Line Number: 107
Code around like 107 is something like:
public function __construct($config = array()) {
global $apiConfig;
$apiConfig = array_merge($apiConfig, $config);
self::$cache = new $apiConfig['cacheClass']();
self::$auth = new $apiConfig['authClass']();
self::$io = new $apiConfig['ioClass']();
}
I understand that global $apiConfig
is not initialized as array that's why array_merge is throwing error. But when I change it to global $apiConfig = array();
, got another error Parse error: syntax error, unexpected '=', expecting ',' or ';' in C:\Softwares\xampp\htdocs\testsaav\application\libraries\Google_Client.php on line 106
I am using Codeigniter 2.3 with XAMPP which has PHP 5.3