Skip to content

Commit

Permalink
Initialized variables and properties
Browse files Browse the repository at this point in the history
  • Loading branch information
tedivm committed May 11, 2014
1 parent 0a5cf10 commit 718a587
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Stash/Driver/Apc.php
Expand Up @@ -25,6 +25,7 @@ class Apc implements DriverInterface
{
protected $ttl = 300;
protected $apcNamespace;
protected $chunkSize = 100;

/**
* This function should takes an array which is used to pass option values to the driver.
Expand Down Expand Up @@ -68,7 +69,7 @@ public function __destruct()
public function getData($key)
{
$keyString = self::makeKey($key);

$success = null;
$data = apc_fetch($keyString, $success);

return $success ? $data : false;
Expand Down Expand Up @@ -127,6 +128,7 @@ public function purge()
$chunkSize = isset($this->chunkSize) && is_numeric($this->chunkSize) ? $this->chunkSize : 100;
$it = new \APCIterator('user', $keyRegex, \APC_ITER_KEY, $chunkSize);
foreach ($it as $key) {
$success = null;
$data = apc_fetch($key, $success);
$data = $data[$key['key']];

Expand Down
4 changes: 2 additions & 2 deletions src/Stash/Driver/FileSystem.php
Expand Up @@ -63,7 +63,7 @@ class FileSystem implements DriverInterface
protected $filePermissions;
protected $dirPermissions;
protected $directorySplit;

protected $keyHashFunction;
protected $disabled = false;

protected $defaultOptions = array('filePermissions' => 0660,
Expand Down Expand Up @@ -146,7 +146,7 @@ protected static function getDataFromFile($path)
// possible that the item exists as null, so we have to make sure that
// it's both unset and not null. The downside to this is that the
// is_null function will issue a warning on an item that isn't set.
// So we're stuck testing and surpressing the warning.
// So we're stuck testing and suppressing the warning.

// Item exists
// isset + is_null = true + false = true
Expand Down
2 changes: 2 additions & 0 deletions src/Stash/Driver/Memcache.php
Expand Up @@ -144,6 +144,8 @@ protected function makeKeyString($key, $path = false)
$key = \Stash\Utilities::normalizeKeys($key);

$keyString = 'cache:::';
$pathKey = ':pathdb::';

foreach ($key as $name) {
//a. cache:::name
//b. cache:::name0:::sub
Expand Down
1 change: 1 addition & 0 deletions src/Stash/Driver/Redis.php
Expand Up @@ -188,6 +188,7 @@ protected function makeKeyString($key, $path = false)
$key = \Stash\Utilities::normalizeKeys($key);

$keyString = 'cache:::';
$pathKey = ':pathdb::';
foreach ($key as $name) {
//a. cache:::name
//b. cache:::name0:::sub
Expand Down
1 change: 1 addition & 0 deletions src/Stash/Driver/Sub/Memcached.php
Expand Up @@ -147,6 +147,7 @@ public function get($key)

public function cas($key, $value)
{
$token = null;
if (($rValue = $this->memcached->get($key, null, $token)) !== false) {
return $rValue;
}
Expand Down

0 comments on commit 718a587

Please sign in to comment.