当前位置: 首页>>代码示例>>PHP>>正文


PHP accelerator_license_info函数代码示例

本文整理汇总了PHP中accelerator_license_info函数的典型用法代码示例。如果您正苦于以下问题:PHP accelerator_license_info函数的具体用法?PHP accelerator_license_info怎么用?PHP accelerator_license_info使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了accelerator_license_info函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor
  * Validate that the Zend Platform is loaded and licensed
  *
  * @param array $options associative array of options
  */
 public function __construct($options = array())
 {
     if (!function_exists('accelerator_license_info')) {
         Zend_Cache::throwException('The Zend Platform extension must be loaded for using this backend !');
     }
     if (!function_exists('accelerator_get_configuration')) {
         $licenseInfo = accelerator_license_info();
         Zend_Cache::throwException('The Zend Platform extension is not loaded correctly: ' . $licenseInfo['failure_reason']);
     }
     $accConf = accelerator_get_configuration();
     if (@(!$accConf['output_cache_licensed'])) {
         Zend_Cache::throwException('The Zend Platform extension does not have the proper license to use content caching features');
     }
     if (@(!$accConf['output_cache_enabled'])) {
         Zend_Cache::throwException('The Zend Platform content caching feature must be enabled for using this backend, set the \'zend_accelerator.output_cache_enabled\' directive to On !');
     }
     if (!is_writable($accConf['output_cache_dir'])) {
         Zend_Cache::throwException('The cache copies directory \'' . ini_get('zend_accelerator.output_cache_dir') . '\' must be writable !');
     }
     if (!is_array($options)) {
         Zend_Cache::throwException('Options parameter must be an array');
     }
     while (list($name, $value) = each($options)) {
         $this->setOption($name, $value);
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:32,代码来源:ZendPlatform.php

示例2: zendPlatformAvailable

 /**
  * Check if Zend Platform is available and good to go.
  *
  * @return bool
  */
 protected function zendPlatformAvailable()
 {
     if (!function_exists('accelerator_license_info')) {
         Tools::atkdebug('Zend Platform was not detected');
         return false;
     }
     if (!function_exists('accelerator_get_configuration')) {
         $licenseInfo = accelerator_license_info();
         Tools::atkdebug('The Zend Platform extension is not loaded correctly: ' . $licenseInfo['failure_reason']);
         return false;
     }
     if (!function_exists('monitor_custom_event')) {
         Tools::atkdebug('Zend Platform seems to be there, but the function \'monitor_custom_event\' could not be found');
         return false;
     }
     return true;
 }
开发者ID:sintattica,项目名称:atk,代码行数:22,代码来源:ZendPlatformErrorHandler.php

示例3: __construct

 /**
  * Validate that the Zend Platform is loaded and licensed.
  *
  * @param   array  $parameters    Parameters.
  * @return  void
  * @throws  \Hoa\Cache\Exception
  */
 public function __construct(array $parameters = [])
 {
     if (!function_exists('accelerator_license_info')) {
         throw new Cache\Exception('The Zend Platform extension must be loaded to use this backend.', 0);
     }
     if (!function_exists('accelerator_get_configuration')) {
         $licenseInfos = accelerator_license_info();
         throw new Cache\Exception('The Zend Platform extension is not loaded correctly: %s.', 1, $licenseInfos['failure_reason']);
     }
     $configurations = accelerator_get_configuration();
     if (@(!$configurations['output_cache_licensed'])) {
         throw new Cache\Exception('The Zend Platform extension does not have the proper license ' . 'to use content caching features.', 2);
     }
     if (@(!$configurations['output_cache_enabled'])) {
         throw new Cache\Exception('The Zend Platform content caching feature must be enabled to ' . 'use this backend, set the ' . 'zend_accelerator.output_cache_enabled directive to on.', 3);
     }
     if (!is_writable($configuration['output_cache_dir'])) {
         throw new Cache\Exception('The cache copies directory %s must be writable.', 4, $configuration['output_cache_dir']);
     }
     parent::__construct($parameters);
     return;
 }
开发者ID:Jir4,项目名称:Cache,代码行数:29,代码来源:ZendPlatform.php


注:本文中的accelerator_license_info函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。