fenetikm / autoload-drupal Goto Github PK
View Code? Open in Web Editor NEWComposer plugin to add Drupal autoloading to the composer autoloader
License: MIT License
Composer plugin to add Drupal autoloading to the composer autoloader
License: MIT License
I don't think .module files are loaded as one of my module has
define('ADOBE_CAPTIVATE_ZIP_UPLOAD_SUBFOLDER', '__uploaded__');
And in another, that constant is used. Psalm says undefined constant.
I understand .module files don't have namespace so these are not loaded, right?
Composer 2 compatibility was merged in december 2020, but no tagged release has been made yet, forcing people to require dev-master
. Let me know if any work needs to be done before creating a new release, I'd be happy to help.
This works great for classes and Phpactor :)
I also tried using it with PHPStan but it seems none of the functions are found:
------ --------------------------------------------------------------
Line docroot/modules/custom/astra_site/src/Form/NodeFormAlter.php
------ --------------------------------------------------------------
50 Function menu_ui_get_menu_link_defaults not found.
59 Function t not found.
68 Function menu_ui_get_menus not found.
------ --------------------------------------------------------------
Not really sure if anything can be done here - I guess maybe adding the .module
files to composer?
Hi !
Any chance to see a version compatible with Composer 2 ?
Thanks
Thanks for writing this plugin, it works great!
Autocomplete is working for most of my classes, but I'm having trouble in certain cases. For example if typing Drupal\taxonomy\Entity\Vocabulary->
it does not autocomplete. However if I edit docroot/core/modules/taxonomy/src/Entity/Vocabulary.php and remove the extends ConfigEntityBundleBase
from the class, the autocomplete for Vocabulary
starts working. Is this because Drupal\Core\Config\Entity\ConfigEntityBundleBase
is not being recognized by composer's autoloader?
I tried manually adding the following to vendor/composer/autoload_psr4.php
:
'Drupal\\Core\\Config\\Entity\\' => array($baseDir . '/docroot/core/lib/Drupal/Core/Config/Entity'),
but that didn't seem to work. Do you have thoughts on what I might be doing wrong? Thank you!
Here's my composer.json
config in case that helps:
"autoload-drupal": {
"modules": [
"docroot/modules/contrib/",
"docroot/core/modules/",
"docroot/modules/custom/"
],
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.