문제

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