From 5b8fd1c3bd19700da4558874135c59981afff03e Mon Sep 17 00:00:00 2001 From: fabien Date: Mon, 12 Oct 2009 07:05:31 +0000 Subject: [PATCH] added a PEAR package file git-svn-id: http://svn.twig-project.org/trunk@23 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- bin/create_pear_package.php | 45 ++++++++++++++++++++++++++++++ package.xml.tpl | 63 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 0 deletions(-) create mode 100644 bin/create_pear_package.php create mode 100644 package.xml.tpl diff --git a/bin/create_pear_package.php b/bin/create_pear_package.php new file mode 100644 index 0000000..e9ebf6c --- /dev/null +++ b/bin/create_pear_package.php @@ -0,0 +1,45 @@ + date('Y-m-d'), + 'time' => date('H:m:00'), + 'version' => $argv[1], + 'api_version' => $argv[1], + 'stability' => $argv[2], + 'api_stability' => $argv[2], +); + +$context['files'] = ''; +$path = realpath(dirname(__FILE__).'/../lib/Twig'); +foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY) as $file) +{ + if (preg_match('/\.php$/', $file)) + { + $name = str_replace($path.'/', '', $file); + $context['files'] .= ' '."\n"; + } +} + +$template = file_get_contents(dirname(__FILE__).'/../package.xml.tpl'); +$content = preg_replace_callback('/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/', 'replace_parameters', $template); +file_put_contents(dirname(__FILE__).'/../package.xml', $content); + +function replace_parameters($matches) +{ + global $context; + + return isset($context[$matches[1]]) ? $context[$matches[1]] : null; +} diff --git a/package.xml.tpl b/package.xml.tpl new file mode 100644 index 0000000..c0488fb --- /dev/null +++ b/package.xml.tpl @@ -0,0 +1,63 @@ + + + Twig + pear.twig-project.org + Twig is a PHP template engine. + + Twig is a template language for PHP, released under the new BSD license + (code and documentation). + + Twig uses a syntax similar to the Django and Jinja template languages which + inspired the Twig runtime environment. + + + Fabien Potencier + fabpot + fabien.potencier@symfony-project.org + yes + + + Armin Ronacher + armin + armin.ronacher@active-4.com + no + + {{ date }} + + + {{ version }} + {{ api_version }} + + + {{ stability }} + {{ stability }} + + BSD Style + - + + + + + + + +{{ files }} + + + + + + + + 5.2.4 + + + 1.4.0 + + + + + -- 1.7.2.5