StubDriver.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  5. * Copyright 2005-2011, Cake Software Foundation, Inc. (https://cakefoundation.org)
  6. *
  7. * Licensed under The MIT License
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 5.0.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace TestApp\Database\Driver;
  16. use Cake\Database\Driver;
  17. use Cake\Database\DriverFeatureEnum;
  18. use Cake\Database\Schema\SchemaDialect;
  19. use Cake\Database\Schema\SqliteSchemaDialect;
  20. class StubDriver extends Driver
  21. {
  22. public function connect(): void
  23. {
  24. $this->pdo = $this->createPdo('', []);
  25. }
  26. public function enabled(): bool
  27. {
  28. return true;
  29. }
  30. public function disableForeignKeySQL(): string
  31. {
  32. return '';
  33. }
  34. public function enableForeignKeySQL(): string
  35. {
  36. return '';
  37. }
  38. public function schemaDialect(): SchemaDialect
  39. {
  40. return new SqliteSchemaDialect($this);
  41. }
  42. public function supports(DriverFeatureEnum $feature): bool
  43. {
  44. return true;
  45. }
  46. }