Comments (20)
(I ran composer du
)
from eventsauce.
@sandervanhooft have your tried classmap?
from eventsauce.
yes, no luck there either yet. Not completely sure yet what I should put in there in this case tbh
from eventsauce.
Hang on, I think you're right
from eventsauce.
I've just created a bunch of random classes in a file and required it using the autoload.files
, and I can autoload them just fine on composer 2.0.11.
from eventsauce.
autoload.classmap
seems to do the trick here
autoload.files
doesn't somehow
from eventsauce.
(also on composer 2.0.11 here)
from eventsauce.
That's weird, the autoload.files should just always be loaded. There shouldn't be any difference between composer 1 and 2 here since it's always used for loading functions... very strange
from eventsauce.
So this works:
"autoload": {
"classmap": [
"src/Domain/SomeModule/commands_and_events.php"
],
"psr-4": {
"App\\": "src/App/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/",
"Domain\\": "src/Domain/",
"Support\\": "src/Support/"
}
},
from eventsauce.
Note that src/Domain
is also used in autoload.psr-4
, looks to me as if the autoload.psr-4
runs after the autoload.files
and then decides to skip/remove the files (edit)
from eventsauce.
So it may be a composer autoloader hierarchy issue
from eventsauce.
{
"name": "test/something",
"autoload": {
"psr-4": {
"Domain\\": "src/Domain"
},
"files": [
"src/Domain/classes.php"
]
},
"require": {
"eventsauce/eventsauce": "^0.8.2"
}
}
this works for me
from eventsauce.
Still getting the same warnings / skips here... Even after a complete reinstall
rm -rf composer.lock vendor && composer update
from eventsauce.
@sandervanhooft can you share an example repo with me where you experience this issue?
from eventsauce.
It's solved when using the classmap
from eventsauce.
Let me see if I can whip something up for you
from eventsauce.
Here you go:
https://github.com/sandervanhooft/es_composer_issue
from eventsauce.
It's using the Laravel wrapper, I don't expect that will be the cause.
Here's my output
from eventsauce.
@sandervanhooft ah now I understand what you meant. Then yeah, this is expected behaviour and the class-map is the solution. Your issue didn't specify during which operation it skipped the files and it seems your installation is configured to optimise the autoloader always (https://github.com/sandervanhooft/es_composer_issue/blob/main/composer.json#L28), so when I dumped it didn't give me this message. I then assumed you meant it skipped it when trying to load it. Which is then of course not the case. Mystery solved for me at least. Then the answer is relatively simple, use class-map :)
from eventsauce.
"optimize-autoloader": true,
Oh my that's a nifty little bugger.
That's standard Laravel boilerplate. Good to be aware of this. Thanks!
from eventsauce.
Related Issues (20)
- Message::withHeader() no longer allows array value HOT 2
- Doubt about aggregate root version HOT 4
- Isn't replaying domain message events by default slow as hell HOT 15
- Examples of persisting snapshots to a database HOT 2
- Aggregate root HOT 3
- Projections
- Structure table
- Suggest snapshotting change HOT 2
- AggregateRootBehaviour should have a template on AggregateRootId HOT 3
- Use lambdas insterad of command objects? HOT 4
- DefaultHeadersDecorator order parameters deprecated HOT 6
- Move all tests to separate folder tests HOT 2
- Reconstituting a specific version HOT 8
- Missing "id" reference in docs HOT 1
- DoctrineOutboxRepository reserved words escaping HOT 1
- Type mismatched... Expected `AggregateRootId` found `AggregateRootIdType` HOT 1
- Storing messages in MongoDB HOT 2
- Help needed... Preconditions are not working in test scenarios HOT 2
- Your inputs on this would be very helpful
- PayloadSerializerSupportingObjectMapperAndSerializablePayload does not work recursively
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 eventsauce.