include_once errors with youtube api / Zend Gdata
I'm using Zend Framework ver 1.11.10, specifically the GDATA/YouTube functions.
My log is getting blasted with
include_once(Zend\Gdata\Media\Extension\VideoQuery.php) failed to open stream: No such file or directory C:\Zend\ZendServer\share\ZendFramework\library\Zend\Loader.php 148
include_once(): Failed opening "Zend\Gdata\Media\Extension\VideoQuery.php" for inclusion (include_path=".;C:\Zend\ZendServer\share\ZendFramework\library") C:\Zend\ZendServer\share\ZendFramework\library\Zend\Loader.php 148
include_once(Zend\Gdata\Media\VideoQuery.php) failed to open stream: No such file or directory C:\Zend\ZendServer\share\ZendFramework\library\Zend\Loader.php 148
include_once() Failed opening "Zend\Gdata\Media\VideoQuery.php" for inclusion (include_path=".;C:\Zend\ZendServer\share\ZendFramework\library") C:\Zend\ZendServer\share\ZendFramework\library\Zend\Loader.php 148
include_once(Zend\Gdata\YouTube\Extension\VideoQuery.php) failed to open stream: No such file or directory C:\Zend\ZendServer\share\ZendFramework\library\Zend\Loader.php 148
include_once() Failed opening "Zend\Gdata\YouTube\Extension\VideoQuery.php" for inclusion (include_path=".;C:\Zend\ZendServer\share\ZendFramework\library") C:\Zend\ZendServer\share\ZendFramework\library\Zend\Loader.php 148
Stepping through the code, I get to gdata\app.php in line 1046 where its looping through all the _registeredpackages
, the first 3 being the ones listed above until it gets to the right class Zend_Gdata_YouTube.
So my question is how can I get the above messaged to not log? Seems there would be a fail-safe to verify the file exists before it tries to include it.
Note: I went back and reviewed my logs and these errors haven't always been there, even when using the Zend framework. I'm wondering 开发者_运维问答if I caused this to happen somehow.
I've solved it by calling registerPackage('Zend_Gdata_YouTube');
on Zend_Gdata_YouTube
instance.
$yt = new Zend_Gdata_YouTube();
$yt->registerPackage('Zend_Gdata_YouTube');
This simply unshift
the correct package to _registeredpackages
.
Now the following code doesn't produce errors by Zend_Loader
:
$yt->newVideoQuery();
精彩评论