Git Product home page Git Product logo

Comments (11)

kazitanvirahsan avatar kazitanvirahsan commented on August 15, 2024 6

This is a real problem.

from installers.

ramiel avatar ramiel commented on August 15, 2024

I have the same problem.
When I launch composer in root, then I have to manually go into plugin directory and launch composer again because dependencies are installed in root/vendor.

Am I missing something?

from installers.

sbuzonas avatar sbuzonas commented on August 15, 2024

Composer should generate autoload definitions for dependencies of the root package as well as it's dependencies. There is one autoload file to load all of the generated autoloads which is found by default in vendor/autoload.php and the files it loads would be located in vendor/composer/autoload_*.php

from installers.

jajouka79 avatar jajouka79 commented on August 15, 2024

any answer to this? composer install on root is not adding the autoloaders for dependencies of dependencies

from installers.

paul-m avatar paul-m commented on August 15, 2024

I can't repro this.

In my case, it's mile23/page-example, which is a test/demo of using Drupal 8 with Composer. It requires crell/api-problem.

When I say composer require mile23/page-example the installer does everything it should, and then also generates a PSR-4 autoloader which includes Crell's api-problem namespace.

You should have a project vendor directory, and your code should include or require vendor/autoload.php.

from installers.

Cryt1c avatar Cryt1c commented on August 15, 2024

Is this already fixed? I have the same problem. I have a php library which includes some helper functions:

"autoload": {
    "files": [
      "src/helpers/ethereum-client-workaround-helpers.php"
    ],
    "psr-4": {
      "Ethereum\\": "src/"
    }
  }

But they won't appear in the autoload_files.php files, even if I do a "composer dump".
Any ideas how to fix this?

from installers.

crirus avatar crirus commented on August 15, 2024

Facing the same issue, no solution?

from installers.

mopsyd avatar mopsyd commented on August 15, 2024

I had a similar issue with a wordpress theme I was building recently. Do the following:

  • Initialize your theme/plugin with it's own composer file, map from a subdirectory to vendor if you don't want the composer.json in your plugin root.

  • Make sure you upload the autoload.php file AND the composer folder in vendor. The actual autoload maps that get generated live in there. The autoload.php is just a proxy to that, and it doesn't work without them.

from installers.

MarkMurphy avatar MarkMurphy commented on August 15, 2024

It appears that vendor/composer/installed.json isn't adding "files": [...] for the related package.

from installers.

brandonbest avatar brandonbest commented on August 15, 2024

This was a very annoying issue. Found this and it helped:
https://stackoverflow.com/questions/18106599/composer-does-not-generate-autoloader-information-autoload-namespaces-php

from installers.

Seldaek avatar Seldaek commented on August 15, 2024

Closing as I don't really see what the problem is here. If someone still has the issue please post detailed reproduction instructions otherwise there's not much we can do.

from installers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.