Use files from one project in other projects without copying them
I have one project which contains some php services that I use as a template in all my other projects.
Is it possible to add these files to a new project without actually copying them to the new project's directory?
Eg.
Template project contains folder "service" with files "1.php", "2.php", "3.php" and folder "util" with "u1.php" and "u2.php". I want to use these files in one or more new projects but without copying them.They should merge with the files of the new project and be treated as if they are in the new project's directory. If the new project also has a folder "service" with files "4.php" and "5.php" the files 1 2 and 3 from the template should show there too. And if I were to edit service/1.php in the new project, the original file in the template project would get changed as well.
Is something like this possible?
请先登录再写评论。
You can add external folders to the project using either a Content Root or a PHP Include.
Neither one, however, would merge the contents for you - there's no way to achieve that.
What is the use case? Why do you need it?
Perhaps a
pathComposer repository is an answer for you?https://getcomposer.org/doc/05-repositories.md#path