View previous topic :: View next topic |
Author |
Message |
httpete Smarty Rookie
Joined: 05 Dec 2009 Posts: 27
|
Posted: Wed Mar 17, 2010 3:46 pm Post subject: cooking in production |
|
|
Beta 8 is working on our production app, with thousands of lines of old smarty 2 syntax, just fine. Thanks guys, I think this is close. People notice it is faster. |
|
Back to top |
|
legende Smarty n00b
Joined: 17 Jan 2010 Posts: 3
|
Posted: Sat Mar 20, 2010 5:22 pm Post subject: |
|
|
Please add functionality to assign separate cache_id for include files
{include file=... cache_lifetime=300 cache_id=$mycacheid} |
|
Back to top |
|
rustybucket Smarty Regular
Joined: 28 Jan 2009 Posts: 60
|
Posted: Wed Mar 24, 2010 3:37 pm Post subject: 3 Documentation |
|
|
I may have missed it, but is there a documentation section for the Beta?
I did find the README file and it helped but was just wondering if there was a section on documentation I was missing?
Thanks! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Mar 24, 2010 4:06 pm Post subject: |
|
|
no documentation yet. |
|
Back to top |
|
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Thu Mar 25, 2010 6:09 pm Post subject: smarty variable in argument is supposed to be reference? |
|
|
See 2 post below... I got this all wrong.
(In case, someone misunderstand the same thing)
$smarty->register->templateFunction("func1");
function func1($args, &$smarty) {
}
This cause
"Warning: Parameter 2 to func1 expected to be a reference, value given in xxxxxxxxxxxxxxxx.php on line yy"
smarty variable in argument is supposed to be reference, isn't it?
I fixed this error by...
Mass replace
,\$_smarty_tpl->smarty
with
,&\$_smarty_tpl->smarty
Replace Result
smarty3\sysplugins\smarty_internal_compile_insert.php, 2
smarty3\sysplugins\smarty_internal_compile_private_function_plugin.php, 2
smarty3\sysplugins\smarty_internal_compile_private_object_function.php, 1
smarty3\sysplugins\smarty_internal_compile_private_registered_function.php, 3
8 items replaced in 4 files.
Last edited by vorapoap on Fri Mar 26, 2010 1:57 pm; edited 1 time in total |
|
Back to top |
|
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Fri Mar 26, 2010 1:51 pm Post subject: From README... |
|
|
Quote: |
PLUGINS
=======
Smarty3 are following the same coding rules as in Smarty2.
The only difference is that the template object is passed as additional third parameter.
smarty_plugintype_name (array $params, object $smarty, object $template)
The Smarty 2 plugins are still compatible as long as they do not make use of specific Smarty2 internals.
|
Do I understand something wrong?
$smarty object doesn't need to be a reference anymore? |
|
Back to top |
|
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Fri Mar 26, 2010 1:56 pm Post subject: |
|
|
OK.. I know now..
Object in PHP5 is always passed by reference
Sorry for this confusion. |
|
Back to top |
|
cferry Smarty Rookie
Joined: 17 Jun 2009 Posts: 9
|
Posted: Mon Mar 29, 2010 7:47 am Post subject: |
|
|
Ok, for Objet but what about Array ? is it passed by reference too ?
in $smarty->assign() for exemple. (assign_by_ref was replaced by assignByRef in smarty 3.0b8) |
|
Back to top |
|
cferry Smarty Rookie
Joined: 17 Jun 2009 Posts: 9
|
Posted: Thu Apr 01, 2010 9:56 am Post subject: |
|
|
Hello,
Before include, test file_exists($this->getCompiledFilepath ());
to prevent PHP Warning.
File : libs/sysplugins/smarty_internal_template.php
407 : } else {
408 : include($this->getCompiledFilepath ());
409 : // check file dependencies at compiled code
410 : if ($this->smarty->compile_check) {
Cédric |
|
Back to top |
|
ridersonthestorm Smarty n00b
Joined: 03 Apr 2010 Posts: 1
|
Posted: Sat Apr 03, 2010 7:08 pm Post subject: |
|
|
I get the message that Smarty can't write to "templates_c". But templates_c has the rights: 777. What's wrong?
It works fine with Smarty stable version. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Apr 04, 2010 2:51 pm Post subject: |
|
|
cferry wrote: | Hello,
Before include, test file_exists($this->getCompiledFilepath ());
to prevent PHP Warning.
File : libs/sysplugins/smarty_internal_template.php
407 : } else {
408 : include($this->getCompiledFilepath ());
409 : // check file dependencies at compiled code
410 : if ($this->smarty->compile_check) {
Cédric |
Cedric have you seen this warning? Normally the code can't get there if the file does not exists. |
|
Back to top |
|
yannickl88 Smarty n00b
Joined: 19 Apr 2010 Posts: 2
|
Posted: Mon Apr 19, 2010 8:26 pm Post subject: |
|
|
I still get a notice from within the smarty components.
Code: | function call 'register_resource' is unknown or deprecated. '\libs\smarty\sysplugins\smarty_internal_wrapper.php' @line 57 |
Love the new Smarty3 btw, I have it currently in my CMS, and it just works that much better. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Apr 21, 2010 3:06 pm Post subject: |
|
|
See the README file.
$smarty->register->resource($resource_type, $function_names) |
|
Back to top |
|
yannickl88 Smarty n00b
Joined: 19 Apr 2010 Posts: 2
|
Posted: Wed Apr 21, 2010 3:48 pm Post subject: |
|
|
ah yes, I must have missed a function call somewhere.
Thanks |
|
Back to top |
|
Hoover5555 Smarty Rookie
Joined: 25 Apr 2010 Posts: 7
|
Posted: Sun Apr 25, 2010 7:47 pm Post subject: |
|
|
Deleting a single cached page doesn't work
this command
$smarty->display('index.tpl', '123_1');
produces a valid cache file in the cache directory
123_1^90093ad09988b466f409a1871733c5589014713e.index.tpl.php
If I want to kill it (e.g. before expiration) then it won't get deleted
$smarty->cache->clear('index.tpl', '123_1');
However:
$smarty->cache->clearAll();
wipes the entire cache directory correctly. |
|
Back to top |
|
|