選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

35 行
772B

  1. <?php
  2. namespace Framework\Provider;
  3. use Framework\Database\Factory;
  4. use Framework\Database\Connection\MysqlConnection;
  5. use Framework\Database\Connection\SqliteConnection;
  6. use Framework\Support\DriverProvider;
  7. use Framework\Support\DriverFactory;
  8. class DatabaseProvider extends DriverProvider
  9. {
  10. protected function name(): string
  11. {
  12. return 'database';
  13. }
  14. protected function factory(): DriverFactory
  15. {
  16. return new Factory();
  17. }
  18. protected function drivers(): array
  19. {
  20. return [
  21. 'sqlite' => function($config) {
  22. return new SqliteConnection($config);
  23. },
  24. 'mysql' => function($config) {
  25. return new MysqlConnection($config);
  26. },
  27. ];
  28. }
  29. }

Powered by TurnKey Linux.