Skip to content

Commit

Permalink
[mms] Add Horde-specific prefix to filesystem cahe name to allow for …
Browse files Browse the repository at this point in the history
…easy identification.
  • Loading branch information
slusarz committed Jan 23, 2014
1 parent fe24776 commit 8e3db5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions framework/Autoloader_Cache/lib/Horde/Autoloader/Cache.php
Expand Up @@ -31,6 +31,9 @@ class Horde_Autoloader_Cache extends Horde_Autoloader_Default
const EACCELERATOR = 3;
const TEMPFILE = 4;

/* Cache key prefix. */
const PREFIX = 'horde_autoloader_cache';

/* Key that holds list of autoloader cache keys. */
const KEYLIST = 'horde_autoloader_keys';

Expand All @@ -46,7 +49,7 @@ class Horde_Autoloader_Cache extends Horde_Autoloader_Default
*
* @var string
*/
protected $_cachekey = 'horde_autoloader_cache';
protected $_cachekey = self::PREFIX;

/**
* The cache type.
Expand Down Expand Up @@ -104,7 +107,9 @@ public function __construct()
$this->_cachetype = self::EACCELERATOR;
} elseif (($tempdir = sys_get_temp_dir()) && is_readable($tempdir)) {
$this->_tempdir = $tempdir;
$this->_cachekey = hash('sha1', $this->_cachekey);
/* For files, add cachekey prefix for easy filesystem
* identification. */
$this->_cachekey = self::PREFIX . '_' . hash('sha1', $this->_cachekey);
if (($data = @file_get_contents($tempdir . '/' . $this->_cachekey)) === false) {
unlink($tempdir . '/' . $this->_cachekey);
}
Expand Down
4 changes: 2 additions & 2 deletions framework/Autoloader_Cache/package.xml
Expand Up @@ -27,7 +27,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Add Horde-specific prefix to filesystem cahe name to allow for easy identification.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -306,7 +306,7 @@
<date>2013-11-12</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [mms] Add Horde-specific prefix to filesystem cahe name to allow for easy identification.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 8e3db5e

Please sign in to comment.