Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make VersionEngine configurable #35

Open
timgws opened this issue Mar 3, 2016 · 2 comments
Open

Make VersionEngine configurable #35

timgws opened this issue Mar 3, 2016 · 2 comments

Comments

@timgws
Copy link
Member

timgws commented Mar 3, 2016

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
     ];
];
@Chumper
Copy link
Contributor

Chumper commented Mar 3, 2016

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
Copy link
Contributor

Chumper commented Apr 27, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants