xPDO.parseDSN
Последнее обновление Oct 17th, 2026 | История страницы | Улучшить эту страницу | Сообщить о проблеме
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn morexPDO::parseDSN¶
Разбирает строку DSN для PDO в ассоциативный массив с ключами driver, host, database и charset. Это полезно, потому что некоторые методы xPDO, например xPDOManager::createSourceContainer(), ожидают разобранный массив, а не исходную строку DSN.
Синтаксис¶
array|null parseDSN (string $string)
Пример¶
$dsn = 'mysql:host=localhost;dbname=mydb;charset=utf8';
$parts = xPDO::parseDSN($dsn);
// array('driver' => 'mysql', 'host' => 'localhost',
// 'database' => 'mydb', 'charset' => 'utf8')
Смотрите также¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










