1

I want store a variable shared between sessions (application-scope):

  1. It is not user session-specific (so I can't put it in $_SESSION[]).
  2. It is a long term storage (so I can't use APC - Alternative PHP Cache).

So, I use a file do store the variable and access it using file_get_contents and file_put_contents functions.

Is it a good way of proceeding or is there any alternative?

MatM
  • 128
  • 5

1 Answers1

0

It's clear your's is a global, server side issue. I would use a Database to do it. Just CRUD when needed.

You'rs may do the work, but I recommend the database approach, due to the enhanced capabilities that it provides like logging, checking the history of events. I think is a cleaner solution.

digitai
  • 1,870
  • 2
  • 20
  • 37