本文整理汇总了PHP中Zend\Cache\Storage\Capabilities::setNamespaceSeparator方法的典型用法代码示例。如果您正苦于以下问题:PHP Capabilities::setNamespaceSeparator方法的具体用法?PHP Capabilities::setNamespaceSeparator怎么用?PHP Capabilities::setNamespaceSeparator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Cache\Storage\Capabilities
的用法示例。
在下文中一共展示了Capabilities::setNamespaceSeparator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: internalGetCapabilities
/**
* Internal method to get capabilities of this adapter
*
* @return Capabilities
*/
protected function internalGetCapabilities()
{
if ($this->capabilities === null) {
$marker = new stdClass();
$options = $this->getOptions();
// detect metadata
$metadata = array('mtime', 'filespec');
if (!$options->getNoAtime()) {
$metadata[] = 'atime';
}
if (!$options->getNoCtime()) {
$metadata[] = 'ctime';
}
$capabilities = new Capabilities($this, $marker, array('supportedDatatypes' => array('NULL' => 'string', 'boolean' => 'string', 'integer' => 'string', 'double' => 'string', 'string' => true, 'array' => false, 'object' => false, 'resource' => false), 'supportedMetadata' => $metadata, 'minTtl' => 1, 'maxTtl' => 0, 'staticTtl' => false, 'ttlPrecision' => 1, 'expiredRead' => true, 'maxKeyLength' => 251, 'namespaceIsPrefix' => true, 'namespaceSeparator' => $options->getNamespaceSeparator()));
// update capabilities on change options
$this->getEventManager()->attach('option', function ($event) use($capabilities, $marker) {
$params = $event->getParams();
if (isset($params['namespace_separator'])) {
$capabilities->setNamespaceSeparator($marker, $params['namespace_separator']);
}
if (isset($params['no_atime']) || isset($params['no_ctime'])) {
$metadata = $capabilities->getSupportedMetadata();
if (isset($params['no_atime']) && !$params['no_atime']) {
$metadata[] = 'atime';
} elseif (isset($params['no_atime']) && ($index = array_search('atime', $metadata)) !== false) {
unset($metadata[$index]);
}
if (isset($params['no_ctime']) && !$params['no_ctime']) {
$metadata[] = 'ctime';
} elseif (isset($params['no_ctime']) && ($index = array_search('ctime', $metadata)) !== false) {
unset($metadata[$index]);
}
$capabilities->setSupportedMetadata($marker, $metadata);
}
});
$this->capabilityMarker = $marker;
$this->capabilities = $capabilities;
}
return $this->capabilities;
}
示例2: internalGetCapabilities
/**
* Internal method to get capabilities of this adapter
*
* @return Capabilities
*/
protected function internalGetCapabilities()
{
if ($this->capabilities === null) {
$marker = new stdClass();
$capabilities = new Capabilities($this, $marker, array('supportedDatatypes' => array('NULL' => true, 'boolean' => true, 'integer' => true, 'double' => true, 'string' => true, 'array' => true, 'object' => 'object', 'resource' => false), 'supportedMetadata' => array('internal_key', 'atime', 'ctime', 'mtime', 'rtime', 'size', 'hits', 'ttl'), 'minTtl' => 1, 'maxTtl' => 0, 'staticTtl' => true, 'ttlPrecision' => 1, 'useRequestTime' => (bool) ini_get('apc.use_request_time'), 'expiredRead' => false, 'maxKeyLength' => 5182, 'namespaceIsPrefix' => true, 'namespaceSeparator' => $this->getOptions()->getNamespaceSeparator()));
// update namespace separator on change option
$this->getEventManager()->attach('option', function ($event) use($capabilities, $marker) {
$params = $event->getParams();
if (isset($params['namespace_separator'])) {
$capabilities->setNamespaceSeparator($marker, $params['namespace_separator']);
}
});
$this->capabilities = $capabilities;
$this->capabilityMarker = $marker;
}
return $this->capabilities;
}
示例3: internalGetCapabilities
/**
* Internal method to get capabilities of this adapter
*
* @return Capabilities
*/
protected function internalGetCapabilities()
{
if ($this->capabilities === null) {
$marker = new stdClass();
$capabilities = new Capabilities($this, $marker, array('supportedDatatypes' => array('NULL' => 'string', 'boolean' => 'string', 'integer' => 'string', 'double' => 'string', 'string' => true, 'array' => false, 'object' => false, 'resource' => false), 'minTtl' => 0, 'supportedMetadata' => array(), 'maxKeyLength' => 0, 'namespaceIsPrefix' => true, 'namespaceSeparator' => $this->getOptions()->getNamespaceSeparator()));
// update namespace separator on change option
$this->getEventManager()->attach('option', function ($event) use($capabilities, $marker) {
$params = $event->getParams();
if (isset($params['namespace_separator'])) {
$capabilities->setNamespaceSeparator($marker, $params['namespace_separator']);
}
});
$this->capabilities = $capabilities;
$this->capabilityMarker = $marker;
}
return $this->capabilities;
}