Set up SilverStripe 3.1 using only Git (No Composer)

We recently tried to use composer to set up SilverStripe 3.1, but ended up with a dependency nightmare. In order to work around this we decided to make use of Git submodules.

First set up your Git repository and run:

Next set up a site directory for the code inside your Git repository. Then navigate to SilverStripe Installer in your browser and Download a copy. Extract files, and copy contents to site folder. Now we need to add the CMS and Framework. Navigate in a browser to the Git Hub repositories for CMS and Framework. Now copy the HTTPS clone URL for each project and run the following, to add these as Git sub modules.

Now delete mysite/_config.php and load the site. Follow the normal install instructions displayed and you will have a running version of SilverStripe 3.1

Published by

Matt Cockayne

Matt is both a PHP Developer and Scout Leader. Having tried his hand a few different careers he finds that he is happiest working with code as the Technical Lead at Magma Digital. As a framework contributor and serial tinkerer Matt has spent a long time working on being the best PHP Developer he can be. As a Scout Leader he spends a lot of his time devoted to teaching valuable life skills to kids aged 7-18. He is a firm believer that being a Good Scout and Great Developer go hand in hand.

4 thoughts on “Set up SilverStripe 3.1 using only Git (No Composer)”

  1. What issues did you run into with Composer? Running the composer create project as defined by SilverStripe never seemed to be idea for me so I built a little bootstrap tool for creating projects easily, setting up the composer.json file. https://github.com/fullscreeninteractive/silverstripe-boilerplate

    The composer integration is still pretty new in SilverStripe so still may take some time to ensure the modules include the correct versions of dependancies.

    1. Hi Will, we actually use composer a lot in our none silverstripe projects and really liked the idea of it for silverstripe but we found that when we were using it and trying to install various different modules we ended up with a ton of version mismatches which composer just couldn’t resolve. After about four attempts at using composer and the installer we decided to give up and fall back to a more reliable (if less elegant) solution with git submodules which allowed us a lot more control over the modules we needed to use.

      Matt

  2. Hey Will,

    I have been trying this morning, following: Silverstripe Composer Install installing 3.1.0-beta3. And I could not recreate the issues we were having a number of weeks ago.

    I now believe we were downloading 3.1 from Silverstripe site, and manually adding framework and cms. This might have caused a mismatch etc.

    To conclude composer seems fine if you start with:

    Of course composer could still have dependency issues with other modules, with Git Submodules we do get much finer control on what commits we work to which is especially useful if you work on the bleeding edge.

    Cheers,

    Rick.

  3. Just an fyi, you can actually use specific commits via composer outlined in their documentation at https://getcomposer.org/doc/04-schema.md#package-links

    Example:

    “require”: {
    “monolog/monolog”: “dev-master#2eb0c0978d290a1c45346a1955188929cb4e5db7”, “acme/foo”: “1.0.x-dev#abc123”
    }

Leave a Reply