PHP尝试捕获不使用Zend缓存异常

时间:2013-10-02 12:52:39

标签: php zend-framework zend-cache

我有这个代码来启动 Zend Cache ,并设置尝试缓存异常以取消Zend Cache,如果在此过程中出现错误,但它不起作用并且不会在catch异常中打印错误。

$frontendOptions = array(
          'lifetime' => $cacheTime,
          'content_type_memorization' => false,
          'default_options' => array(
              'cache' => true,
              'make_id_with_cookie_variables' => false,
              'make_id_with_session_variables' => false,
              'cache_with_get_variables' => true,
              'cache_with_post_variables' => true,
              'cache_with_session_variables' => true,
              'cache_with_files_variables' => true,
              'cache_with_cookie_variables' => true,
              'tags' => $cacheTag,
          ),
          'regexps' => array(
              '$' => array('cache' => true),
          )
      );

      $backendOptions = array('cache_dir' => '/var');
      $cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);
      try {
          $cache->start();
      } catch (Exception $exc) {
          echo $exc->getMessage();
      }

我尝试了 $ cache-> cancel()而没有任何结果。

由于

0 个答案:

没有答案