2011-10-31 73 views
0

我想上傳一個簡單的CSV文件到谷歌文檔使用zend gdata庫,但不知何故卡住了。使用Zend上傳文件gdata

我看了用於上傳的所有文件,並找到一處被卡住:

在線:Zend公司/ GDATA/Docs.php 229後:$ FS = $這個 - > newMediaFileSource($ fileLocation) ;

即使我查看了每一個文件,我仍找不到那個newMediaFileSource()函數。任何人都有一個想法,我該如何解決這個問題?

public function uploadFile($fileLocation, $title=NULL, $mimeType=NULL, $uri=NULL) 
    { 
     // Set the URI to which the file will be uploaded. 
     if ($uri === NULL) { 
      $uri = $this->_defaultPostUri; 
     } 
     // Right after this line it stops executing: 
     $fs = $this->newMediaFileSource($fileLocation); 
     if ($title !== NULL) { 
      $slugHeader = $title; 
     } else { 
      $slugHeader = $fileLocation; 
     } 

回答

2

我有類似的問題給你。我找不到函數或者,所以我懷疑它使用一個神奇的PHP調用,而Zend_Gdata_App圓線1041果然:

public function __call($method, $args) 
{ 
    if (preg_match('/^new(\w+)/', $method, $matches)) { 
     $class = $matches[1]; 
     $foundClassName = null; 
     foreach ($this->_registeredPackages as $name) { 
      try { 
       // Autoloading disabled on next line for compatibility 
       // with magic factories. See ZF-6660. 
       if (!class_exists($name . '_' . $class, false)) { 
        require_once 'Zend/Loader.php'; 
        @Zend_Loader::loadClass($name . '_' . $class); 
       } 
       $foundClassName = $name . '_' . $class; 
       break; 
      } catch (Zend_Exception $e) { 
       // package wasn't here- continue searching 
      } 
     } 

    .... 
} 

它的基本分析方法的名稱,以檢查是否有任何軟件包後的「新」

其基本上創建類型的對象Zend_Gdata_App_MediaFileSource