【发布时间】:2011-10-02 19:29:31
【问题描述】:
我对 php 完全陌生。我正在尝试构建一个系统来将视频上传到 youtube 并保留他们的 URL。另一个 Flash 应用程序稍后将它们组合在一起。我正在清除目标,以便我可以确信图书馆可以执行这些任务。
1) 在默认频道上上传 2) 获取视频地址 3) 下载视频供离线观看
我通过谷歌搜索找到了与 php 一起使用的 zend 库。但是面临很多问题。我正在使用 WAMP。我将zend库文件夹复制到“C:\wamp\www\zend”并在此处更改了php.ini
;窗口:“\path1;\path2” include_path = ".;C:\wamp\www\zend\library;c:\php\includes"
感觉没有变化。所以我想用这段代码测试这个库。
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_include_path('C:/wamp/library/zend/library' . PATH_SEPARATOR . get_include_path());
require_once 'zend/library/Zend/Gdata/YouTube.php';
require_once 'zend/library/Zend/Gdata/ClientLogin.php';
require_once 'zend/library/Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$authenticationURL= 'https://www.google.com/youtube/accounts/ClientLogin';
$httpClient =
Zend_Gdata_ClientLogin::getHttpClient(
$username = 'shabab.h.siddique@gmail.com',
$password = '***',
$service = 'youtube',
$client = null,
$source = 'testphp',
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
$developerKey = 'AI3....w';
$applicationId = 'Student Collaborative Video System';
$clientId = 'Student Collaborative Video System';
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
$yt->setMajorProtocolVersion(2);
$videoFeed = $yt->getVideoFeed(Zend_Gdata_YouTube::VIDEO_URI);
printVideoFeed($videoFeed);
var_dump($videoFeed);
?>
我目前看到的错误是
1 0.0023 375392 {main}( ) ..\testphp.php:0
2 0.0086 560192 require_once('C:\wamp\www\zend\library\Zend\Gdata\YouTube.php') ..\testphp.php:7
【问题讨论】:
-
在
<?php标签后添加error_reporting(E_ALL); ini_set('display_errors', 1);,可能是你有错误但它被抑制了。另外,在您的 set_include_path 调用中,我认为\zend\library需要是C:/wamp/www/zend/library -
编辑后的代码在上面的帖子中给出。错误是 Call Stack # Time Memory Function Location 1 0.0011 374264 {main}( ) ..\testphp.php:0 2 0.0045 559056 require_once( 'C:\wamp\www\zend\library\Zend\Gdata\YouTube.php ' ) ..\testphp.php:7
标签: php zend-framework youtube