TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-16-2009, 12:19 PM   #41 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

I'm not really clear on the actual utility of this class. How would I go about echoing, for example, a config option called "site_name"?

Also is there any scope for adding in hierarchical configurations?
Salathe is offline  
Reply With Quote
Old 01-16-2009, 12:25 PM   #42 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
I'm not really clear on the actual utility of this class. How would I go about echoing, for example, a config option called "site_name"?

Also is there any scope for adding in hierarchical configurations?
PHP Code:

<?php

echo $configs->configinfo["site_name"];

?>
There is no scope for hierarchy for the configurations. Why?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 01-16-2009, 12:28 PM   #43 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

What do you mean with "scope for hierarchy for the configurations" ?
Just wondering
__________________
Tanax is offline  
Reply With Quote
Old 01-16-2009, 01:11 PM   #44 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

It just seems odd to me to have every single configuration option in a single layer. I'm not sure of VI's plans for this particular part of the project, perhaps a hierarchy simply isn't necessary. What sort of options is this intended to hold?
Salathe is offline  
Reply With Quote
Old 01-16-2009, 02:34 PM   #45 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

I think it's meant to hold site's configuration. Such as what layout(if we create more than 1 template), the site's name, how many images allowed per gallery, etc. Those kinds of options.
__________________
Tanax is offline  
Reply With Quote
Old 01-16-2009, 03:10 PM   #46 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
I'm not really clear on the actual utility of this class. How would I go about echoing, for example, a config option called "site_name"?
Tanax hit the nail on the head. The purpose is to hold configs for the script to use, users will be able to manage custom ones. So if you want the site name, it will be something like:
PHP Code:
echo $configs->configinfo["site_name"]["value"]; 
Quote:
Originally Posted by Salathe View Post
Also is there any scope for adding in hierarchical configurations?
Never really though of that, is there any particular reason it would be necessary?

Note: I already have a file for configs that the system will not be allowed to edit in core/hard_configs.php (stuff like DB details and system admins).
__________________

Village Idiot is offline  
Reply With Quote
Old 01-16-2009, 03:14 PM   #47 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Is the php code in your post above really correct? You can't know what the current value is of the site name, so how would that work if you change the site name and you hardcode a specific name into there?
__________________
Tanax is offline  
Reply With Quote
Old 01-16-2009, 03:17 PM   #48 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
Is the php code in your post above really correct? You can't know what the current value is of the site name, so how would that work if you change the site name and you hardcode a specific name into there?
What do you mean? The site name would not be a hard coded setting.
__________________

Village Idiot is offline  
Reply With Quote
Old 01-16-2009, 03:24 PM   #49 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Okey, but why:
['value'] ?
Would there be any other things with the site name? Or am I missing the point?
__________________
Tanax is offline  
Reply With Quote
Old 01-16-2009, 03:29 PM   #50 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
Okey, but why:
['value'] ?
Would there be any other things with the site name? Or am I missing the point?
That was going by older code, I missed his changes to that. There will be an ID and status with each config, but I may make that separate.
__________________

Village Idiot is offline  
Reply With Quote
Old 01-16-2009, 04:00 PM   #51 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Ah, I see!
__________________
Tanax is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] How to organize your classes | Part 1 Tanax Advanced PHP Programming 10 03-01-2009 10:08 PM
A Generic Singleton Base Class Theo Advanced PHP Programming 7 08-18-2008 02:25 AM
[Tutorial] Basic tutorial about class basics Tanax Absolute Beginners 14 07-24-2008 01:37 PM
PHP5 Classes A to Z Part 1 quantumkangaroo Advanced PHP Programming 11 04-01-2008 04:21 AM
Tutorial: PHP and OOP, a beginners guide Village Idiot Tips & Tricks 0 09-06-2007 04:23 PM


All times are GMT. The time now is 07:05 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design