We use APC as the operation cache code. Is there a way to force APC to cache file non-existence? We installed apc.stat = 0and apc.include_once_override = 1. Is there anything else to improve call performance include_oncein a file that might not be on the file system? If it is present, we obviously want to enable it. However, if it is not there, it will never be present, and we do not want PHP to call open()the file on every request to check.
For some background: we have one base site, but it provides settings for the site on a "client-client" basis. Some clients have a custom login page, others have unique pages, etc.
We use the Zend Framework in a somewhat unusual way to allow us to redefine controllers as needed. There may be a controller on our site called under the name LoginControllerdefined in the file controllers/LoginController.php. However, our “Company” client may have a requirement for a custom login page, so we will write a new class called Company_LoginControllerin the directory controllers/company/LoginController.php. (This naming convention allows us to conform to the concept of “modules” of the Zend Framework.)
When we deal with a class, we basically do something like this:
include_once APPLICATION_PATH . '/controllers/company/LoginController.php';
if (class_exists("Company_LoginController")) {
echo 'customer-specific controller exists';
} else {
include_once APPLICATION_PATH . '/controllers/LoginController.php';
echo 'customer-specific controller does not exist; using default';
}
/controllers/company/LoginController.php , APC . , /controllers/company/LoginController.php , , APC . ?
Rob Crowell