diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c36e38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea/ +vendor/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d2d3c2 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +

+ +
+ www.phpbenchmarks.com +

+ +## What is www.phpbenchmarks.com ? + +You will find lot of benchmarks for PHP frameworks and template engines. + +You can compare results between Apache Bench and Siege, and PHP 5.6 to 7.2. + +## What is this repository ? + +It's benchmark common code for Twig benchmarks. + +Switch branch to select your Twig major version and benchmark you want to see. + +See all Twig benchmarked versions on [phpbenchmarks/twig](https://github.com/phpbenchmarks/twig). + +You can find how we benchmark on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark-protocol.html). + +## How versions works ? + +We do not follow semantic version for this repository. Here is an explanation about our versioning system: + +`X` related to Twig major version (`1` Twig ^1, `2` Twig ^2) + +`Y` benchmark type (`1` Hello World) + +`Z` new version, not just bugfix and could contains BC + +## Benchmarks + +You can find all Twig benchmarks results on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark/twig.html). + +Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark ! diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..98dc2a3 --- /dev/null +++ b/composer.json @@ -0,0 +1,8 @@ +{ + "name": "phpbenchmarks/twig-common", + "type": "project", + "license": "proprietary", + "require": { + "twig/twig": "^2.0" + } +} diff --git a/helloworld.php b/helloworld.php new file mode 100644 index 0000000..a6d3b0a --- /dev/null +++ b/helloworld.php @@ -0,0 +1,8 @@ + $cacheDir] +); + +echo $twig->render('helloworld.html.twig'); diff --git a/templates/helloworld.html.twig b/templates/helloworld.html.twig new file mode 100644 index 0000000..d7407a1 --- /dev/null +++ b/templates/helloworld.html.twig @@ -0,0 +1 @@ +Hello World !