ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Problem encountered saving templates as file and using Subversion to manage multiple environments

August 01, 2011 1:14am

Subscribe [2]
  • #1 / Aug 01, 2011 1:14am

    truthnews

    37 posts

    I am currently using EE2.1.3 - having recently upgraded from 1.6.8.

    I am working in staged environments called “dev”, “uat” and “production”. Previously we would deploy our template updates as DB dumps, but we decided to embrace the “save templates as files” functionality in EE2.

    My goal has been to deploy template updates as SVN tags and to thereby bypass the DB updates altogther.

    Templates are now saved as file which is great, however a problem has arisen in relation to the “metadata” which is stored in the “exp_templates” table.

    There are a few “metatdata” fields for templates which are only stored in the DB, eg:
    allow_php, php_parse_location, template_type.

    So, the problem is: when I add new a template which has custom settings for PHP parsing, the new template is created (using “SVN update”) but the metadata is not carried though from dev to uat (and hence must be manually updated).

    This is not such a big deal when going from dev to uat - but when updating production it would mean that the pages needing these settings would be broken for a time.

    Of course I have considered just dumping and importing the template DB tables - but this is effectively what we were doing before and what we were hoping to avoid by saving templates as files.

    I’m trying find out if there are other developers out there who have engaged with this problem and found a solution or a good workaround.

    Thanks!

  • #2 / Aug 01, 2011 1:54pm

    Sue Crocker

    26054 posts

    Hi, truthnews. What I’ve done in the past is set the db to have those settings default to having PHP turned on and parsing set to input. But that’s just one way of doing it.

  • #3 / Aug 01, 2011 8:36pm

    truthnews

    37 posts

    Thanks Sue. I guess it’s not a show stopper. We aim to minimse the use of PHP in templates anyway.

    cheers!

  • #4 / Aug 02, 2011 8:59am

    Sue Crocker

    26054 posts

    A few versions ago I might have defaulted to having php on in every template, but these days there are enough third party add-ons that I rarely need to resort to PHP. If anything else comes up, please do let us know in a new thread..

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases