duanjiushu5063 2012-02-16 13:03
浏览 25
已采纳

PyroCMS - 在模块中加载自定义库

I'm writing a PyroCMS module which involves image upload and thumbnail generation. I'm aware codeigniter has a built in image manipulation class that's capable of making thumbnails, but I'm a big for of phpThumb'ss adaptive resize function. For this reason I'd like to try and get phpThumb working.

I've placed the phpThumb files in ./addons/shared_addons/modules/mymodule/libraries

and I'm trying to load using the following:

$this->load->library('phpThumb/ThumbLib.inc.php');

I'm including the extension because an .inc.php file is not a .php file right? Either way if I keep the extension or not I get this error:

Class 'ThumbLib.inc.php' not found in .../htdocs/system/cms/libraries/MX/Loader.php on line 160

Anyone know what I'm doing wrong?

Thanks, Ed.

  • 写回答

2条回答 默认 最新

  • duanque2413 2012-02-16 15:56
    关注

    The loader naming conventions are probably stricter, so you may need to rename your file to something like 'Thumblib.php' and then declare your class as so class Thumblib {. You may also need to check the library doesn't conflict with anything as is suitable to use in CI.

    Also, I think as long as you are loading the library from a controller in the same module folder tree as the library, the load line should be something like:

    $this->load->library('Thumblib');
    

    Or if not:

    $this->load->library('othermodule/Thumblib');
    

    Good luck.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败