array_merge() [function.array-merge]: Argument #1 kein array

Ich versuche, mit Google-API-PHP-Client und seine Basis-Klasse wirft folgenden Fehler:

Severity: Warning

Message: array_merge() [function.array-merge]: Argument #1 is not an array

Filename: libraries/Google_Client.php

Line Number: 107

Code herum wie 107 ist so etwas wie:

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']();
  }

Ich verstehe, dass global $apiConfig ist nicht initialisiert array, das ist der Grund, warum array_merge wirft Fehler. Aber wenn ich es ändern zu global $apiConfig = array();, habe einen anderen Fehler Parse error: syntax error, unexpected '=', expecting ',' or ';' in C:\Softwares\xampp\htdocs\testsaav\application\libraries\Google_Client.php on line 106

Ich bin mit Codeigniter 2.3 mit XAMPP hat PHP 5.3

Schreibe einen Kommentar