Skip to content

Conversation

@c-gross
Copy link

@c-gross c-gross commented Aug 10, 2022

No description provided.

@Platzke-jtl
Copy link
Collaborator

Is there a reason why the Version sould be updated ?

@c-gross
Copy link
Author

c-gross commented Aug 16, 2022

Our current project is using Laravel 9 which requires version 6 of that package. I wantet to write an jtl connector but composer can't install it because of the old version.

@Platzke-jtl
Copy link
Collaborator

ok, we will run some test and approve this if there are no problems

@zaxxo
Copy link

zaxxo commented Aug 22, 2022

Unfortunaly, the Symfony HTTP Foundation package is not the only problem. Some Laravel 9 dependecies require version 2 of the PSR Container package, but the PHP-DI package only supports version 1. There is an unreleased version of the PHP-DI package, which supports version 2 of the PSR Container package. The release should take place in the next few days. We should wait until the official release. I have tested the Connector with the DEV branch of the PHP-DI package and I had to change one line to be compatible with this version. But after that, everything seems to work correctly.

@c-gross
Copy link
Author

c-gross commented Aug 22, 2022

Sounds good.

@zaxxo
Copy link

zaxxo commented Aug 22, 2022

But we have two problems with the new version of PHP-DI:

  • PHP 7 is no longer supported (the Connector supports PHP >= 7.2)
  • The new PHP 8 attributes are used instead of the old annotations

@Platzke-jtl Were the annotations used at all? Or why was useAnnotations(true) set?

@zaxxo
Copy link

zaxxo commented Aug 22, 2022

@c-gross If you want, you can test with my forked package.

Add this to your composer.json:

"repositories": [
    {
        "url": "https://github.com/zaxxo/connector-core.git",
        "type": "git"
    }
]

And then as usual:

composer require jtl/connector

@Platzke-jtl
Copy link
Collaborator

@zaxxo Annotations are used in the shopware6 and shopify connectors who depend on the core, but they are not directly used in core, as far as i know.
The PHP Version Constraint only defines the lower bounds, the current core version (5.1.3) support PHP up to 8.1

While there shouln't be a problem updating http-foundation, PHP-DI would be more of a problem as we still need PHP 7 support for other connectors (at least till end of this year, probably longer)

It may be possible to create a dual version, with some composer tricks.
Since we currently focus on updating the other connectors to core 5 we currently don't have time to work on that, but if you want to help us a PR is always welcome.

@zaxxo
Copy link

zaxxo commented Aug 22, 2022

@Platzke-jtl I think the most reliable solution is to create a new connector core version 6, because of the (big) change in the PHP-DI (annotations -> attributes). So the Shopware and Shopify connector can use the old version 5, while newly created connectors can use version 6.

@c-gross
Copy link
Author

c-gross commented Aug 23, 2022

@c-gross If you want, you can test with my forked package.

Add this to your composer.json:

"repositories": [
    {
        "url": "https://github.com/zaxxo/connector-core.git",
        "type": "git"
    }
]

And then as usual:

composer require jtl/connector

Yes it's possible to install the fork via composer.
Can't say if everything works. But install went fine.

@c-gross
Copy link
Author

c-gross commented Aug 23, 2022

After taking a deeper look at the core connector and the example connector code I'm not sure if it makes even sense to implement it inside our laravel project. Looks more like the connector is better be written as an standalone project.

Like basis like the db config, not possible to use laravel config values or the .env file. Everywhere are specific config objects require. You can't just set a config param. It wants it's own models for objects like products and might not work with laravel objects as well.
I also had no idea how to do that new connector init and initialize code in laravel. Maybe as a middleware.

@zaxxo
Copy link

zaxxo commented Aug 24, 2022

@c-gross Yesterday I successfully implemented the connector in our Laravel project. It was a little bit tricky, but it works. Maybe I can give you some hints or an example if you are interested in?

@zaxxo
Copy link

zaxxo commented Aug 24, 2022

@Platzke-jtl Is it an option to create a new connector core version 6? I could make a pull request for that.

@Platzke-jtl
Copy link
Collaborator

@zaxxo you can create a pr with the changes.

@c-gross
Copy link
Author

c-gross commented Aug 24, 2022

@zaxxo ya sure and if it's to tricky I can still go the standalone way. Have a very limited time for the jtl connector.

@Platzke-jtl Platzke-jtl mentioned this pull request Aug 24, 2022
@Reflic
Copy link

Reflic commented Aug 24, 2022

Hey guys,

i have the same problem as you. And would offer my help if there is some help needed.

@themazim
Copy link

themazim commented Sep 7, 2022

@c-gross Yesterday I successfully implemented the connector in our Laravel project. It was a little bit tricky, but it works. Maybe I can give you some hints or an example if you are interested in?

Do you happen to have an example on hand for JTL running within laravel?

@sprankhub
Copy link

Any update on this, @Platzke-jtl? Without symfony/http-foundation version 6 support, it is not possible to use that package in modern projects :/ We would like to use it in our Magento project, but we can't.

@elburro1887
Copy link

@Platzke-jtl Is there any update? I would like to integrate this into a Laravel 12 project, which already needs http-foundation v7

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

Successfully merging this pull request may close these issues.

7 participants