The following library files are available:
$ cd src/lib/Xyz/$ lsa.php b.php c.php
Then the composer.json
file autoload
is:
autoload: { psr-4: { Xyz\\: src/lib/Xyz/ }}
Now I want to composer install
add the global initialization function to the library at run time, Xyz
specifically, add the file x.php
, and the content of the file is this:
相当于说,x.php
文件是整个 Xyz
库最先执行的,是其他 php 文件需要的东西。
所以,该如何编写 composer.json
文件呢?
Reply content:
The following library files are available:
$ cd src/lib/Xyz/$ lsa.php b.php c.php
Then the composer.json
file autoload
is:
autoload: { psr-4: { Xyz\\: src/lib/Xyz/ }}
Now I want to composer install
add the global initialization function to the library at run time, Xyz
specifically, add the file x.php
, and the content of the file is this:
相当于说,x.php
文件是整个 Xyz
库最先执行的,是其他 php 文件需要的东西。
所以,该如何编写 composer.json
文件呢?
Require it on the PHP file that was first executed in your library
Composer doesn't seem to be doing this, is it? It is only responsible for managing dependencies, not the code in the management package, you say this yourself modify your XYZ library source code is not on the line.
@leunggamciu @incNick Thank you, it's a way to require in the source code entry file. I just want to know if composer has this method, I checked the information, in the autoload
field, a field that can be parallel to psr-4
: files
may work, I took the time to try and then reply.