1 | <?php |
||
10 | class MysqlInformationSchema extends Source\AbstractSchemaSource |
||
11 | { |
||
12 | /** |
||
13 | * Schema name |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $schema; |
||
18 | |||
19 | |||
20 | |||
21 | /** |
||
22 | * Whether to include full schema options like comment, collations... |
||
23 | * @var boolean |
||
24 | */ |
||
25 | protected $include_options = true; |
||
26 | |||
27 | /** |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected static $localCache = array(); |
||
32 | |||
33 | |||
34 | /** |
||
35 | * |
||
36 | * @var boolean |
||
37 | */ |
||
38 | protected $useLocalCaching = true; |
||
39 | |||
40 | /** |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected static $fullyCachedSchemas = array(); |
||
45 | |||
46 | |||
47 | /** |
||
48 | * |
||
49 | * @var Mysql\MysqlDriverInterface |
||
50 | */ |
||
51 | protected $driver; |
||
52 | |||
53 | /** |
||
54 | * Constructor |
||
55 | * |
||
56 | * @param \PDO|\mysqli|AdapterInterface $adapter |
||
57 | * @param string|null $schema default schema, taken from adapter if not given |
||
58 | * @throws Exception\InvalidArgumentException for invalid connection |
||
59 | * @throws Exception\InvalidUsageException thrown if no schema can be found. |
||
60 | */ |
||
61 | 23 | public function __construct($adapter, $schema = null) |
|
76 | |||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 1 | public function getUniqueKeys($table, $include_primary = false) |
|
97 | |||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | public function getIndexesInformation($table) |
||
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | 5 | public function getPrimaryKey($table) |
|
120 | |||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 10 | public function getPrimaryKeys($table) |
|
134 | |||
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | 3 | public function getColumnsInformation($table) |
|
144 | |||
145 | |||
146 | /** |
||
147 | * {@inheritdoc} |
||
148 | */ |
||
149 | 1 | public function getForeignKeys($table) |
|
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | 1 | public function getReferences($table) |
|
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | 3 | public function getTablesInformation() |
|
172 | |||
173 | /** |
||
174 | * Get a table configuration |
||
175 | * |
||
176 | * @throws Exception\ErrorException |
||
177 | * @throws Exception\TableNotFoundException |
||
178 | * |
||
179 | * @param string $table table name |
||
180 | * @param boolean|null $include_options include extended information |
||
181 | * @return ArrayObject |
||
182 | */ |
||
183 | 13 | protected function getTableConfig($table, $include_options = null) |
|
211 | |||
212 | |||
213 | /** |
||
214 | * Get schema configuration |
||
215 | * |
||
216 | * @throws Exception\ErrorException |
||
217 | * @throws Exception\SchemaNotFoundException |
||
218 | * |
||
219 | * @param boolean|null $include_options include extended information |
||
220 | * @return ArrayObject |
||
221 | */ |
||
222 | 5 | public function getSchemaConfig($include_options = null) |
|
242 | |||
243 | /** |
||
244 | * |
||
245 | * @param string $table |
||
246 | * @throws Exception\InvalidArgumentException |
||
247 | * @throws Exception\TableNotFoundException |
||
248 | * |
||
249 | */ |
||
250 | 16 | protected function loadCacheInformation($table = null) |
|
266 | |||
267 | /** |
||
268 | * Clear local cache information for the current schema |
||
269 | * |
||
270 | * @throws Exception\InvalidArgumentException |
||
271 | */ |
||
272 | 1 | public function clearCacheInformation() |
|
282 | } |
||
283 |