Home » HTML » HTML_Template_Flexy » Bug #7609
individual compilers required
Details
| Request #7609 | individual compilers required |
|---|---|
| Submitted | 2006-05-12 07:56 UTC |
| From | jan at motubo dot com |
| Assigned | alan_k |
| Status | Closed |
| Package | HTML_Template_Flexy |
| PHP Version | 5.1.4 |
| OS | Linux/Debian |
| Roadmaps | (Not assigned) |
Comments
[2006-05-12 07:56 UTC] jan at motubo dot com
Description:
------------
The only possibility to use an own compiler with HTML_Template_Flexy is to copy the compiler-file into the installation directory - this is unlovely (sometimes impossible), especially when installed by pear.
Possible solution: change HTML_Template_Flexy_Compiler::factory(). Currently the option-array contains just a string with the compiler name. This could also be an object -> my own compiler-object:
function factory($options)
{
if (empty($options['compiler'])) {
$options['compiler'] = 'Flexy';
}
if ( $options['compiler'] instanceof HTML_Template_Flexy_CompilerInterface ) {
$options['compiler']->options = $options;
return $options['compiler'];
} else {
require_once 'HTML/Template/Flexy/Compiler/'.ucfirst( $options['compiler'] ) .'.php';
$class = 'HTML_Template_Flexy_Compiler_'.$options['compiler'];
$ret = new $class;
$ret->options = $options;
return $ret;
}
}
Where HTML_Template_Flexy_CompilerInterface is provided by Flexy and has to be implemented by the custom compiler. It ensures that all required method are present.
Please implement that solution or any other one which provides similar result - i need it.
Thank you!
[2006-05-12 08:31 UTC] jan at motubo dot com
Sounds great to me. I will patch my installation manually and wait for the next release, when this feature is "officially implemented", wont't it?
[2006-05-15 11:02 UTC] jan at motubo dot com
Build it in, but there were notices. I also patched file HTML/Template/Flexy.php in line 320:
...
if ( ! is_object( $this->options['compiler'] ) && $this->options['compiler'] == 'Raw') {
...