admin管理员组文章数量:1415145
I'm trying to include the Zend Gdata module into a plugin, but this error appears on plugin activation:
include_once(Zend\Gdata\YouTube.php) [function.include-once]: failed to open stream: No such file or directory in \Zend\Loader.php on line 146
any help appreciated, thanks
I have the main plugin file in the root and then a Zend subfolder which contains the module. This was just copied from the demo app which works fine on the same XAMPP installation, so it's something to do with how WordPress includes files?
/**
* @see Zend_Loader
*/
require_once 'Zend/Loader.php';
/**
* @see Zend_Gdata_YouTube
*/
Zend_Loader::loadClass('Zend_Gdata_YouTube');
I'm trying to include the Zend Gdata module into a plugin, but this error appears on plugin activation:
include_once(Zend\Gdata\YouTube.php) [function.include-once]: failed to open stream: No such file or directory in \Zend\Loader.php on line 146
any help appreciated, thanks
I have the main plugin file in the root and then a Zend subfolder which contains the module. This was just copied from the demo app which works fine on the same XAMPP installation, so it's something to do with how WordPress includes files?
/**
* @see Zend_Loader
*/
require_once 'Zend/Loader.php';
/**
* @see Zend_Gdata_YouTube
*/
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Share
Improve this question
edited Jan 8, 2012 at 19:16
paul
asked Jan 8, 2012 at 16:45
paulpaul
3281 silver badge10 bronze badges
1
- 1 Needs more info. So far it simply looks like you used the wrong path. – kaiser Commented Jan 8, 2012 at 16:52
1 Answer
Reset to default 1* UPDATE * Please see at the bottom for right solution!!!
One way to solve this problem is that you use ini_set to set the path to your Zend folder.
I have the Zend folder in my current theme folder so i only need to tell path var what the path to my theme folder is. This code goes to functions.php if its in the theme you want to use it of course :)
ini_set ( 'include_path', ini_get ( 'include_path' ) . ':../:' . dirname ( __FILE__ ) . ':' );
require_once 'Zend/Loader.php';
Zend_Loader::loadClass ( 'Zend_Gdata_YouTube' );
Zend_Loader::loadClass ( 'Zend_Gdata_AuthSub' );
Zend_Loader::loadClass ( 'Zend_Gdata_ClientLogin' );
I will also share a screenshot just in case the structure is confusing anyone: As you see i have lifted Zend folder out from the ZendGdata-1.11.11 folder
Hope this helps :)
Edit:
Apparently i messed up a bit, the Zend folder im my case is actually in the ROOT. That mean if i enter www.mysite/Zend i should be able to access php files there. So, simplifying that all, Zend/ folder should not be in:
www.mysite/wp-content/themes/theme-name/Zend
But it should be in
www.mysite/Zend
本文标签: includeincluding Zend Gdata library path error
版权声明:本文标题:include - including Zend Gdata library path error 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745217080a2648222.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论