Foxexample: there is a FlarumCoreUser class in a third-party package. what should I do if I write a FlarumCoreUser class myself and want composer to use the User class I created when auto loading? The method has been found. The namespace is still the class...
Fox example:
A third-party package used has
Flarum\Core\User
Class
Now I write
Flarum\Core\User
Class
I want to use the one I created when composer automatically loads
User
Class, what should I do?
The method has been found. The namespace is still the original namespace of the class.composer
The class I wrote will be automatically loaded.
"autoload": { "classmap": [ "vendor/path/to/src/User.php" ]},
Reply content:
Fox example:
A third-party package used hasFlarum\Core\User
Class
Now I writeFlarum\Core\User
Class
I want to use the one I created when composer automatically loadsUser
Class, what should I do?
The method has been found. The namespace is still the original namespace of the class.composer
The class I wrote will be automatically loaded.
"autoload": { "classmap": [ "vendor/path/to/src/User.php" ]},
There is a third-party library that you want to rewrite and load the code you have rewritten?
If your third-party library is hosted on github, you fork the project, clone it to the local device, modify it, push it to github, and thencomposer.json
Reference the address of your fork project.