phpAppScope

Application Scope for PHP

Developed by:

The Big Idea

PHP has no memory scope that persists across sessions and requests. This kind of shared/global memory is available in ColdFusion application server. A PHP version of the ColdFusion Fusebox 4 core files facilitated the need for a shared memory scope in PHP. This memory scope would exist across requests and sessions. The goals of the project are:

  1. A way to quickly access a shared memory scope
  2. An automated way to modify it as needed.

An included "cache" file was determined to be the best way to handle the first goal. For the second goal, automated modification, we developed a class to track variables in a named scope, and rewrite the cache file if the values of those variables had changed during processing of the request.

Implemenatation

This idea is implemented in two files, the cache file and the class file. The application scope is simply a big array, written out as PHP code line by line in the "cache" file. There is also the class file, for managing the modification of the cache file. The class file is the only file included in this release, and when it is run, it generates the cache file.

More information is provided in the README.txt file in the release.

File Releases