Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
factory.php
001 <?php
002 /**
003 *
004 * This file is part of the phpBB Forum Software package.
005 *
006 * @copyright (c) phpBB Limited <https://www.phpbb.com>
007 * @license GNU General Public License, version 2 (GPL-2.0)
008 *
009 * For full copyright and license information, please see
010 * the docs/CREDITS.txt file.
011 *
012 */
013
014 namespace phpbb\db\driver;
015
016 use Symfony\Component\DependencyInjection\ContainerInterface;
017
018 /**
019 * Database Abstraction Layer
020 */
021 class factory implements driver_interface
022 {
023 /**
024 * @var driver_interface
025 */
026 protected $driver = null;
027
028 /**
029 * @var ContainerInterface
030 */
031 protected $container;
032
033 /**
034 * Constructor.
035 *
036 * @param ContainerInterface $container A ContainerInterface instance
037 */
038 public function __construct(ContainerInterface $container)
039 {
040 $this->container = $container;
041 }
042
043 /**
044 * Return the current driver (and retrieved it from the container if necessary)
045 *
046 * @return driver_interface
047 */
048 protected function get_driver()
049 {
050 if ($this->driver === null)
051 {
052 $this->driver = $this->container->get('dbal.conn.driver');
053 }
054
055 return $this->driver;
056 }
057
058 /**
059 * Set the current driver
060 *
061 * @param driver_interface $driver
062 */
063 public function set_driver(driver_interface $driver)
064 {
065 $this->driver = $driver;
066 }
067
068 /**
069 * {@inheritdoc}
070 */
071 public function set_debug_load_time($value)
072 {
073 $this->get_driver()->set_debug_load_time($value);
074 }
075
076 /**
077 * {@inheritdoc}
078 */
079 public function set_debug_sql_explain($value)
080 {
081 $this->get_driver()->set_debug_sql_explain($value);
082 }
083
084 /**
085 * {@inheritdoc}
086 */
087 public function get_sql_layer()
088 {
089 return $this->get_driver()->get_sql_layer();
090 }
091
092 /**
093 * {@inheritdoc}
094 */
095 public function get_db_name()
096 {
097 return $this->get_driver()->get_db_name();
098 }
099
100 /**
101 * {@inheritdoc}
102 */
103 public function get_any_char()
104 {
105 return $this->get_driver()->get_any_char();
106 }
107
108 /**
109 * {@inheritdoc}
110 */
111 public function get_one_char()
112 {
113 return $this->get_driver()->get_one_char();
114 }
115
116 /**
117 * {@inheritdoc}
118 */
119 public function get_db_connect_id()
120 {
121 return $this->get_driver()->get_db_connect_id();
122 }
123
124 /**
125 * {@inheritdoc}
126 */
127 public function get_sql_error_triggered()
128 {
129 return $this->get_driver()->get_sql_error_triggered();
130 }
131
132 /**
133 * {@inheritdoc}
134 */
135 public function get_sql_error_sql()
136 {
137 return $this->get_driver()->get_sql_error_sql();
138 }
139
140 /**
141 * {@inheritdoc}
142 */
143 public function get_transaction()
144 {
145 return $this->get_driver()->get_transaction();
146 }
147
148 /**
149 * {@inheritdoc}
150 */
151 public function get_sql_time()
152 {
153 return $this->get_driver()->get_sql_time();
154 }
155
156 /**
157 * {@inheritdoc}
158 */
159 public function get_sql_error_returned()
160 {
161 return $this->get_driver()->get_sql_error_returned();
162 }
163
164 /**
165 * {@inheritdoc}
166 */
167 public function get_multi_insert()
168 {
169 return $this->get_driver()->get_multi_insert();
170 }
171
172 /**
173 * {@inheritdoc}
174 */
175 public function set_multi_insert($multi_insert)
176 {
177 $this->get_driver()->set_multi_insert($multi_insert);
178 }
179
180 /**
181 * {@inheritdoc}
182 */
183 public function get_row_count($table_name)
184 {
185 return $this->get_driver()->get_row_count($table_name);
186 }
187
188 /**
189 * {@inheritdoc}
190 */
191 public function get_estimated_row_count($table_name)
192 {
193 return $this->get_driver()->get_estimated_row_count($table_name);
194 }
195
196 /**
197 * {@inheritdoc}
198 */
199 public function sql_lower_text($column_name)
200 {
201 return $this->get_driver()->sql_lower_text($column_name);
202 }
203
204 /**
205 * {@inheritdoc}
206 */
207 public function sql_error($sql = '')
208 {
209 return $this->get_driver()->sql_error($sql);
210 }
211
212 /**
213 * {@inheritdoc}
214 */
215 public function sql_buffer_nested_transactions()
216 {
217 return $this->get_driver()->sql_buffer_nested_transactions();
218 }
219
220 /**
221 * {@inheritdoc}
222 */
223 public function sql_bit_or($column_name, $bit, $compare = '')
224 {
225 return $this->get_driver()->sql_bit_or($column_name, $bit, $compare);
226 }
227
228 /**
229 * {@inheritdoc}
230 */
231 public function sql_server_info($raw = false, $use_cache = true)
232 {
233 return $this->get_driver()->sql_server_info($raw, $use_cache);
234 }
235
236 /**
237 * {@inheritdoc}
238 */
239 public function sql_return_on_error($fail = false)
240 {
241 return $this->get_driver()->sql_return_on_error($fail);
242 }
243
244 /**
245 * {@inheritdoc}
246 */
247 public function sql_build_array($query, $assoc_ary = array())
248 {
249 return $this->get_driver()->sql_build_array($query, $assoc_ary);
250 }
251
252 /**
253 * {@inheritdoc}
254 */
255 public function sql_fetchrowset($query_id = false)
256 {
257 return $this->get_driver()->sql_fetchrowset($query_id);
258 }
259
260 /**
261 * {@inheritdoc}
262 */
263 public function sql_transaction($status = 'begin')
264 {
265 return $this->get_driver()->sql_transaction($status);
266 }
267
268 /**
269 * {@inheritdoc}
270 */
271 public function sql_concatenate($expr1, $expr2)
272 {
273 return $this->get_driver()->sql_concatenate($expr1, $expr2);
274 }
275
276 /**
277 * {@inheritdoc}
278 */
279 public function sql_case($condition, $action_true, $action_false = false)
280 {
281 return $this->get_driver()->sql_case($condition, $action_true, $action_false);
282 }
283
284 /**
285 * {@inheritdoc}
286 */
287 public function sql_build_query($query, $array)
288 {
289 return $this->get_driver()->sql_build_query($query, $array);
290 }
291
292 /**
293 * {@inheritdoc}
294 */
295 public function sql_fetchfield($field, $rownum = false, $query_id = false)
296 {
297 return $this->get_driver()->sql_fetchfield($field, $rownum, $query_id);
298 }
299
300 /**
301 * {@inheritdoc}
302 */
303 public function sql_fetchrow($query_id = false)
304 {
305 return $this->get_driver()->sql_fetchrow($query_id);
306 }
307
308 /**
309 * {@inheritdoc}
310 */
311 public function cast_expr_to_bigint($expression)
312 {
313 return $this->get_driver()->cast_expr_to_bigint($expression);
314 }
315
316 /**
317 * {@inheritdoc}
318 */
319 public function sql_nextid()
320 {
321 return $this->get_driver()->sql_last_inserted_id();
322 }
323
324 /**
325 * {@inheritdoc}
326 */
327 public function sql_last_inserted_id()
328 {
329 return $this->get_driver()->sql_last_inserted_id();
330 }
331
332 /**
333 * {@inheritdoc}
334 */
335 public function sql_add_num_queries($cached = false)
336 {
337 return $this->get_driver()->sql_add_num_queries($cached);
338 }
339
340 /**
341 * {@inheritdoc}
342 */
343 public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
344 {
345 return $this->get_driver()->sql_query_limit($query, $total, $offset, $cache_ttl);
346 }
347
348 /**
349 * {@inheritdoc}
350 */
351 public function sql_query($query = '', $cache_ttl = 0)
352 {
353 return $this->get_driver()->sql_query($query, $cache_ttl);
354 }
355
356 /**
357 * {@inheritdoc}
358 */
359 public function cast_expr_to_string($expression)
360 {
361 return $this->get_driver()->cast_expr_to_string($expression);
362 }
363
364 /**
365 * {@inheritdoc}
366 */
367 public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
368 {
369 throw new \Exception('Disabled method.');
370 }
371
372 /**
373 * {@inheritdoc}
374 */
375 public function sql_bit_and($column_name, $bit, $compare = '')
376 {
377 return $this->get_driver()->sql_bit_and($column_name, $bit, $compare);
378 }
379
380 /**
381 * {@inheritdoc}
382 */
383 public function sql_freeresult($query_id = false)
384 {
385 return $this->get_driver()->sql_freeresult($query_id);
386 }
387
388 /**
389 * {@inheritdoc}
390 */
391 public function sql_num_queries($cached = false)
392 {
393 return $this->get_driver()->sql_num_queries($cached);
394 }
395
396 /**
397 * {@inheritdoc}
398 */
399 public function sql_multi_insert($table, $sql_ary)
400 {
401 return $this->get_driver()->sql_multi_insert($table, $sql_ary);
402 }
403
404 /**
405 * {@inheritdoc}
406 */
407 public function sql_affectedrows()
408 {
409 return $this->get_driver()->sql_affectedrows();
410 }
411
412 /**
413 * {@inheritdoc}
414 */
415 public function sql_close()
416 {
417 return $this->get_driver()->sql_close();
418 }
419
420 /**
421 * {@inheritdoc}
422 */
423 public function sql_rowseek($rownum, &$query_id)
424 {
425 return $this->get_driver()->sql_rowseek($rownum, $query_id);
426 }
427
428 /**
429 * {@inheritdoc}
430 */
431 public function sql_escape($msg)
432 {
433 return $this->get_driver()->sql_escape($msg);
434 }
435
436 /**
437 * {@inheritdoc}
438 */
439 public function sql_like_expression($expression)
440 {
441 return $this->get_driver()->sql_like_expression($expression);
442 }
443
444 /**
445 * {@inheritdoc}
446 */
447 public function sql_not_like_expression($expression)
448 {
449 return $this->get_driver()->sql_not_like_expression($expression);
450 }
451
452 /**
453 * {@inheritdoc}
454 */
455 public function sql_report($mode, $query = '')
456 {
457 return $this->get_driver()->sql_report($mode, $query);
458 }
459
460 /**
461 * {@inheritdoc}
462 */
463 public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
464 {
465 return $this->get_driver()->sql_in_set($field, $array, $negate, $allow_empty_set);
466 }
467
468 /**
469 * {@inheritdoc}
470 */
471 public function sql_quote($msg)
472 {
473 return $this->get_driver()->sql_quote($msg);
474 }
475
476 /**
477 * {@inheritDoc}
478 */
479 public function clean_query_id($query_id)
480 {
481 return $this->get_driver()->clean_query_id($query_id);
482 }
483 }
484