\CacheableConfig
- Author: Deviate Ltd 2014-2015 http://www.deviate.net.nz
Synopsis
class CacheableConfig
{
- // members
- private static string $default_mode = 'file';
- protected static string $current_mode = '';
- public static integer $ini_modified_memory_limit = 0;
- // methods
- public static void configure_memory_limit()
- public static boolean configure_memcached()
- public static boolean configure_memcache()
- public static boolean configure_file()
- public static boolean configure_apc()
- public static void configure()
- public static string current_cache_mode()
- public static boolean is_running_test()
- public static string cache_dir_path()
- public static boolean|string cache_dir_location()
- public static string cache_dir_name()
- private static void protect_cache_dir()
- public static void prevent_cache_dir_sync()
Tasks
Line | Task |
---|---|
320+ | Add unit tests to ensure exceptions are thrown in correct circumstances |
320+ | Move this into own class file |
354+ | Make generic: Check for Suhosin memory limit. Increase memory if current allocation < Suhosin allows |
Members
private
- $default_mode — string
protected
- $current_mode
—
string
Get us the current caching mode. Useful for debugging
public
- $ini_modified_memory_limit
—
int
Used for the new memory_limit value for display in arbitrary calling logic.
Methods
private
- protect_cache_dir() — Generate files appropriate to the host webserver for protecting access to the cache dir TTW. Only in use when using "File" backend via {@link self::configure_file()} and the userland `alt_cache_dir` config is present.
public
- cache_dir_location() — Return the URI relative-to, and including the "assets" folder.
- cache_dir_name() — Simply return the name of the bottom-level dir in which cache files will be stored.
- cache_dir_path() — Deal with userland alternate cache location for the "File" backend. This should always be relative to the assets dir for portability.
- configure()
- configure_apc()
- configure_file()
- configure_memcache()
- configure_memcached()
- configure_memory_limit() — On smaller setups, CWP being one; allow the module as much RAM as it can offer.
- current_cache_mode() — Returns the current cache mode.
- is_running_test() — SapphireTest::is_running_test() returns false at this point, and there is no Controller available either so we need an alternate way of detecting if tests are running.
- prevent_cache_dir_sync() — Update SilverStripe's understanding of the full range of "unsyncable" asset folder sub-dirs. Only called in the context of the "File" backend and if userland config setting exists for `alt_cache_dir`.