本文整理汇总了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);
}
}
示例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;
}
示例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;
}