Skip to content
Browse files

Fixed typo in constant (BC)

  • Loading branch information...
1 parent f82e2e2 commit eec7544f6788dc28b2b8f18395c273bb65bfed7c @pborreli pborreli committed Mar 9, 2013
View
10 lib/Doctrine/Common/Cache/ApcCache.php
@@ -81,11 +81,11 @@ protected function doGetStats()
$sma = apc_sma_info();
return array(
- Cache::STATS_HITS => $info['num_hits'],
- Cache::STATS_MISSES => $info['num_misses'],
- Cache::STATS_UPTIME => $info['start_time'],
- Cache::STATS_MEMORY_USAGE => $info['mem_size'],
- Cache::STATS_MEMORY_AVAILIABLE => $sma['avail_mem'],
+ Cache::STATS_HITS => $info['num_hits'],
+ Cache::STATS_MISSES => $info['num_misses'],
+ Cache::STATS_UPTIME => $info['start_time'],
+ Cache::STATS_MEMORY_USAGE => $info['mem_size'],
+ Cache::STATS_MEMORY_AVAILABLE => $sma['avail_mem'],
);
}
}
View
14 lib/Doctrine/Common/Cache/Cache.php
@@ -32,10 +32,16 @@
*/
interface Cache
{
- const STATS_HITS = 'hits';
- const STATS_MISSES = 'misses';
- const STATS_UPTIME = 'uptime';
- const STATS_MEMORY_USAGE = 'memory_usage';
+ const STATS_HITS = 'hits';
+ const STATS_MISSES = 'misses';
+ const STATS_UPTIME = 'uptime';
+ const STATS_MEMORY_USAGE = 'memory_usage';
+ const STATS_MEMORY_AVAILABLE = 'memory_available';
+ /**
+ * Only for backward compatibility (may be removed in next major release)
+ *
+ * @deprecated
+ */
const STATS_MEMORY_AVAILIABLE = 'memory_available';
/**
View
4 lib/Doctrine/Common/Cache/CouchbaseCache.php
@@ -114,8 +114,8 @@ protected function doGetStats()
Cache::STATS_HITS => $stats['get_hits'],
Cache::STATS_MISSES => $stats['get_misses'],
Cache::STATS_UPTIME => $stats['uptime'],
- Cache::STATS_MEMORY_USAGE => $stats['bytes'],
- Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'],
+ Cache::STATS_MEMORY_USAGE => $stats['bytes'],
+ Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'],
);
}
}
View
4 lib/Doctrine/Common/Cache/MemcacheCache.php
@@ -114,8 +114,8 @@ protected function doGetStats()
Cache::STATS_HITS => $stats['get_hits'],
Cache::STATS_MISSES => $stats['get_misses'],
Cache::STATS_UPTIME => $stats['uptime'],
- Cache::STATS_MEMORY_USAGE => $stats['bytes'],
- Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'],
+ Cache::STATS_MEMORY_USAGE => $stats['bytes'],
+ Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'],
);
}
}
View
4 lib/Doctrine/Common/Cache/MemcachedCache.php
@@ -117,8 +117,8 @@ protected function doGetStats()
Cache::STATS_HITS => $stats['get_hits'],
Cache::STATS_MISSES => $stats['get_misses'],
Cache::STATS_UPTIME => $stats['uptime'],
- Cache::STATS_MEMORY_USAGE => $stats['bytes'],
- Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'],
+ Cache::STATS_MEMORY_USAGE => $stats['bytes'],
+ Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'],
);
}
}
View
6 lib/Doctrine/Common/Cache/RedisCache.php
@@ -81,7 +81,7 @@ protected function doSave($id, $data, $lifeTime = 0)
{
$result = $this->redis->set($id, $data);
if ($lifeTime > 0) {
- $this->redis->expire($id, $lifeTime);
+ $this->redis->expire($id, $lifeTime);
}
return $result;
}
@@ -112,8 +112,8 @@ protected function doGetStats()
Cache::STATS_HITS => false,
Cache::STATS_MISSES => false,
Cache::STATS_UPTIME => $info['uptime_in_seconds'],
- Cache::STATS_MEMORY_USAGE => $info['used_memory'],
- Cache::STATS_MEMORY_AVAILIABLE => false
+ Cache::STATS_MEMORY_USAGE => $info['used_memory'],
+ Cache::STATS_MEMORY_AVAILABLE => false
);
}
}
View
10 lib/Doctrine/Common/Cache/WinCacheCache.php
@@ -81,11 +81,11 @@ protected function doGetStats()
$meminfo = wincache_ucache_meminfo();
return array(
- Cache::STATS_HITS => $info['total_hit_count'],
- Cache::STATS_MISSES => $info['total_miss_count'],
- Cache::STATS_UPTIME => $info['total_cache_uptime'],
- Cache::STATS_MEMORY_USAGE => $meminfo['memory_total'],
- Cache::STATS_MEMORY_AVAILIABLE => $meminfo['memory_free'],
+ Cache::STATS_HITS => $info['total_hit_count'],
+ Cache::STATS_MISSES => $info['total_miss_count'],
+ Cache::STATS_UPTIME => $info['total_cache_uptime'],
+ Cache::STATS_MEMORY_USAGE => $meminfo['memory_total'],
+ Cache::STATS_MEMORY_AVAILABLE => $meminfo['memory_free'],
);
}
}
View
4 lib/Doctrine/Common/Cache/XcacheCache.php
@@ -102,8 +102,8 @@ protected function doGetStats()
Cache::STATS_HITS => $info['hits'],
Cache::STATS_MISSES => $info['misses'],
Cache::STATS_UPTIME => null,
- Cache::STATS_MEMORY_USAGE => $info['size'],
- Cache::STATS_MEMORY_AVAILIABLE => $info['avail'],
+ Cache::STATS_MEMORY_USAGE => $info['size'],
+ Cache::STATS_MEMORY_AVAILABLE => $info['avail'],
);
}
}
View
2 tests/Doctrine/Tests/Common/Cache/CacheTest.php
@@ -81,7 +81,7 @@ public function testGetStats()
$this->assertArrayHasKey(Cache::STATS_MISSES, $stats);
$this->assertArrayHasKey(Cache::STATS_UPTIME, $stats);
$this->assertArrayHasKey(Cache::STATS_MEMORY_USAGE, $stats);
- $this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILIABLE, $stats);
+ $this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILABLE, $stats);
}
/**

0 comments on commit eec7544

Please sign in to comment.
Something went wrong with that request. Please try again.