2014-06-17 17 views
9

APPPATH.'libraries/Google/Client.php'yi kullandığımda, require_once içerisindeki tüm dosyalar, alt dosya yani (Auth/AssertionCredentials.php)google api php istemci kitaplığını codeigniter içinde yükleyemiyorum

A PHP Error was encountered 

Severity: Warning 

Message: require_once(Google/Auth/AssertionCredentials.php): failed to open stream: No such file or directory 

Filename: Google/Client.php 

Line Number: 18 
+0

Hepiniz google api dosyaları Require_once (APPPATH.'libraries baz yolunu eklemek zorunda/'. Google/Auth/AssertionCredentials.php'); satırında 18 –

+0

gibi çok uzun bir görev olurdu, çünkü ** google-api-php-client ** kütüphanesinin tüm dosyaları birbiriyle bağlantılıdır. – Rohit

+0

Sadece bulup değiştiremez misiniz? Require_once APPPATH "require_once" Google/"ile değiştirin. "kütüphaneler/Google /" – Craig

cevap

2
Sen kütüphaneler yola değiştirebilir

, google müşteri gerektirir, ardından tekrar CI varsayılan yoluna geçmek ..

// change directory to libraries path 
    chdir(APPPATH.'libraries'); 

    // include API 
    require_once('Google/Client.php'); 

    // do some stuff here with the Google API 

    // switch back to CI default path 
    chdir(FCPATH); 
15

kopyala "Google" klasörünü THIRD_PARTY için.

uygulama/kütüphanede denilen google.php

<?php 
if (!defined('BASEPATH')) exit('No direct script access allowed'); 
set_include_path(APPPATH . 'third_party/' . PATH_SEPARATOR . get_include_path()); 
require_once APPPATH . 'third_party/Google/Client.php'; 

class Google extends Google_Client { 
    function __construct($params = array()) { 
     parent::__construct(); 
    } 
} 

altında yeni bir dosya oluşturun Ardından kullanmak:

$this->load->library('google'); 
echo $this->google->getLibraryVersion(); 
+0

Ayrıca şunları eklemeliyim: require_once APPPATH. 'THIRD_PARTY/Google/Config.php'; –

+0

Bu, olmalıdır. UYGULAMA. 'THIRD_PARTY/Google/autoload.php'; –