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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:32:56+00:00 2026-06-08T14:32:56+00:00

The main script includes modules which add functionality to it. Each module is set

  • 0

The main script includes “modules” which add functionality to it. Each module is set up like this:

<?php
//data collection stuff
//(...) approx 80 lines of code
//end data collection
$var1 = 'some data';
$var2 = 'more data';
$var3 = 'other data';
?>

Each module has the same exact variables, just the data collection is different.

I was wondering if it’s a reasonable idea to store the module data in MySQL like this:

[database]
|_modules
  |_name
  |_function (the raw PHP data from above)
  |_description
  |_author
  |_update-url
  |_version
  |_enabled

…and then include the PHP-data from the database and execute it? Something like, a tab-navigation system at the top of the page for each module name, then inside each of those tabs the page content would function by parsing the database-stored code of the module from the function section.

The purpose would be to save code space (fewer lines), allow for easy updates, and include/exclude modules based on the enabled option. This is how many other web-apps work, some of my own too. But never had I thought about this so deeply. Are there any drawbacks or security risks to this?

  • 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-06-08T14:32:58+00:00Added an answer on June 8, 2026 at 2:32 pm

    For example MODx uses this approach. The PHP “snippets” and modules are stored in the database. Most of those PHP snippets just set some configuration values and afterwards include the main module code from files on the server.

    The main advantage is the flexibility in editing the module configuration as all modules may be edited in the backend of the CMS. On the other hand, WordPress also allows to edit the plugin-PHP-code from within the backend, but stores everything as files on the server, without storing PHP in the database.

    Well, not really an answer, but I think that is a matter of taste.

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

Sidebar

Related Questions

So, I've got this aspx page which includes 4 javascipt files like so: <script
This script saves the files as /home/name/main/all my files and stuff . I want
Say I have a PHP script, //main.php -> PID = 1002 <?php exec('ProcessOne'); exec('ProcessTwo');
I want to build a NSIS-script, which has three section section Main section Minor
I have a script that includes a config file (called accountsconfig.php) that contains a
--mainPage.php---- <div> <iframe>pageA.php</iframe> </div> <div> <iframe>pageB.php</iframe> </div> The main page includes the two iframes
Issue I want to call a Lua script which require() s lyaml module, Lua
Problem: $ clang++ -L../lib/osx/ -I../include/ -o test Script.cpp Main.cpp Verbose.cpp -llua -lUnitTest++ Undefined symbols
In my main script, I am doing some archive manipulation. Once I have completed
Let's assume I have a main script, main.py, that imports another python file with

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.