From cdae6a151e5739d8b11c6b169f30a2f908cf3e66 Mon Sep 17 00:00:00 2001 From: Amit Dar Date: Sun, 12 Apr 2015 18:14:48 +0300 Subject: [PATCH] Added checks for zend_scm methods --- zray.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/zray.php b/zray.php index e52afd2..5f4cfc2 100644 --- a/zray.php +++ b/zray.php @@ -139,18 +139,25 @@ private function collectVersionData(&$storage) { $isLatest = ($isLatest) ? 'yes' : 'no'; if(function_exists('zend_shm_cache_store')) { - zend_shm_cache_store('ZF2_version_isLatest', $isLatest); + zend_shm_cache_store('ZF2_version_isLatest', $isLatest); zend_shm_cache_store('ZF2_version_latest', $latest); } } else { $latest = null; $isLatest = 'N/A'; - zend_shm_cache_store('ZF2_version_isLatest', $isLatest); - zend_shm_cache_store('ZF2_version_latest', $latest); + if(function_exists('zend_shm_cache_store')) { + zend_shm_cache_store('ZF2_version_isLatest', $isLatest); + zend_shm_cache_store('ZF2_version_latest', $latest); + } } } else { - $isLatest = zend_shm_cache_fetch('ZF2_version_isLatest'); - $latest = zend_shm_cache_fetch('ZF2_version_latest'); + if(function_exists('zend_shm_cache_fetch')) { + $isLatest = zend_shm_cache_fetch('ZF2_version_isLatest'); + $latest = zend_shm_cache_fetch('ZF2_version_latest'); + } else { + $latest = null; + $isLatest = 'N/A'; + } } $latest = ($latest === null) ? 'N/A' : $latest;