Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

Make VersionEngine configurable

Open timgws opened this issue 9 years ago • 2 comments

VersionEngine is awesome. Sadly, it's a little bit too optimistic for me.

I have a lot of legacy code that runs on Datatables 1.9, and I am not really prepared to start moving all of that to Datatables 1.10. It would be awesome if there was a configuration file (something like app/config/app.php) where it could be specified in an array what providers you want to use.

For example, datatable.php:

<?php
return [
    'providers' => [
          OpenSkill\Datatable\Versions\Datatable110Version::class,
          OpenSkill\Datatable\Versions\Datatable19Version::class
     ];
];

timgws avatar Mar 03 '16 08:03 timgws

Should be possible as long as all versions extend Version and have the same constructor arguments, we could then instantiate them in the service provider.

Chumper avatar Mar 03 '16 09:03 Chumper

I thought about this and it should be fairly simple to impement: In the ServiceProvider we will import the classes from the config and instantiate them there, as we currently do hardcoded with both versions.

This allows developers to add own versions as well as stick to just one if needed.

Chumper avatar Apr 27 '16 07:04 Chumper