FuelSDK-PHP icon indicating copy to clipboard operation
FuelSDK-PHP copied to clipboard

Requirement config.php in project root doesn't play well with symfony

Open phpguru opened this issue 6 years ago • 2 comments

I forked this repository to get the SDK to more easily load into Symfony, and probably other frameworks such as Laravel. It's available on Packagist.

I am not a Symfony expert, but we already have a config.php in our web root and it is generated by Symfony and it cannot be changed, so this library was a non-starter to use as is.

I read a few of different PRs and incorporated some of them, and updated the README.md

A lot of work needs to be done on it to update the examples, but it's working fine in Symfony for us without config.php. In essence, I just pass everything I need to the constructor. I also pass along debug flag to the CUDUtils class and ET_Post making it easier to debug requests and responses.

I don't want to submit a PR yet because I believe it's a lot of breaking changes and unfinished but wanted to let you know about it and future Symfony and Laravel developers to try my branch. All feedback welcome.

phpguru avatar Mar 22 '18 16:03 phpguru

This config.php file should be fixed, simply you cannot develop now like this in any framework as config.php is a general name and it may be reserved by top level application.

pentium10 avatar Mar 06 '19 15:03 pentium10

@pentium10 That’s exactly the reason for my fork of this package.

In my fork, I removed the requirement for a config.php in the web root entirely. You can instead pass the necessary parameters to constructor, and load the configuration from a file or your database or environment.

phpguru avatar Mar 08 '19 01:03 phpguru