-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Hi,
I'm struggling to see a way to extend primary configuration, without copying files outside of the vendor folder. (which I see as bad practise, though this may be wrong?)
I am trying to extend the the model Magento\Framework\Setup\BackupRollback to change the functionality of the method: getCodeBackupIgnorePaths() (to alter the exclude paths - as they aren't configurable)
So I was hoping I could simply add a "preference" in a di.xml however the only di.xml used by the object manager when constructing this object is in app/etc/di.xml
This is because when the "primary" config loader searches for config files, it is forced to look in the location: [Magento base dir]/app/etc/ with a pattern of: "di.xml,/*di.xml" this can be seen at: vendor/magento/framework/Setup/BackupRollback.php:259
Which excludes any di.xml files in the vendor folder, is there a reason for this?
I can see two good approaches (though I'm sure there are others that I have missed)
- submit a pull request that contains code the allow the exclude paths to be configured
- submit a pull request that allows "primary" config files to be declared in the vendor directory
Could you please suggest what you think is best.
Many thanks
Adam