Issues

ZF-7384: CLONE -Detach Zend_Cache from Zend_Loader

Description

All ZF components should be loosly coupled and be able to be used alone without other components if possible.

Zend_Cache_Backend for example:


        // Create a default logger to the standard output stream
        Zend_Loader::loadClass('Zend_Log_Writer_Stream');

A simple require_once would be faster and would decouple it from Zend_Loader, which makes it possible to use Zend_Cache without Zend_Loader. There are a few other places in Zend_Cache where this should also be decoupled.

Comments

Method _isReadable in class Zend_Cache, reported in the issue ZF-2891

change to method Zend_Loader::isReadable

This issue was basically eliminated with 1.8.1. For that version, I scrubbed all classes that used Zend_Loader to have a check for "class_exists()" prior to falling back on Zend_Loader. This allows user-defined autoloading to be used, and only uses Zend_Loader in situations where nothing was defined during autoloading.

We will not use require_once instead, as this would lead to code duplication of the class => file resolution logic (a point that's particularly important as we start looking towards 2.0 and adopting the use of namespaces).