Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12373655
DefaultConfiguration.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
DefaultConfiguration.php
View Options
<?php
namespace
Nasqueron\SAAS\PhpBB\Config
;
class
DefaultConfiguration
{
///
/// Sites repository
///
public
static
function
getSqliteRepositoryFilename
()
:
string
{
return
getenv
(
"SAAS_SITES_DB"
);
}
///
/// MySQL database
///
public
static
function
getMySQLDatasourceName
()
:
string
{
$info
=
self
::
getMySQLConnectionInformation
();
return
"mysql:host=$info[host];port=$info[port];charset=utf8"
;
}
public
static
function
getMySQLConnectionInformation
()
:
array
{
// There are three scenarii we test to get information:
//
// 1. Explicit preferences given in environment or .env
// 2. MySQL Docker container linked with `--link phpbb_db:db`
// 3. MySQL development default configuration
return
[
'host'
=>
$_ENV
[
'DB_HOST'
]
??
$_ENV
[
'DB_PORT_3306_TCP_ADDR'
]
??
'localhost'
,
'port'
=>
$_ENV
[
'DB_PORT'
]
??
$_ENV
[
'DB_PORT_3306_TCP_PORT'
]
??
3306
,
'user'
=>
$_ENV
[
'DB_USER'
]
??
'root'
,
'pass'
=>
$_ENV
[
'DB_PASS'
]
??
$_ENV
[
'DB_ENV_MYSQL_ROOT_PASSWORD'
]
??
''
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 1, 18:09 (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3121709
Default Alt Text
DefaultConfiguration.php (1 KB)
Attached To
Mode
rSAASPHPBB saas-phpbb helper command
Attached
Detach File
Event Timeline
Log In to Comment