Php 使用Zend gdata上载文档
我试图使用zend gdata库将一个简单的csv文档上传到google文档,但不知怎的,它被卡住了 我查看了所有用于上传的文件,并找到了卡住的地方: 在线:Zend/Gdata/Docs.php的229,在:$fs=$this->newMediaFileSource($fileLocation)之后 我找不到newMediaFileSource()函数,尽管我已经查看了每个文件。有人知道我该如何解决这个问题吗Php 使用Zend gdata上载文档,php,zend-gdata,Php,Zend Gdata,我试图使用zend gdata库将一个简单的csv文档上传到google文档,但不知怎的,它被卡住了 我查看了所有用于上传的文件,并找到了卡住的地方: 在线:Zend/Gdata/Docs.php的229,在:$fs=$this->newMediaFileSource($fileLocation)之后 我找不到newMediaFileSource()函数,尽管我已经查看了每个文件。有人知道我该如何解决这个问题吗 public function uploadFile($fileLocation,
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;
}
我和你有类似的问题。我也找不到该函数,所以我怀疑它使用了一个神奇的php调用,在Zend_Gdata_应用程序的第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
}
}
....
}
它基本上是解析方法名来检查“new”之后是否有包
它基本上是创建Zend_Gdata_App_MediaFileSource类型的对象