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

Using 2.x and 3.x in parallel #187

Closed
aik099 opened this issue Dec 21, 2020 · 10 comments
Closed

Using 2.x and 3.x in parallel #187

aik099 opened this issue Dec 21, 2020 · 10 comments

Comments

@aik099
Copy link

aik099 commented Dec 21, 2020

The project, where Aura.Sql is being used must work on different PHP versions, and on some only Aura.Sql 2.x is supported.

I have several issues caused by this:

  1. the ProfilerInterface was moved to a different namespace (I've mitigated that using the class_alias function)
  2. new methods added on ProfilerInterface, that I have no idea how to implement
  3. the Aura\Sql\Iterator\AllIterator class was removed
  4. the Aura\Sql\Iterator\ColIterator class was removed
@aik099 aik099 changed the title Migrating from 2.x to 3.x Using 2.x and 3.x in parallel Dec 21, 2020
@brandonsavage
Copy link
Contributor

Is your intent here to have a version of 2.x installed alongside 3.x and picking which one to use based on which version of PHP you're using?

@aik099
Copy link
Author

aik099 commented Aug 7, 2021

The goal is to have a single code base for my project, that will auto-pick (via Composer) compatible Aura.Sql version based on the used PHP version and my project would work with either of picked Aura.Sql versions.

@brandonsavage
Copy link
Contributor

brandonsavage commented Aug 7, 2021 via email

@djmattyg007
Copy link

Composer should definitely do that automatically for you.

@aik099
Copy link
Author

aik099 commented Aug 9, 2021

Composer is picking the correct Aura.Sql package version, however, due to BC breaks in Aura.Sql 3.x my code, that worked with Aura.Sql 2.x, no longer works on Aura.Sql 3.x.

I even can't adapt my code to work with Aura.Sql 3.x due to the above (in issue description) mentioned BC breaks, that I have no idea how to overcome:

  • new ProfilerInterface methods with no implementation examples;
  • removed iterator classes, which I've found very useful.

@djmattyg007
Copy link

You're probably going to have to polyfill those things yourself. It's unreasonable to expect an author to maintain backwards compatibility at all costs. That's why they've bumped the major version number of the package.

@aik099
Copy link
Author

aik099 commented Aug 9, 2021

I understand, that I must polyfill them, but I have no idea how. Knowing why things were removed and how it's done in the Aura.Sql 3.x version would be really helpful.

@brandonsavage
Copy link
Contributor

Hey Alex,

I'd define an interface and then have concrete classes that proxy to the 2.x and 3.x series components, or replace them. Make sense?

If you're still having trouble, your question is probably out of scope for a GitHub issue, but would fall into the "consulting/contracting" space. I'm sure @pmjones or someone like him could offer some help in this area. Most of us have our email addresses in our profiles.

@aik099
Copy link
Author

aik099 commented Aug 11, 2021

Thanks for explaining. Architectural problems aside I still have no idea how to adapt my code to work with Aura.Sql 3.x with ProfilerInterface change and iterator removal.

// cc @pmjones

@brandonsavage
Copy link
Contributor

@aik099 It looks like you may have to backport ProfilerInterface yourself, or copy the component from the older version. At this point I'm going to close the issue because there's not too much we can specifically do to assist, but I hope you're able to get what you need working.

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

No branches or pull requests

3 participants