Jump to content
LAPS

Is there a place where to put static data?

Recommended Posts

Hi there,

I have an array-list of static email addresses that I would like to use throughout all the system e.g. in PW hooks and templates.

Is there a system-efficient place where to put its statement e.g. in a file that doesn't load each time a page is requested?

Share this post


Link to post
Share on other sites

@Zeka thanks for pointing me out.

In which system-efficient place should the setting() function be stated?

Share this post


Link to post
Share on other sites

@Zeka

Files such as ready.php and _init.php do load each time a page is requested.

Since settings would not change over time I'm looking for a system-efficient place where to state those settings.

Share this post


Link to post
Share on other sites
17 hours ago, Zeka said:

You can use config.php if you preffer (API is not ready), but I would go with ready.php and setting().

I think @LAPS wants some place that does NOT load on every request. But all of your mentioned options do load on every request 😉 

How large is that list of E-Mails? 😮 If that is really too much for every request you can put it

  • In some file that you only include() when you need it
  • In a non-autoload module, that you request when needed (eg $modules->get('myemails')->getAll())
  • In a WireCache object that is stored in the Database
  • In a dedicated page + field (eg $pages->get(1234)->emailslist)
  • Like 5

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...