Composer Not Generating Autoloads For Library

我怕爱的太早我们不能终老 提交于 2019-12-01 03:06:17

I see two possible mistakes you may have done that would cause this:

  • You forgot to update your satis repo so the autoload config for lxp/init is not up to date in there
  • You are running composer install from a lock file, and that means composer just reads the info from the composer.lock file and does not update package metadata to the latest version available in satis. To solve this you should run composer update instead.
kta

Try composer dump-autoload command.

It depends how you installing your library via Composer. For example, when downloading it as package type (same I believe with composer type), Composer never reads the composer.json file, so instead you should use vcs or git type. See: GH-6846.

Here is composer.json which should work:

{
  "require": {
    "lxp/library": "dev-master"
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "http://satis.repo.redacted/"
    }
  ]
}

Then run: composer install.

For troubleshooting, try running:

  • composer dump-autoload -o -vvv.
  • composer diagnose -vvv
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!