• 请不要在回答技术问题时复制粘贴 AI 生成的内容
wudikua
V2EX  ›  程序员

composer 可以定义自己的 classloader 么

  •  
  •   wudikua · Oct 9, 2014 · 2834 views
    This topic created in 4275 days ago, the information mentioned may be changed or developed.
    历史项目,不想用namespace啊,又想用它做模块化来管理依赖
    6 replies    2014-10-10 08:05:38 +08:00
    foccy
        1
    foccy  
       Oct 9, 2014
    可以自己的loader注册,互不影响吧。
    wudikua
        2
    wudikua  
    OP
       Oct 9, 2014
    @foccy 去require自己项目里的一个loader?
    foccy
        3
    foccy  
       Oct 9, 2014
    没用composer之前的怎么用还是怎么用,直接在项目里```require``` composer的autoload.php就可以。
    wudikua
        4
    wudikua  
    OP
       Oct 9, 2014
    @foccy 可是我require的项目是我自己写的,没遵循PSR-0什么的。
    foccy
        5
    foccy  
       Oct 10, 2014
    那你以前的项目没用spl_autoload_register函数自动加载?
    foccy
        6
    foccy  
       Oct 10, 2014
    不过使用composer的classmap应该也可以。
    https://getcomposer.org/doc/04-schema.md#classmap
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2790 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:20 · PVG 23:20 · LAX 08:20 · JFK 11:20
    ♥ Do have faith in what you're doing.