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
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
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 <discussions@concretecms.com> wrote:
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 <discussions@concretecms.com> wrote:
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. :(
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. :(
Thank you!
I managed to get this working a treat.
All the best
I managed to get this working a treat.
All the best
Care to share your solution with the community?
It's also a good idea to add [SOLVED] to the forum title.
Thanks, John
It's also a good idea to add [SOLVED] to the forum title.
Thanks, John
Hi John
What is it specifically you are struggling with? I just followed the two articles above?
Ben
What is it specifically you are struggling with? I just followed the two articles above?
Ben
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...
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...
https://packagist.org/packages/twilio/sdk...