|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
gencer Smarty Rookie
Joined: 03 Dec 2011 Posts: 5
|
Posted: Sat Dec 03, 2011 9:14 pm Post subject: Run encoded TPL files on Smarty 3.1x |
|
|
I can't see this patch (trick) around so im sharing it.
This is for "how to get work encoded tpl files on smarty 3.1".
1. Open sysplugins/smarty_internal_resource_file.php
2. Find this function: getContent (line: 62)
It looks like this:
Code: |
public function getContent(Smarty_Template_Source $source)
{
if ($source->timestamp) {
return file_get_contents($source->filepath);
}
if ($source instanceof Smarty_Config_Source) {
throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
}
throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
}
|
3. Replace this function with this one:
Code: |
public function getContent(Smarty_Template_Source $source)
{
if ($source->timestamp) {
if (function_exists('ioncube_read_file')) {
return ioncube_read_file($source->filepath);
} else {
return file_get_contents($source->filepath);
}
}
if ($source instanceof Smarty_Config_Source) {
throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
}
throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
}
|
4. Done.
Remember. Smarty and template file(s) must be encoded at the same time with same encoder settings. One smarty encoded file can't open other (unrelated) encoded tpl.
Regards. |
|
Back to top |
|
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Thu Dec 22, 2011 10:03 am Post subject: iconcube encoded templates but missing loader |
|
|
Thank you for your tricks.
IonCube is not generally available on all the servers. This may lead to an issue that your distributed templates are encoded, but the system does not have iconcube loader.
Cannot guess what happens next . When your deployment server is ready, go for encoded templates as you wish. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|