Jump to content

Recommended Posts

I'm making a config file for a quite big "program" I'm making.

 

With the config i want to set some variables and functions that i just can include whenever i need them.

Can I in some way just include one part of the config file insted of the whole thing?

 

I have just started to make it and to use it so it isn't that big yet but as I develop the config file will be quite big and it is useless for the users to process all the info that is not needed for that exact page.

Link to comment
https://forums.phpfreaks.com/topic/152858-config-file/
Share on other sites

You can't just include parts of a single file. I'd recommend breaking the file up into smaller files that you can include as and when you want.

 

For example,

 

/config/db.php = All the database configuration variables and functions

/config/user.php = All the user specific configuration variables and functions

etc.

Link to comment
https://forums.phpfreaks.com/topic/152858-config-file/#findComment-802760
Share on other sites

But if u got some good coding skills ya can make it a bit more dynamic.

I have built several module loaders, based on my needs.

 

One module loader, which is the root of the site, just processes pages based on the pages db entry.

 

A Simple module loader, I wrote for QuickPHP (Lightweight web server primarily for testing/debugging php). processed modules and the global

environment variables, as well as providing a log for.

 

but its all about wut u need, and how u wish to load the modules.

As phil said, its all about seperating the different pieces, than either load them manually, or develop a system for loading the pieces.

Link to comment
https://forums.phpfreaks.com/topic/152858-config-file/#findComment-802786
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.