It is very popular to use Twig on developing with PHP. But it is not easy to deploy my application with Twig because there are a lot of files to deploy. I want to deploy it easily.
So I tried to make twig.phar, which is PHP Archive.
This article is a memo for PHP developers who are like me.
As first, let's get Twig sources from git.
$ git clone https://github.com/fabpot/Twig.git
It is "compiler.php", which compile twig.phar file.
If it occurs error when you run this script, you have to set "phar.readonly" to "Off" in php.ini.
Sample code with twig.phar
Then, you have only to call with "phar://" like below:
As the result, you have only to deal with this twig.phar file. It is very simple.