开发者

How can you run your PHP scripts when using Maven for PHP?

开发者 https://www.devze.com 2022-12-31 04:11 出处:网络
I have an application consisting of many scripts doing some stuff on their own. I want to modify it\'s structure using Maven for PHP with multiple modules, a common module and a lot of client modules

I have an application consisting of many scripts doing some stuff on their own. I want to modify it's structure using Maven for PHP with multiple modules, a common module and a lot of client modules depending on the common one. I use the PHPUnit for testing and I run the tests from maven with "mvn test". So when running the tests maven includes the common module paths and the src/main/php paths. The 开发者_如何学Cproblem is that I don't know how to run the scripts now, because for testing purposes I have to rely on the fact that Maven includes the needed module paths so I can include files relative to the root of my module src dir.

Is there any way of dealing with this? Should I use a .bat file which includes the paths to all my modules to run the scripts?


I think the only solutions are: - use a single maven module for all the sources so the resulting jar will have the structure you want. - use a shell script to run your php scripts after you mix all module jars in one folder. The shell should then be something like this: php -d include_path="all the paths to all your src modules" "script_name and arguments". The script name and the arguments will be the ones you will provide when calling the shell script.

0

精彩评论

暂无评论...
验证码 换一张
取 消