2011-10-31 110 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