How to add an external PHP library (for example Httpful) to ATK4?

234 Views Asked by At

Adding Httpful (http://phphttpclient.com/) to ATK4 using the recommended Composer method does not work.

After some fooling around I managed to get all the file paths correct but I get "Fatal error: Class 'Frontend' not found in /var/www/portal/index.php on line 14".

Using the 'phar' method described on Httpful's page is also a no-go.

I don't know if this needs to be implemented through an add-on, and if it does, I don't know how. Any info/pointers would be appreciated...

The bottom line is: I need to interact with a REST API in a sane way, it doesn't have to be Httpful specifically, is there another solution out there that someone has already implemented in ATK4?

1

There are 1 best solutions below

1
On BEST ANSWER

Please look into this repository which is designed to run Agile Toolkit based on composer primarily:

https://github.com/atk4/atk4-secure/

You can also look at this branch:

https://github.com/atk4/atk4/tree/4.3-PageManager-refactoring

which deals with this issue:

https://github.com/atk4/atk4/issues/403

although that's not part of the "master" branch, instead it went to 4.3. Perhaps you can back-port the commits.

Edit: I must also mention, that this should work best if you have picked Agile Toolkit from Git repository.