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 443293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:09:21+00:00 2026-05-12T21:09:21+00:00

I have a custom PHP framework and am discovering the joys of storing configuration

  • 0

I have a custom PHP framework and am discovering the joys of storing configuration settings as human-readable, simple XML.

I am very tempted to introduce XML (really simple XML, like this)

<mainmenu>
 <button action="back" label="Back"/>
 <button action="new" label="New item"/>
</mainmenu>

in a number of places in the framework. It is just so much more fun to read, maintain and extend. Until now, configuration was done using

name=value;name=value;name=value;

pairs, arrays, collections of variables, and so on.

However, I fear for the framework’s performance. While the individual XML operations amount to next to nothing in profiling, they are of course more expensive than a simple explode() on a big string. I feel uncomfortable with simpleXML (my library of choice) doing a full well-formedness check on a dozen of XML chunks every time the user loads a page.

I could cache the XML objects myself but would like to 1.) avoid the hassle and 2.) not add to the framework’s complexity.

I am therefore looking for an unobtrusive XML “caching” solution. The perfect thing would be a function that I can give a file path, and returns a parsed simpleXML object. Internally, it maintains a cache somewhere with serialized simpleXML objects or whatever.

Does anybody know tools to do this?

No extension-dependent solutions please, as the framework is designed to run in shared webhosting environments (which is the reason why performance matters).

  • 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-12T21:09:22+00:00Added an answer on May 12, 2026 at 9:09 pm

    You could transform the XML into your former format once and then check for modification time of the XML and the text file via filemtime. If XML is newer than the textfile, then do the transformation again.

    This would increase complexity in a way, but on the other hand would help you reuse your existing code. Of course, caching is another viable option.

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

Sidebar

Related Questions

I have a (custom) php framework that contains following structure: app |-classes |-settings core
I have a custom built application framework written in PHP which I have been
I have a custom-built MVC PHP framework that I am in the process of
I am creating a framework in PHP and need to have a few configuration
I have an existing, non-framework-based PHP/MySQL website. It has a simple security model, with
I have a custom PHP framework in which everything after the domain is sent
Given that I have a custom PHP error handler already, does it make sense
I have a custom error handler attached to E_ALL PHP errors. In an external
I have a load of php templates which uses a custom translate function __,
I have a minimum age custom validator which is straight forward enough: The constraint(Minage.php)

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.