Skip to content

igordutra/concrete5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Concrete5 for Azure Deploy to Azure

This repository contains a version of Concrete5 that can run on the Azure app service with both ClearDB and MySQL in-app. If you wish to use MySQL in-app, it is recommended to use Environment variables.

Add this code to application\config\database.php file in order to use environment variables and support MySQL in-app:

<?php

//Get Connection string
$connectstr_dbhost = '';
$connectstr_dbname = '';
$connectstr_dbusername = '';
$connectstr_dbpassword = '';
foreach ($_SERVER as $key => $value) {
    if (strpos($key, "MYSQLCONNSTR_") !== 0) {
        continue;
    }
    
    $connectstr_dbhost = preg_replace("/^.*Data Source=(.+?);.*$/", "\\1", $value);
    $connectstr_dbname = preg_replace("/^.*Database=(.+?);.*$/", "\\1", $value);
    $connectstr_dbusername = preg_replace("/^.*User Id=(.+?);.*$/", "\\1", $value);
    $connectstr_dbpassword = preg_replace("/^.*Password=(.+?)$/", "\\1", $value);
}

return array(
    'default-connection' => 'concrete',
    'connections' => array(
        'concrete' => array(
            'driver' => 'c5_pdo_mysql',
            'server' => $connectstr_dbhost,
            'database' => $connectstr_dbname,
            'username' => $connectstr_dbusername,
            'password' => $connectstr_dbpassword,
            'charset' => 'utf8',
        ),
    ),
); 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 82.1%
  • JavaScript 9.8%
  • CSS 5.9%
  • ActionScript 2.2%