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 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂