Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Передавать в конструктор DBWrapper не array, а DBConfig инстанс #3

Open
KarelWintersky opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@KarelWintersky
Copy link

Зачем?

self::$pdo = new DBWrapper([
            'database'  =>  config('DATABASE.DATABASE'),
            'username'  =>  config('DATABASE.USERNAME'),
            'password'  =>  config('DATABASE.PASSWORD'),
            'charset'   =>  "utf8mb4",
            'charset_collate'   =>  "utf8mb4_unicode_ci"
        ]);

Здесь проблема: ключи массива строго lowercase, а я хотел бы передать config('DATABASE') , там ключи uppercase.

Можно попробовать решить приведением... или

new DBConfig([])->setDatabase()->setUser()->setPassword()
@KarelWintersky KarelWintersky added the enhancement New feature or request label Jan 23, 2025
@KarelWintersky KarelWintersky self-assigned this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant