質問

I'm looking for a way to store information and things like anonymous functions to let them be available across requests, similar to how $_SESSION stores things, but not tied to any particular request or session.

役に立ちましたか?

解決

You can store your data into:

  • Databases
  • Caches (e.g. memcached)
  • Files (not really recommended, you should prefer databases)

What exactly is your usecase? For persistent data storage you should use a database, for some temporary things caches (as long as you need no guarantee that the data will not be deleted sometime).

For storing anonymous functions you have to serialize them first. To do so, see https://github.com/jeremeamia/super_closure or http://www.htmlist.com/development/extending-php-5-3-closures-with-serialization-and-reflection/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top