Complete the template machinery for the existing code.
authorGunnar Wrobel <p@rdus.de>
Tue, 11 Jan 2011 10:31:16 +0000 (11:31 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 11 Jan 2011 10:31:16 +0000 (11:31 +0100)
15 files changed:
components/lib/Components/Helper/Template.php [new file with mode: 0644]
components/lib/Components/Helper/Template/Php.php [new file with mode: 0644]
components/lib/Components/Helper/Template/Printf.php [new file with mode: 0644]
components/lib/Components/Helper/Templates.php
components/lib/Components/Helper/Templates/Prefix.php [new file with mode: 0644]
components/lib/Components/Helper/Templates/Single.php [new file with mode: 0644]
components/lib/Components/Runner/CiPrebuild.php
components/lib/Components/Runner/CiSetup.php
components/lib/Components/Runner/Distribute.php
components/package.xml
components/test/Components/Unit/Components/Helper/TemplatesTest.php
components/test/Components/fixture/templates/input.template [new file with mode: 0644]
components/test/Components/fixture/templates/php.template [new file with mode: 0644]
components/test/Components/fixture/templates/simple.template [new file with mode: 0644]
components/test/Components/fixture/templates/variables.template [new file with mode: 0644]

diff --git a/components/lib/Components/Helper/Template.php b/components/lib/Components/Helper/Template.php
new file mode 100644 (file)
index 0000000..7c0e120
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Components_Helper_Template:: converts a template into a target file.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+
+/**
+ * Components_Helper_Template:: converts a template into a target file.
+ *
+ * Copyright 2011 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+class Components_Helper_Template
+{
+    /**
+     * Source template.
+     *
+     * @var string
+     */
+    protected $_source;
+
+    /**
+     * Target file.
+     *
+     * @var string
+     */
+    protected $_target;
+
+    /**
+     * Constructor.
+     *
+     * @param string $source     The source location.
+     * @param string $target     The target location.
+     */
+    public function __construct($source, $target)
+    {
+        $this->_source = $source;
+        $this->_target = $target;
+    }
+
+    /**
+     * Rewrite the template from the source to the target location.
+     *
+     * @param array  $parameters The template parameters.
+     *
+     * @return NULL
+     */
+    public function write(array $parameters = array())
+    {
+        throw new Horde_Component_Exception('Overwrite in the extending class!');
+    }
+
+    /**
+     * A factory for the specific template type.
+     */
+    static public function factory($source, $target)
+    {
+        $sh = fopen($source, 'r');
+        $lead = fread($sh, 5);
+        fclose($sh);
+        if ($lead == '<?php') {
+            return new Components_Helper_Template_Php($source, $target);
+        } else {
+            return new Components_Helper_Template_Printf($source, $target);
+        }
+    }
+}
\ No newline at end of file
diff --git a/components/lib/Components/Helper/Template/Php.php b/components/lib/Components/Helper/Template/Php.php
new file mode 100644 (file)
index 0000000..abc8fdc
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Components_Helper_Template_Php:: converts a PHP template into a target file.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+
+/**
+ * Components_Helper_Template_Php:: converts a PHP template into a target file.
+ *
+ * Copyright 2011 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+class Components_Helper_Template_Php
+extends Components_Helper_Template
+{
+    /**
+     * Rewrite the template from the source to the target location.
+     *
+     * @param array  $parameters The template parameters.
+     *
+     * @return NULL
+     */
+    public function write(array $parameters = array())
+    {
+        foreach ($parameters as $key => $value) {
+            ${$key} = $value;
+        }
+        ob_start();
+        include $this->_source;
+        file_put_contents($this->_target, ob_get_clean());
+    }
+}
\ No newline at end of file
diff --git a/components/lib/Components/Helper/Template/Printf.php b/components/lib/Components/Helper/Template/Printf.php
new file mode 100644 (file)
index 0000000..1f26742
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Components_Helper_Template_Printf:: converts a template into a target file using vsprintf().
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+
+/**
+ * Components_Helper_Template_Printf:: converts a template into a target file using vsprintf().
+ *
+ * Copyright 2011 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+class Components_Helper_Template_Printf
+extends Components_Helper_Template
+{
+    /**
+     * Rewrite the template from the source to the target location.
+     *
+     * @param array  $parameters The template parameters.
+     *
+     * @return NULL
+     */
+    public function write(array $parameters = array())
+    {
+        $source = file_get_contents($this->_source);
+        file_put_contents(
+            $this->_target, vsprintf($source, $parameters)
+        );
+    }
+}
\ No newline at end of file
index 018d817..842d11f 100644 (file)
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @link     http://pear.horde.org/index.php?package=Components
  */
-class Components_Helper_Templates
+abstract class Components_Helper_Templates
 {
     /**
-     * The source location.
-     *
-     * @var string
-     */
-    private $_source;
-
-    /**
-     * The target location.
-     *
-     * @var string
-     */
-    private $_target;
-
-    /**
-     * Constructor.
-     *
-     * @param string $sdir  The templates source directory.
-     * @param string $tdir  The templates target directory.
-     * @param string $sfile The exact template source file.
-     * @param string $tfile The exact template target file.
-     */
-    public function __construct($sdir, $tdir, $sfile = '', $tfile = '')
-    {
-        $source = $sdir . DIRECTORY_SEPARATOR . $sfile . '.template';
-        if (file_exists($source)) {
-            $this->_source = $source;
-        } else {
-            throw new Components_Exception("No template at $source!");
-        }
-        $this->_target = $tdir . DIRECTORY_SEPARATOR . $tfile;
-    }
-
-    /**
-     * Rewrite the template(s) from the source(s) to the target location(s).
+     * Rewrite the template from the source to the target location.
      *
+     * @param string $source     The source location.
+     * @param string $target     The target location.
      * @param array  $parameters The template(s) parameters.
      *
      * @return NULL
      */
-    public function write(array $parameters = array())
+    protected function writeSourceToTarget($source, $target, array $parameters = array())
     {
-        $source = file_get_contents($this->_source);
-        file_put_contents($this->_target, vsprintf($source, $parameters));
+        $template = Components_Helper_Template::factory($source, $target)
+            ->write($parameters);
     }
 }
\ No newline at end of file
diff --git a/components/lib/Components/Helper/Templates/Prefix.php b/components/lib/Components/Helper/Templates/Prefix.php
new file mode 100644 (file)
index 0000000..b1913d5
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Components_Helper_Templates_Single:: converts a single template file into a
+ * target file.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+
+/**
+ * Components_Helper_Templates_Single:: converts a single template file into a
+ * target file.
+ *
+ * Copyright 2011 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+class Components_Helper_Templates_Prefix
+extends Components_Helper_Templates
+{
+    /**
+     * The source location.
+     *
+     * @var string
+     */
+    private $_source;
+
+    /**
+     * The target location.
+     *
+     * @var string
+     */
+    private $_target;
+
+    /**
+     * Constructor.
+     *
+     * @param string $sdir  The templates source directory.
+     * @param string $tdir  The templates target directory.
+     * @param string $sfile The exact template source file.
+     * @param string $tfile The exact template target file.
+     */
+    public function __construct($sdir, $tdir, $prefix, $tfile)
+    {
+        $template = null;
+        foreach (
+            new RecursiveIteratorIterator(
+                new RecursiveDirectoryIterator($sdir),
+                RecursiveIteratorIterator::CHILD_FIRST
+            )
+            as $file
+        ) {
+            if (strpos($file->getBasename(), $prefix) === 0) {
+                $template = $file;
+                break;
+            }
+        }
+        if (empty($template)) {
+            throw new Components_Exception(
+                sprintf(
+                    'No packaging template starting with "%s" was found in the template directory %s!',
+                    $prefix,
+                    $sdir
+                )
+            );
+        }
+        $this->_source = $template->getPathname();
+        $this->_target = $tdir . DIRECTORY_SEPARATOR . $tfile;
+    }
+
+    /**
+     * Rewrite the template(s) from the source(s) to the target location(s).
+     *
+     * @param array  $parameters The template(s) parameters.
+     *
+     * @return NULL
+     */
+    public function write(array $parameters = array())
+    {
+        $this->writeSourceToTarget($this->_source, $this->_target, $parameters);
+    }
+}
\ No newline at end of file
diff --git a/components/lib/Components/Helper/Templates/Single.php b/components/lib/Components/Helper/Templates/Single.php
new file mode 100644 (file)
index 0000000..68a2531
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Components_Helper_Templates_Single:: converts a single template file into a
+ * target file.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+
+/**
+ * Components_Helper_Templates_Single:: converts a single template file into a
+ * target file.
+ *
+ * Copyright 2011 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Components
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Components
+ */
+class Components_Helper_Templates_Single
+extends Components_Helper_Templates
+{
+    /**
+     * The source location.
+     *
+     * @var string
+     */
+    private $_source;
+
+    /**
+     * The target location.
+     *
+     * @var string
+     */
+    private $_target;
+
+    /**
+     * Constructor.
+     *
+     * @param string $sdir  The templates source directory.
+     * @param string $tdir  The templates target directory.
+     * @param string $sfile The exact template source file.
+     * @param string $tfile The exact template target file.
+     */
+    public function __construct($sdir, $tdir, $sfile, $tfile)
+    {
+        $source = $sdir . DIRECTORY_SEPARATOR . $sfile . '.template';
+        if (file_exists($source)) {
+            $this->_source = $source;
+        } else {
+            throw new Components_Exception("No template at $source!");
+        }
+        $this->_target = $tdir . DIRECTORY_SEPARATOR . $tfile;
+    }
+
+    /**
+     * Rewrite the template(s) from the source(s) to the target location(s).
+     *
+     * @param array  $parameters The template(s) parameters.
+     *
+     * @return NULL
+     */
+    public function write(array $parameters = array())
+    {
+        $this->writeSourceToTarget($this->_source, $this->_target, $parameters);
+    }
+}
\ No newline at end of file
index cf0c14f..1314409 100644 (file)
@@ -81,7 +81,7 @@ class Components_Runner_CiPrebuild
             );
         }
 
-        $build_template = new Components_Helper_Templates(
+        $build_template = new Components_Helper_Templates_Single(
             $this->_config_application->getTemplateDirectory(),
             $options['ciprebuild'],
             'hudson-component-build.xml',
@@ -89,7 +89,7 @@ class Components_Runner_CiPrebuild
         );
         $build_template->write(array('toolsdir' => $options['toolsdir']));
 
-        $phpunit_template = new Components_Helper_Templates(
+        $phpunit_template = new Components_Helper_Templates_Single(
             $this->_config_application->getTemplateDirectory(),
             $options['ciprebuild'],
             'hudson-component-phpunit.xml',
index 68009f0..b947b3f 100644 (file)
@@ -92,7 +92,7 @@ class Components_Runner_CiSetup
             $origin = basename($arguments[0]);
         }
 
-        $config_template = new Components_Helper_Templates(
+        $config_template = new Components_Helper_Templates_Single(
             $this->_config_application->getTemplateDirectory(),
             $options['cisetup'],
             'hudson-component-config.xml',
index 77e68d6..92af473 100644 (file)
@@ -74,30 +74,6 @@ class Components_Runner_Distribute
         $options = $this->_config->getOptions();
         $arguments = $this->_config->getArguments();
 
-        $template = null;
-        foreach (
-            new RecursiveIteratorIterator(
-                new RecursiveDirectoryIterator(
-                    $this->_config_application->getTemplateDirectory()
-                ),
-                RecursiveIteratorIterator::CHILD_FIRST
-            )
-            as $file
-        ) {
-            if (strpos($file->getBasename(), 'distribute_') === 0) {
-                $template = $file;
-                break;
-            }
-        }
-        if (empty($template)) {
-            throw new Components_Exception(
-                sprintf(
-                    'No packaging template starting with "distribute_" was found in the template directory %s!',
-                    $this->_config_application->getTemplateDirectory()
-                )
-            );
-        }
-
         if (!isset($options['pearrc'])) {
             $package = $this->_factory->createPackageForDefaultLocation(
                 $arguments[0] . DIRECTORY_SEPARATOR . 'package.xml'
@@ -112,13 +88,15 @@ class Components_Runner_Distribute
         $version = $package->getVersion() . 'dev' . strftime('%Y%m%d%H%M');
         $package->generateSnapshot($version, dirname($options['distribute']));
 
-        ob_start();
-        include $template->getPathname();
-        $packaging = ob_get_clean();
-
-        file_put_contents(
-            $options['distribute'],
-            $packaging
+        $build_template = new Components_Helper_Templates_Prefix(
+            $this->_config_application->getTemplateDirectory(),
+            dirname($options['distribute']),
+            'distribute_',
+            basename($options['distribute'])
+        );
+        $build_template->write(
+            array('package' => $package, 'version' => $version)
         );
+
     }
 }
index a936a2c..b1fee86 100644 (file)
@@ -25,7 +25,7 @@
   <active>yes</active>
  </lead>
  <date>2011-01-11</date>
- <time>05:29:34</time>
+ <time>11:29:20</time>
  <version>
   <release>0.0.1</release>
   <api>0.0.1</api>
       <file name="Pear.php" role="php" />
      </dir> <!-- /lib/Components/Exception -->
      <dir name="Helper">
+      <dir name="Template">
+       <file name="Php.php" role="php" />
+       <file name="Printf.php" role="php" />
+      </dir> <!-- /lib/Components/Helper/Template -->
+      <dir name="Templates">
+       <file name="Prefix.php" role="php" />
+       <file name="Single.php" role="php" />
+      </dir> <!-- /lib/Components/Helper/Templates -->
       <file name="InstallationRun.php" role="php" />
       <file name="ListRun.php" role="php" />
       <file name="Root.php" role="php" />
+      <file name="Template.php" role="php" />
       <file name="Templates.php" role="php" />
       <file name="Tree.php" role="php" />
      </dir> <!-- /lib/Components/Helper -->
        <file name="hudson-component-build.xml.template" role="test" />
        <file name="hudson-component-config.xml.template" role="test" />
        <file name="hudson-component-phpunit.xml.template" role="test" />
+       <file name="input.template" role="test" />
+       <file name="php.template" role="test" />
+       <file name="simple.template" role="test" />
+       <file name="variables.template" role="test" />
       </dir> <!-- /test/Components/fixture/templates -->
      </dir> <!-- /test/Components/fixture -->
      <dir name="Integration">
    <install as="Components/Helper/InstallationRun.php" name="lib/Components/Helper/InstallationRun.php" />
    <install as="Components/Helper/ListRun.php" name="lib/Components/Helper/ListRun.php" />
    <install as="Components/Helper/Root.php" name="lib/Components/Helper/Root.php" />
+   <install as="Components/Helper/Template.php" name="lib/Components/Helper/Template.php" />
    <install as="Components/Helper/Templates.php" name="lib/Components/Helper/Templates.php" />
    <install as="Components/Helper/Tree.php" name="lib/Components/Helper/Tree.php" />
+   <install as="Components/Helper/Template/Php.php" name="lib/Components/Helper/Template/Php.php" />
+   <install as="Components/Helper/Template/Printf.php" name="lib/Components/Helper/Template/Printf.php" />
+   <install as="Components/Helper/Templates/Prefix.php" name="lib/Components/Helper/Templates/Prefix.php" />
+   <install as="Components/Helper/Templates/Single.php" name="lib/Components/Helper/Templates/Single.php" />
    <install as="Components/Module/Base.php" name="lib/Components/Module/Base.php" />
    <install as="Components/Module/CiSetup.php" name="lib/Components/Module/CiSetup.php" />
    <install as="Components/Module/Dependencies.php" name="lib/Components/Module/Dependencies.php" />
    <install as="Components/fixture/templates/hudson-component-build.xml.template" name="test/Components/fixture/templates/hudson-component-build.xml.template" />
    <install as="Components/fixture/templates/hudson-component-config.xml.template" name="test/Components/fixture/templates/hudson-component-config.xml.template" />
    <install as="Components/fixture/templates/hudson-component-phpunit.xml.template" name="test/Components/fixture/templates/hudson-component-phpunit.xml.template" />
+   <install as="Components/fixture/templates/input.template" name="test/Components/fixture/templates/input.template" />
+   <install as="Components/fixture/templates/php.template" name="test/Components/fixture/templates/php.template" />
+   <install as="Components/fixture/templates/simple.template" name="test/Components/fixture/templates/simple.template" />
+   <install as="Components/fixture/templates/variables.template" name="test/Components/fixture/templates/variables.template" />
    <install as="Components/Integration/ComponentsTest.php" name="test/Components/Integration/ComponentsTest.php" />
    <install as="Components/Integration/Components/Module/CiSetupTest.php" name="test/Components/Integration/Components/Module/CiSetupTest.php" />
    <install as="Components/Integration/Components/Module/DependenciesTest.php" name="test/Components/Integration/Components/Module/DependenciesTest.php" />
index 06b9f5b..3186d80 100644 (file)
@@ -38,7 +38,7 @@ extends Components_TestCase
     public function testWrite()
     {
         $tdir =  $this->getTemporaryDirectory();
-        $templates = new Components_Helper_Templates(
+        $templates = new Components_Helper_Templates_Single(
             dirname(__FILE__) . '/../../../fixture/templates',
             $tdir,
             'simple',
@@ -51,7 +51,7 @@ extends Components_TestCase
     public function testSource()
     {
         $tdir =  $this->getTemporaryDirectory();
-        $templates = new Components_Helper_Templates(
+        $templates = new Components_Helper_Templates_Single(
             dirname(__FILE__) . '/../../../fixture/templates',
             $tdir,
             'simple',
@@ -70,13 +70,13 @@ extends Components_TestCase
     public function testMissingSource()
     {
         $source = dirname(__FILE__) . '/NO_SUCH_TEMPLATE';
-        $templates = new Components_Helper_Templates($source, '');
+        $templates = new Components_Helper_Templates_Single($source, '', '', '');
     }
 
     public function testVariables()
     {
         $tdir =  $this->getTemporaryDirectory();
-        $templates = new Components_Helper_Templates(
+        $templates = new Components_Helper_Templates_Single(
             dirname(__FILE__) . '/../../../fixture/templates',
             $tdir,
             'variables',
@@ -88,4 +88,66 @@ extends Components_TestCase
             file_get_contents($tdir . DIRECTORY_SEPARATOR . 'target')
         );
     }
+
+    public function testPrefix()
+    {
+        $tdir =  $this->getTemporaryDirectory();
+        $templates = new Components_Helper_Templates_Prefix(
+            dirname(__FILE__) . '/../../../fixture/templates',
+            $tdir,
+            'var',
+            'target'
+        );
+        $templates->write(array('1' => 'One', '2' => 'Two'));
+        $this->assertEquals(
+            "One : Two\n",
+            file_get_contents($tdir . DIRECTORY_SEPARATOR . 'target')
+        );
+    }
+
+    /**
+     * @expectedException Components_Exception
+     */
+    public function testMissingPrefixTemplate()
+    {
+        $tdir =  $this->getTemporaryDirectory();
+        $templates = new Components_Helper_Templates_Prefix(
+            dirname(__FILE__) . '/../../../fixture/templates',
+            $tdir,
+            'NOSUCHPREFIX',
+            'target'
+        );
+    }
+
+    public function testPhp()
+    {
+        $tdir =  $this->getTemporaryDirectory();
+        $templates = new Components_Helper_Templates_Single(
+            dirname(__FILE__) . '/../../../fixture/templates',
+            $tdir,
+            'php',
+            'target'
+        );
+        $templates->write();
+        $this->assertEquals(
+            "test",
+            file_get_contents($tdir . DIRECTORY_SEPARATOR . 'target')
+        );
+    }
+
+    public function testInput()
+    {
+        $tdir =  $this->getTemporaryDirectory();
+        $templates = new Components_Helper_Templates_Single(
+            dirname(__FILE__) . '/../../../fixture/templates',
+            $tdir,
+            'input',
+            'target'
+        );
+        $templates->write(array('input' => 'SOME INPUT'));
+        $this->assertEquals(
+            "SOME INPUT",
+            file_get_contents($tdir . DIRECTORY_SEPARATOR . 'target')
+        );
+    }
 }
\ No newline at end of file
diff --git a/components/test/Components/fixture/templates/input.template b/components/test/Components/fixture/templates/input.template
new file mode 100644 (file)
index 0000000..62df4da
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+
+echo $input;
diff --git a/components/test/Components/fixture/templates/php.template b/components/test/Components/fixture/templates/php.template
new file mode 100644 (file)
index 0000000..df960db
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+
+echo "test";
diff --git a/components/test/Components/fixture/templates/simple.template b/components/test/Components/fixture/templates/simple.template
new file mode 100644 (file)
index 0000000..19cf7ef
--- /dev/null
@@ -0,0 +1 @@
+SIMPLE
diff --git a/components/test/Components/fixture/templates/variables.template b/components/test/Components/fixture/templates/variables.template
new file mode 100644 (file)
index 0000000..9487371
--- /dev/null
@@ -0,0 +1 @@
+%1$s : %2$s