#011181: ezcCacheManager::createCache requires a physical location

Description:

ezcCacheManager::createCache requires a physical location


<?php

public static function createCache( $id, $location, $storageClass, $options = array() ) 
{
        // Sanity check existance.
        if ( !file_exists( $location ) || !is_dir( $location ) ) 
        {
            throw new ezcBaseFileNotFoundException( $location, 'cache location', 'Does not exists or is no directory.' );
        }
        if ( !is_readable( $location ) )
        {
            throw new ezcBaseFilePermissionException( $location, ezcBaseFileException::READ, 'Cache location is not readable.' );
        }
        if ( !is_writeable( $location ) )
        {
            throw new ezcBaseFilePermissionException( $location, ezcBaseFileException::WRITE, 'Cache location is not writeable.' );
        }
...
?>

The location as a required attribute makes sense if it is a file-based cache. But in the case of a memory or database oriented cache mechanism, the requirement of a location is restrictive and useless.

It seems to make more sense that the location would be anothe key in the options array. It would also be sensible that the $options would be sanity checked relative to the $storageClass. Each storage class is likely to have it's own necessary options that would extend some default options. $location does not need to be a required option for an APC or Memcache based cache system.


Environment:

PHP Version: 5.2.3


- Attachments

No attachments for this issue.


- Comments

Fixed in rev. 6374. The $location parameter of the ezcCacheManager::createCache() method can be null for pure memory backends. The fix will be available in Cache 1.3alpha1.

#254014 by Alexandru Stanoi on October 5th, 2007 [Permanent Link]

- History
Properties
Type Bug
Priority Medium
Component Components » Cache
Affects Unknown
Fix Versions 1.3alpha1 - Cache 1.3alpha1
2007.2alpha1 - eZ components 2007.2alpha1
Reporter Grady Kuhnline
Responsible Alexandru Stanoi
Status 0 Closed
Resolution Fixed
Created July 26th, 2007
Updated October 5th, 2007
Resolved October 5th, 2007
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #015537
  Graph shows to small and truncated rotated axis labels