maintaining configuration differences between dev and live environments during deployment from SVN

后端 未结 4 732
陌清茗
陌清茗 2021-02-10 13:41

We use the ExpressionEngine CMS (php) to create websites. For each site, we set up a subversion repository and commit the EE installation as well as any custom templates, images

4条回答
  •  面向向阳花
    2021-02-10 14:21

    A lot of the configuration options could be dealt with by switching on $_SERVER['HTTP_HOST'].

    For example

    switch ($_SERVER['HTTP_HOST']) {
        case 'developement.domain.com':
            $api_key = "dev environment api key";
            break;
        default:
            $api_key = "live environment api key";
    }
    

    Then for .htaccess issues you can set an alternate .htaccess file in your vhost definition using the AccessFileName directive:

    
        ServerName sitename
        AccessFileName .htaccess-dev
    
    

提交回复
热议问题