Created
January 21, 2012 17:01
-
-
Save brtriver/1653293 to your computer and use it in GitHub Desktop.
Twig.git to twig.phar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$phar = new Phar('twig.phar', 0, 'twig.phar'); | |
$phar->buildFromDirectory(__DIR__ . '/Twig.git/lib'); | |
$phar->compressFiles(Phar::GZ); | |
$phar->setDefaultStub(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#require_once __DIR__ . '/Twig.git/lib/Twig/Autoloader.php'; | |
require_once 'phar://'. __DIR__ . '/twig.phar/Twig/Autoloader.php'; | |
Twig_Autoloader::register(); | |
$loader = new Twig_Loader_Filesystem(__DIR__.'/templates'); | |
$twig = new Twig_Environment($loader, array( | |
'cache' => __DIR__ .'/compilation_cache', | |
)); | |
echo $twig->render('index.html', array('name' => 'brtriver')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment