Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
Parse a data source name. More...
Parse a data source name.
phptype://username:password@hostspec/database_name phptype://username:password@hostspec phptype://username@hostspec phptype://hostspec/database phptype://hostspec phptype(dbsyntax) phptype
$dsn | string Data Source Name to be parsed |
array | an associative array with the following keys: |
phptype: Database backend used in PHP (mysql, odbc etc.) dbsyntax: Database used with regards to SQL syntax etc. protocol: Communication protocol to use (tcp, unix etc.) hostspec: Host specification (hostname[:port]) database: Database to use on the DBMS server username: User name for login password: Password for login
The format of the supplied DSN is in its fullest form:
phptype(dbsyntax)://username:password
Most variations are allowed:
phptype://username:password