composer package updates
[openemr.git] / vendor / zendframework / zend-cache / src / Storage / Adapter / DbaOptions.php
blobac9aa0afb4aff948ebf9660c213f24a730d14362
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Cache\Storage\Adapter;
12 use Zend\Cache\Exception;
14 /**
15 * These are options specific to the APC adapter
17 class DbaOptions extends AdapterOptions
19 /**
20 * Namespace separator
22 * @var string
24 protected $namespaceSeparator = ':';
26 /**
27 * Pathname to the database file
29 * @var string
31 protected $pathname = '';
33 /**
34 * The mode to open the database
36 * @var string
38 protected $mode = 'c';
40 /**
41 * The name of the handler which shall be used for accessing the database.
43 * @var string
45 protected $handler = 'flatfile';
47 /**
48 * Set namespace separator
50 * @param string $namespaceSeparator
51 * @return DbaOptions Provides a fluent interface
53 public function setNamespaceSeparator($namespaceSeparator)
55 $namespaceSeparator = (string) $namespaceSeparator;
56 $this->triggerOptionEvent('namespace_separator', $namespaceSeparator);
57 $this->namespaceSeparator = $namespaceSeparator;
58 return $this;
61 /**
62 * Get namespace separator
64 * @return string
66 public function getNamespaceSeparator()
68 return $this->namespaceSeparator;
71 /**
72 * Set pathname to database file
74 * @param string $pathname
75 * @return DbaOptions Provides a fluent interface
77 public function setPathname($pathname)
79 $this->pathname = (string) $pathname;
80 $this->triggerOptionEvent('pathname', $pathname);
81 return $this;
84 /**
85 * Get pathname to database file
87 * @return string
89 public function getPathname()
91 return $this->pathname;
94 /**
97 * @param string $mode
98 * @return DbaOptions Provides a fluent interface
100 public function setMode($mode)
102 $this->mode = (string) $mode;
103 $this->triggerOptionEvent('mode', $mode);
104 return $this;
107 public function getMode()
109 return $this->mode;
115 * @param string $handler
116 * @return DbaOptions Provides a fluent interface
118 public function setHandler($handler)
120 $handler = (string) $handler;
122 if (! function_exists('dba_handlers') || ! in_array($handler, dba_handlers())) {
123 throw new Exception\ExtensionNotLoadedException("DBA-Handler '{$handler}' not supported");
126 if ($handler === 'inifile') {
127 throw new Exception\ExtensionNotLoadedException(
128 "DBA-Handler 'inifile' does not reliably support write operations"
132 $this->triggerOptionEvent('handler', $handler);
133 $this->handler = $handler;
134 return $this;
137 public function getHandler()
139 return $this->handler;