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\UserClass
Now I write
Flarum\Core\UserClass
I want to use the one I created when composer automatically loads
UserClass, what should I do?
The method has been found. The namespace is still the original namespace of the class.composerThe 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\UserClass
Now I writeFlarum\Core\UserClass
I want to use the one I created when composer automatically loadsUserClass, what should I do?
The method has been found. The namespace is still the original namespace of the class.composerThe 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.jsonReference the address of your fork project.