Update Bolt CMS from 1.0 to 2.0

What to do when you want to update your Bolt CMS from bolt.cm 

I've found the page on the offical website omits important details

  1. Backup Website and Database
  2. Check out https://docs.bolt.cm/updating how to load the new files on the website
  3. Delete the folders App/src and app/extensions
  4. The Extensions layout has changed. Check out if the extension you have used are on extensions.bolt.cm   and install them via the
    admin panel
  5. If you have old extensions that you want to port to new version move them to extensions/local/YOURNAME/EXTENSIONNAME
  6. You need two files instead of just one: init.php and Extension.php (make sure to not write the filenames lowercase)
  7. Make sure your files look similar to this example. Make sure to check the "use" line and replace yourname with something that makes sense and is the same name as the folder 

Init.php:

<?php
use Bolt\Extension\YOURNAME\YOUREXTENSION\Extension;

$app['extensions']->register(new Extension($app));

Extension.php:

<?php
 

namespace Bolt\Extension\YOURNAME\EXTENSIONNAME;
use Bolt;


class Extension extends \Bolt\BaseExtension
{
    public function getName() {
        return "EXTENSIONNAME";
    }

    function info() {

        $data = array(
            'name' =>"EXTENSIONNAME",
            'description' => "DESCRIPTION",
            'author' => "A. Wildi",
            'link' => "http://example.ch",
            'version' => "1.0",
            'required_bolt_version' => "2.0",
            'highest_bolt_version' => "3.9",
            'type' => "Twig function",
            'first_releasedate' => "2012-10-10",
            'latest_releasedate' => "2016-03-09",
        );

        return $data;

    }

    function initialize() {

        $this->addTwigFunction('helloWorld', 'twigHelloWorld');

    }

    function twigHelloWorld($name) {    

        $html = "Hello, ". $name ."!";

        return new \Twig_Markup($html, 'UTF-8');
    }

}

I hope this helps.

Need help with Bolt? Need a Bolt extension, a custom Online Shop with the same design as your bolt site? Contact me under me at andreaswildi com to see my references and we'll define the requirements and price for the whole project.

I've recently started working on a per project basis in order to become location independent.
Headhunters: Please don't contact me unless your client offers 100% remote working.

 

Keywords:
Schweizer Bolt CMS Hilfe, Bolt CMS

 

Written by Andreas Wildi on Friday March 11, 2016
Permalink -

« Get around Modsecurity Rule 350147 - MSSQL Server Check if a line is too long in a string field »