Back to CacheController class

Method addIncludePath

public static array
addIncludePath
(mixed $path = '')
Add a directory where Cache should search for controllers. You may either pass a string or an array of directories.
Parameters
  • array|string $path A path to search.
Returns
  • array An array with directory elements
Since
  • 1.7.0
Deprecated
  • 5.0

Method addIncludePath - Source code

/**
 * Add a directory where Cache should search for controllers. You may either pass a string or an array of directories.
 *
 * @param   array|string  $path  A path to search.
 *
 * @return  array  An array with directory elements
 *
 * @since       1.7.0
 * @deprecated  5.0 Use the cache controller factory instead
 */
public static function addIncludePath($path = '')
{
    static $paths;
    if (!isset($paths)) {
        $paths = array();
    }
    if (!empty($path) && !\in_array($path, $paths)) {
        // Only trigger a deprecation notice when adding a lookup path
        @trigger_error('Support for including cache controllers using path lookup is deprecated and will be removed in 5.0.' . ' Use a custom cache controller factory instead.', E_USER_DEPRECATED);
        array_unshift($paths, Path::clean($path));
    }
    return $paths;
}