Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6158525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:58:17+00:00 2026-05-23T20:58:17+00:00

Was just wondering if anyone had a good system for storing / updating dynamic

  • 0

Was just wondering if anyone had a good system for storing / updating dynamic settings in php?

What i mean by dynamic is settings that change automatically by other scripts.

Currently we use a system that basically file_get_contents our settings php file, treats that as a string, changes settings and file_put_contents the updated settings.

It works but its a bit dirty. Any other recommendations where we can store / modify / pull these settings from? Mysql is NOT an option, we want to avoid the extra queries.

As an added bonus, some system that can share this data over multiple servers as many of these settings are used across multiple boxes. But i suppose we can deal with that seperatly.

Thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:58:18+00:00Added an answer on May 23, 2026 at 8:58 pm

    Things to keep in mind if you stick with a file-based approach:

    Using a native parser

    A parser written in C will most likely be quicker than one in PHP.
    The two options that spring to mind are

    Use a settings.php file, that contains well-formed PHP code. One approach I’ve used in the past is having a file that looks like

    <?php return
    array(
    'key' => 'value'
    );
    

    This file can be include-d one or more times, and the include statement will return the configuration array. When you’re writing the new settings, use var_export() to get valid php code.

    The other approach is using a settings.csv file. Read using fgetcsv(), write using fputcsv().

    Avoiding "partial" saves

    To avoid a partial file being read while the settings are being updated, first write the new settings to a temporary file, then move this file to the setting file location (preferrably using mv (1) on *nix).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is just a curiosity question I was wondering if anyone had a good
I was just wondering if anyone had any experience with more customized/specified theme rolling?
I'm just wondering if anyone has had any problems having too many subscribers for
Just wondering if anyone has some good resources for learning how to create new
I am just wondering if anyone know of some good tutorials on the Internet
I’m just wondering if anyone’s come across or could recommend an IDE that’s capable
Just wondering if anyone had a simple, efficient way of calculating the volume of
I'm just wondering if anyone else has had problems moving the Zend Framework from
I was just wondering if anyone had any success in getting XMLBeans (or any
Just wondering if anyone here has had success building GHC 7.2.1 on OpenSuSE. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.