Skip to content

Instantly share code, notes, and snippets.

View zaidaldabbagh's full-sized avatar

Zaid Al-Dabbagh zaidaldabbagh

View GitHub Profile
@zaidaldabbagh
zaidaldabbagh / SilverStripe 3 on Heroku
Last active March 13, 2021 20:09 — forked from camfindlay/SilverStripe on Heroku
SilverStripe database setup on Heroku.
mysite/_config.php
<?php
// . . . config above
//Heroku ClearDB support
if(isset($_ENV['CLEARDB_DATABASE_URL'])) {
global $databaseConfig;
$parts = parse_url($_ENV['CLEARDB_DATABASE_URL']);
$databaseConfig['type'] = 'MySQLDatabase';
$databaseConfig['server'] = $parts['host'];
$databaseConfig['username'] = $parts['user'];