Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

config_load section problem in 2.6 rc1

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
atu
Smarty Regular


Joined: 18 Apr 2003
Posts: 51
Location: Luxembourg

PostPosted: Wed Aug 13, 2003 3:49 pm    Post subject: config_load section problem in 2.6 rc1 Reply with quote

Is it possible that the build in function config_load ignore the section var?
Back to top
View user's profile Send private message Visit poster's website
atu
Smarty Regular


Joined: 18 Apr 2003
Posts: 51
Location: Luxembourg

PostPosted: Wed Aug 13, 2003 4:07 pm    Post subject: config_load and force_compile Reply with quote

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
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Aug 13, 2003 4:21 pm    Post subject: Re: config_load and force_compile Reply with quote

atu wrote:
Is this a new feature?


i'm not an expert on config-files, but i guess not Smile .
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
View user's profile Send private message Send e-mail Visit poster's website
atu
Smarty Regular


Joined: 18 Apr 2003
Posts: 51
Location: Luxembourg

PostPosted: Wed Aug 13, 2003 4:41 pm    Post subject: file_path Reply with quote

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
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Aug 13, 2003 4:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
atu
Smarty Regular


Joined: 18 Apr 2003
Posts: 51
Location: Luxembourg

PostPosted: Wed Aug 13, 2003 5:12 pm    Post subject: config_load Reply with quote

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
View user's profile Send private message Visit poster's website
Budda
Smarty Regular


Joined: 19 Apr 2003
Posts: 53
Location: Lymm, Cheshire. UK

PostPosted: Wed Aug 13, 2003 10:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Aug 13, 2003 11:05 pm    Post subject: Reply with quote

yes, there are some glitches with config-file-handling in 2.6.0-RC1 . a fix is under way.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Aug 14, 2003 11:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Budda
Smarty Regular


Joined: 19 Apr 2003
Posts: 53
Location: Lymm, Cheshire. UK

PostPosted: Thu Aug 14, 2003 11:18 am    Post subject: Reply with quote

Thanks for working on the fixes so promptly. Look forward to testing the next update, soon? Cool
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP