Twilio including external namespaces best practice??

Permalink
Hi I need to include the PHP Twilio REST API in my package, it will use namespaces like...
use Twilio\Rest\Client;
use Twilio\Twiml;

They suggest having the folder at the root and linking it as so:
require __DIR__ . '/twilio-php-master/Twilio/autoload.php';

However what would be the best practice to include and load these files in the package?

https://www.twilio.com/docs/libraries/php...
https://github.com/twilio/twilio-php...

Thanks in advance

BHWW
View Replies: View Best Answer
ramonleenders replied on at Permalink Reply
ramonleenders
Require the available composer package?

https://packagist.org/packages/twilio/sdk...
BHWW replied on at Permalink Reply
BHWW
Hi Ramon

Thanks, sorry to ask but could you indicate what script to add and to what file?

Thanks

Ben

> On 24 Sep 2017, at 09:50, concrete5 Community <[email protected]> wrote:
Gondwana replied on at Permalink Best Answer Reply
Gondwana
Here's some stuff that should help:

https://documentation.concrete5.org/developers/packages/advanced-inc...

https://documentation.concrete5.org/tutorials/how-to-add-a-third-par...

Unfortunately, I couldn't get it to work with something I was trying to install. :(
BHWW replied on at Permalink Reply
BHWW
Thank you!

I managed to get this working a treat.

All the best
jasteele12 replied on at Permalink Reply
jasteele12
Care to share your solution with the community?

It's also a good idea to add [SOLVED] to the forum title.

Thanks, John
BHWW replied on at Permalink Reply
BHWW
Hi John

What is it specifically you are struggling with? I just followed the two articles above?

Ben
jasteele12 replied on at Permalink Reply
jasteele12
Hi Ben,

Not having a problem at all, but I got it working doesn't help anybody else in the forum that might have a similar problem.

A brief breakdown of the solution and changing the subject to include [SOLVED] helps everybody.

Did you use composer? What path did you include the library in your package? Did the use statements change, etc...