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

Conf functionality broken with Smarty 2.6.1

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
ryan
Smarty n00b


Joined: 13 Nov 2003
Posts: 4

PostPosted: Thu Jan 22, 2004 10:57 pm    Post subject: Conf functionality broken with Smarty 2.6.1 Reply with quote

up through Smarty 2.6.0, we would put the following in site.conf

# global variables
site_name = Jones website
MAX_FILE_SIZE=1048576

# hidden section
[.Database]
host=localhost
username=jones
password=paul
database=jonesDB

and we'd retrieve the DB info like this in our php file

$conf = new Config_File('./configs');

connect_db(
$conf->get('site.conf', 'Database', 'host'),
$conf->get('site.conf', 'Database', 'username'),
$conf->get('site.conf', 'Database', 'password'),
$conf->get('site.conf', 'Database', 'database')
);


With 2.6.1 this is now broken. The only way to get it to work is to change this to:

connect_db(
$conf->get('site.conf', '', 'host'),
$conf->get('site.conf', '', 'username'),
$conf->get('site.conf', '', 'password'),
$conf->get('site.conf', '', 'database')
);

Note that the site.conf file may _not_ have any sections other than the hidden [.Database] because therein lies some of the broken code.

Any ideas as to what is going on?

Thanks
Ryan
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Thu Jan 22, 2004 11:43 pm    Post subject: Re: Conf functionality broken with Smarty 2.6.1 Reply with quote

ryan wrote:
Any ideas as to what is going on?


You've found a bug. I am working on a fix. Thanks for your attention!
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 Jan 22, 2004 11:55 pm    Post subject: Reply with quote

It's fixed in CVS. Please test.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ryan
Smarty n00b


Joined: 13 Nov 2003
Posts: 4

PostPosted: Fri Jan 23, 2004 3:35 pm    Post subject: Reply with quote

works great! thanks for such a quick response!

you guys rock
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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