contao-community-alliance / events-contao-bindings

This library turns the Contao Core API into events.
GNU Lesser General Public License v3.0
2 stars 4 forks source link

Restructure this project into one single branch. #5

Open tristanlins opened 9 years ago

tristanlins commented 9 years ago

The current branch architecture is like an asskick. We need to add changes and bugfixes in "hundrets" of branches and actual test the fix over the different contao versions. We need to do a lot cherry-picking and merging, that is absolutely unnecessary!

We should hold the complete code in one Repo and extend the newer versions from the previous one and change only the differences.

Like this:

namespace ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao211 {
    class BackendSubscriber {}
}
namespace ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao30 {
    class BackendSubscriber extends \ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao211\BackendSubscriber {}
}
namespace ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao31 {
    class BackendSubscriber extends \ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao30\BackendSubscriber {}
}
namespace ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao32 {
    class BackendSubscriber extends \ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao31\BackendSubscriber {}
}
namespace ContaoCommunityAlliance\Contao\Bindings\Subscribers {
    if (version_compare('3.2', VERSION, '>=')) {
        class BackendSubscriber extends \ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao32\BackendSubscriber {}
    } elseif (version_compare('3.1', VERSION, '>=')) {
        class BackendSubscriber extends \ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao31\BackendSubscriber {}
    } elseif (version_compare('3.0', VERSION, '>=')) {
        class BackendSubscriber extends \ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao30\BackendSubscriber {}
    } elseif (version_compare('2.11', VERSION, '>=')) {
        class BackendSubscriber extends \ContaoCommunityAlliance\Contao\Bindings\Subscribers\Contao211\BackendSubscriber {}
    }
}

Which such an hierarchy, we only need to make the bugfix in the version that is affected. All other implementations get the same bugfix just in time.

discordier commented 9 years ago

Go for it? :)