View previous topic :: View next topic |
Author |
Message |
atu Smarty Regular
Joined: 18 Apr 2003 Posts: 51 Location: Luxembourg
|
Posted: Wed Aug 13, 2003 3:49 pm Post subject: config_load section problem in 2.6 rc1 |
|
|
Is it possible that the build in function config_load ignore the section var? |
|
Back to top |
|
atu Smarty Regular
Joined: 18 Apr 2003 Posts: 51 Location: Luxembourg
|
Posted: Wed Aug 13, 2003 4:07 pm Post subject: config_load and force_compile |
|
|
In Smarty 2.6 rc1 config_load works on different sections only if force_compile was done. This was not necessairy in 2.5 .
Is this a new feature? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Aug 13, 2003 4:21 pm Post subject: Re: config_load and force_compile |
|
|
atu wrote: | Is this a new feature? |
i'm not an expert on config-files, but i guess not .
if you like can you test this? change line 66 in libs/plugins/function.config_load.php
from
[php:1:586f87b7b8]$_file_path = $_config_dir . DIRECTORY_SEPARATOR . $_file;[/php:1:586f87b7b8]
to
[php:1:586f87b7b8]$_file_path = $_config_dir . DIRECTORY_SEPARATOR . ( (isset($_section)) ? $_section. DIRECTORY_SEPARATOR : '' ) . $_file;[/php:1:586f87b7b8]
and check if this cures the problem.
greetings
messju |
|
Back to top |
|
atu Smarty Regular
Joined: 18 Apr 2003 Posts: 51 Location: Luxembourg
|
Posted: Wed Aug 13, 2003 4:41 pm Post subject: file_path |
|
|
Quote: | $_file_path = $_config_dir . DIRECTORY_SEPARATOR . ( (isset($_section)) ? $_section. DIRECTORY_SEPARATOR : '' ) . $_file; |
No this dosent work.
What file_path has to do with sections in config files? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Aug 13, 2003 4:57 pm Post subject: |
|
|
hmm, it worked for me *shrug*.
it's the path of the file where the parsed config-data is stored (cached). the same file is used for different sections and this doesn't work of course (they overwrite each other with force_compile=true, which makes it appear to work). i think this is the source of the buggy behaviour you reported. |
|
Back to top |
|
atu Smarty Regular
Joined: 18 Apr 2003 Posts: 51 Location: Luxembourg
|
Posted: Wed Aug 13, 2003 5:12 pm Post subject: config_load |
|
|
I use multiple config files which are distributed in differnt modul directories. So I set the config_dir to my root directory and add the rest of the path to each config file in config_load.
Ex.:
if (!defined('_BASE_DIR'))
define('_BASE_DIR', dirname(__FILE__));
$smarty->config_dir = _BASE_DIR.'/';
{config_load file="modulex/configs/lang.conf" section=$language scope="global"}
I guess the problem come from there. But it works in 2.5 |
|
Back to top |
|
Budda Smarty Regular
Joined: 19 Apr 2003 Posts: 53 Location: Lymm, Cheshire. UK
|
Posted: Wed Aug 13, 2003 10:52 pm Post subject: |
|
|
Atu, i do the same with my config file paths. And in 2.6rc1 i'm getting serious problems as i reported in a seperate thread.
Everything works fine in 2.5 though. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Aug 13, 2003 11:05 pm Post subject: |
|
|
yes, there are some glitches with config-file-handling in 2.6.0-RC1 . a fix is under way. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Aug 14, 2003 11:06 am Post subject: |
|
|
i committed a fix (thanks to atu for finding the bug and help me testing). for people who don't want to tamper with cvs, here is the current version.
@budda: this does not affect the problem with "cannot load resource..." on windows that you reported in another thread, yet. but this is also a bug that will be targetted soon.
if there are still any problems with the above version, don't hesitate to report it here.
greetings
messju
Last edited by messju on Thu Aug 14, 2003 11:18 am; edited 1 time in total |
|
Back to top |
|
Budda Smarty Regular
Joined: 19 Apr 2003 Posts: 53 Location: Lymm, Cheshire. UK
|
Posted: Thu Aug 14, 2003 11:18 am Post subject: |
|
|
Thanks for working on the fixes so promptly. Look forward to testing the next update, soon? |
|
Back to top |
|
|