Advantages of PHAR archives in PHP

前端 未结 5 709
[愿得一人]
[愿得一人] 2021-02-04 08:00

PHP 5.3 has a new feature called PHAR similar to JAR in JAVA. It\'s basically a archive of PHP files. What are its advantages

5条回答
  •  死守一世寂寞
    2021-02-04 08:39

    In my experience, loosely packaged PHP source files sitting in a production environment invite tinkering with live code when a fix is needed. Deploying in a .phar file discourages this behaviour and helps reinforce better practices, i.e. build and test in a local environment, then deploy to production.

提交回复
热议问题