New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude_files #83
exclude_files #83
Conversation
The name `exclude_files` could be better -> `exclude_files_from_copy` to be distinct from potentially `exclude_files_from_replace` or any confusion with the `files` autoloader.
Not sure how I feel about this, for now (hint: this is a pointer to start convincing me 😉 ). I get why this is useful, but it feels like more than a monkey patch to a specific problem than Mozart is a monkey patch in itself already. No doubt there are a ton more of these weird setups out there in the wild that may or may not require a specific handling in Mozart. What this does in its current state, is open the door for even weirder bugs when the regex applies to files in multiple packages, even the ones the author didn't intend to target. What I initially think (and just sharing this here, now it's on top of mind, this is not necessarily the way to do it) is better, is to have a specific piece of configuration per package, so we can applies these kind of exclusion rules specific to that package. Now that I type this, it also sounds like a bit overkill as well, but I'm just sharing my general idea here. |
In order to allow targeting specific packages, I made sure to use the full path from But yeah, it's a bit of a hacky way to fix problems with PSR-0/classmaps that might be fixed better if I took the time to learn the intricacies. I'm happy for the PR to sit here to be used with One likely change is to exclude files in the Looking at the illuminate packages, the problem could be solved by also only copying |
Yes, but what if my package (used in the same project, by a separate person) uses a legitimate |
You can use the package name in the regex: |
Add a config option to exclude files based on regex match.
Problem encountered because illuminate/collections's namespace is
Illuminate\Support
!When I try to use both it and actual
illuminate/support
I get errors because Mozart is using the namespace to choose the target folder, not the package name.So I wrote some code to exclude them but then got:
The two
helpers.php
are not the same. But they're not being PSR-4 auto-loaded anyway, so I excluded it and Mozart does not complain.Broken:
working: