Comments (2)
Looks like it doesn't use autoloading for all its classes:
Warning: Ambiguous class resolution, "Carbon\PHPStan\AbstractReflectionMacro" was found in both "/path/to/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php" and "/path/to/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php", the first will be used.
Warning: Ambiguous class resolution, "Carbon\PHPStan\LazyMacro" was found in both "/path/to/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php" and "/path/to/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php", the first will be used.
Warning: Ambiguous class resolution, "Carbon\MessageFormatter\LazyMessageFormatter" was found in both "/path/to/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php" and "/path/to/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php", the first will be used.
Warning: Ambiguous class resolution, "Carbon\LazyTranslator" was found in both "/path/to/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php" and "/path/to/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php", the first will be used.
Strauss determines which files to copy and prefix by reading the packages' composer.json autoload keys. So since Carbon has omitted those files, Strauss doesn't pick them up. Strauss has an override_autoload
setting that allows redefining packages' autoload
keys.
Using this as your extra
key seems to work:
"extra": {
"strauss": {
"target_directory": "vendor",
"constant_prefix": "TSD_CUSTOM_VENDOR_",
"include_modified_date": false,
"include_author": false,
"exclude_from_prefix": {
"packages": [
"yahnis-elsts/plugin-update-checker",
"woocommerce/action-scheduler"
]
},
"override_autoload": {
"nesbot/carbon": {
"autoload": {
"psr-4": {
"Carbon\\": "src/Carbon/"
}
},
"classmap": [
"lazy"
]
}
}
}
}
There is an issue with double-prefixing when using strauss.phar
repeatedly. I haven't been using the phar myself (although long term I think it's the better way) but I will fix that sooner or later. Just FYI to expect that!
from strauss.
Thanks @BrianHenryIE this resolved the issue!
I understand that the double-prefixing issue is not present when we use strauss as a dependency. Is there a way to use strauss a a dependency without the issues I experienced with the composer requirement as mentioned in:
#69
If there is a sollution for that then I could prevent deleting the prefixed vendor
directory everytime I have to do composer update
. I tried a new script on pre-update-cmd
where the vendor
and composer.lock
would get deleted before updating and then triggering composer install
. But this pre-update-cmd
script gets triggered before composer install
as well so that ended up in an infinite loop.
If not then I will delete the vendor
directory manually for now.
By the way; using the strauss.phar
is a lot faster.
from strauss.
Related Issues (20)
- Incorrect binary name when installed using composer HOT 2
- Good idea to set `target_directory`to 'vendor'? HOT 1
- Feature: Change WordPress translation domain HOT 1
- Still works? HOT 3
- Add warning about using composer packages installed with symlink HOT 3
- Issue bundling AWS S3 package HOT 3
- Troubles Namespacing WPGraphQL HOT 5
- `exclude_from_copy` does not apply to `files` autoloaders
- delete_vendor_packages deletes needed composer files HOT 2
- Infinite loop HOT 2
- Request: prefix global functions. HOT 1
- Namespaced use function declarations aren't prefixed HOT 11
- Strauss Fail when a namespace is mapped to an array of paths HOT 6
- Files autoloader for symlinked package not copied or referenced correctly
- JsonException core PHP class, polyfilled by Symfony, incorrectly replaced
- v0.14.1 no longer parses `<?php namespace ...` HOT 1
- How to handle prefixed dependencies also used by dev-dependencies HOT 9
- Recommended way to handle non-php assets / paths? HOT 2
- Not Namespacing instanceof Statements HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strauss.