Merging multiple PHP script into a single file

前端 未结 6 2005
礼貌的吻别
礼貌的吻别 2021-02-05 07:59

I have a PHP script which includes one or two other libraries it depends on using the \'include\' statement. To make it more easily portable, I would like to someho

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 08:37

    You could write a custom script that opens all the files, removes the opening and closing tags, and concatenates them together and saves as one file. should be pretty easy to do.

    Or you can use a php compiler. It will do a bit more than what you are looking for, but if you just want one file, you run your dev project through one of these.

    • http://www.phpcompiler.org/
    • http://www.roadsend.com/home/index.php?pageID=compiler

    You might also be able to use the built in php bytecode compiler to compile everything to byte-code and stick it in one file.

    • http://us.php.net/bcompiler

提交回复
热议问题