ElkArte Community

Elk Development => Feature Discussion => Topic started by: emanuele on September 11, 2014, 06:56:26 am

Title: 1.0 to 1.1 addons/themes migration guide
Post by: emanuele on September 11, 2014, 06:56:26 am
The idea about ElkArte versioning is to stick as much as possible to the so called "semantic versioning (http://semver.org/)":
QuoteGiven a version number MAJOR.MINOR.PATCH, increment the:

    MAJOR version when you make incompatible API changes,
    MINOR version when you add functionality in a backwards-compatible manner, and
    PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

That said, since ElkArte 1.x is still an "heavily" developed piece of code that is meant to change and hopefully ( :P ) improve, it may be that some "low level" stuff (e.g. database schema, less-used files, etc.) may require changes creating some compatibility issue.
Of course we will try to reduce these changes to a minimum, but some are (or will be) really necessary in order not to restrict the development too much.

This topic is meant to track changes that developer of addons and themes should be informed about, so that they will be able to evaluate the steps necessary in order to prepare for future releases.
Please remember that any change reported here may change again in the future before the 1.1 version is released, so feel free to discuss the changes, disagree with them and ask any question. Maybe opening a new topic, so that people can subscribe to this one to receive notifications. ;)

Of course you can keep track of actual development following the commits to the development branch at github:
https://github.com/elkarte/Elkarte/tree/development
Title: [addons]
Post by: emanuele on March 04, 2015, 05:07:38 pm
Incompatible changes

The schema of the table {db_prefix}log_mentions changed to:
Code: [Select]
		array('name' => 'id_mention',     'type' => 'int', 'size' => 10, 'unsigned' => true, 'auto' => true),
array('name' => 'id_member',      'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
array('name' => 'id_target',      'type' => 'int', 'size' => 10, 'unsigned' => true, 'default' => 0),
array('name' => 'status',         'type' => 'tinyint', 'size' => 1, 'default' => 0),
array('name' => 'is_accessible',  'type' => 'tinyint', 'size' => 1, 'default' => 0),
array('name' => 'id_member_from', 'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
array('name' => 'log_time',       'type' => 'int', 'size' => 10, 'unsigned' => true, 'default' => 0),
array('name' => 'mention_type',   'type' => 'varchar', 'size' => 12, 'default' => ''),

The hook integrate_add_mention has been removed.
New mentions are now added via files.

Details will follow (and if they don't feel free to ask for them).

Backward compatible relevant changes

Introduction of "events" (let's say a sort of hooks under steroids - hopefully).
Introduction of "modules" and "integrations" (pattern-based classes automatically loaded when needed, an hopefully easier way to extend the core).
* Scheduled tasks are now split each one to its own file for easier extension.

Reference for all the items listed here is the following pull request:
https://github.com/elkarte/Elkarte/pull/1950
Title: [addons]
Post by: emanuele on March 07, 2015, 02:33:54 pm
Incompatible changes
Procedural controllers are no more supported in ElkArte 1.1, only controller classes are accepted and used.
If you have a controller in the form:
Code: [Select]
<?php
function my_controller()
{

}

function my_pre_dispatch_controller()
{

}

Please take your time to convert it into a class in the form:
Code: [Select]
<?php
class Myaction_Controller extends Action_Controller
{
    public function pre_dispatch()
    {
        // Pre-dispatching code
    }

    public function action_index()
    {
        // Default action
    }
}

TODO Write documentation about controllers and naming patterns.
TODO Write a todo addon. LOL

Reference: https://github.com/elkarte/Elkarte/pull/1979
Title: Re: 1.0 to 1.1 addons/themes migration guide
Post by: ahrasis on March 07, 2015, 07:40:17 pm
I have been thinking on how to do that all this while. May be I'll attempt it in the near future...
Title: Re: 1.0 to 1.1 addons/themes migration guide
Post by: emanuele on March 08, 2015, 04:23:50 am
It's easier to do than explain. ;)

The code I wrote above, put into a file named Myaction.controller.php and into the controllers directory is already able to "react" to ?action=myaction
Title: New folder addon?
Post by: wintstar on January 05, 2016, 03:00:51 am
In the last pull request (https://github.com/elkarte/Elkarte/commit/8f60c7d85f057b56516dcc172c0fd21c606447bd) #2340 (https://github.com/elkarte/Elkarte/pull/2340) from emanuele45/formatting (https://github.com/elkarte/Elkarte/commit/8f60c7d85f057b56516dcc172c0fd21c606447bd) … (https://github.com/elkarte/Elkarte#) there is a new folder addon. In recent pull requests there have been many changes for 1.1 dev.  What these changes mean for creating Addons / Themes?
Title: Re: 1.0 to 1.1 addons/themes migration guide
Post by: emanuele on January 05, 2016, 03:08:48 am
Quote from: emanuele – Incompatible changes

The BBC parser has been completely replaced, so the way to add new bbcodes and all the hooks have changed as well.
TODO write documentation of the new BBC parse.

Backward compatible relevant changes

* Introduced an "addons" directory where addons can reside and work in almost complete isolation from the core.

TODO write documentation about it. I swear I already did, but apparently I didn't.
Title: Re: 1.0 to 1.1 addons/themes migration guide
Post by: emanuele on January 05, 2016, 03:13:42 am
Quote from: wintstar – What these changes mean for creating Addons / Themes?
I merged your topic in this one so it's easier to keep track. I hope. :P

Quick and dirty: addons can almost entirely work from that particular directory, so you can have an addon there reproducing the directory structure of ElkArte (at least for now in regards to controllers and subs, it should be somehow extended to themes and languages as well). I'm not (yet) sure it works 100% in the intended way, it requires some documentation and testing before.
Title: Re: 1.0 to 1.1 addons/themes migration guide
Post by: wintstar on January 05, 2016, 03:24:50 am
When will publish a Dokumentation? I am currently doing my addons prepare for the upcoming version 1.1 *.

Title: Re: 1.0 to 1.1 addons/themes migration guide
Post by: emanuele on January 05, 2016, 05:28:50 am
heh... Don't you have another question? O:-)
Title: Re: 1.0 to 1.1 addons/themes migration guide
Post by: wintstar on January 05, 2016, 05:36:56 am
Oh I had many, many question 8) But I think most of them can not yet be answered :-[