douyong2531 2014-08-23 08:03
浏览 30
已采纳

与同学的文件中的作曲家自动加载

In my project I use ezc components from PEAR. I want to move all dependency to composer so for it I've found https://github.com/lortnus/ezc. It's great, but I have a one problem - autoloading. There is an autoload folder with classmaps, but I don't have any clue how I can make composer's autoload to use them. Any idea how to do it?

EDIT

I've found two possible ways how to autoload these classes: - fork lortnus/etc and add autoload in composer.json - add autoload in composer.json in my project

Setting a classmap autoloader for all ezc classes will produce a huge autoload_classmap file. I'm not sure, but it can hit a performance a bit. Because of that I take a second approach and it looks like this:

"classmap": [
    "vendor/lortnus/ezc/Base/src",
    "vendor/lortnus/ezc/Mail/src"
]

and instead of creating a classmap for whole ez Components I end up of with a classmap with classes that I need. I don't like setting path to vendor folder, but think that's the best possibility here.

  • 写回答

1条回答 默认 最新

  • doudong1117 2014-08-23 11:45
    关注

    If you do want to go through the hassle (or probably not) of upgrading, the current officially release packages of those "ezComponents" you are using are hosted at Github under their newer name "Zeta Components".

    The mail component in particular can be loaded with Composer via their name "zetacomponents/mail". Autoloading is included. They still seem to do some maintenance, because after the 2009 release of version "1.7" there is already a 2014 release of "1.8 beta"

    I cannot evaluate the amount of work required to upgrade your use of the older version to the newer one, but with only the mail component involved, this probably is a work worth doing.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 深度学习残差模块模型
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)