What I did so far:
I am pretty familiar with CI, but new to composer and the twilio SDK. Reading some tutorials and docs I managed to install composer and the twilio package. However the /vendor
folder is parallel to my CI installation:
/var/www/html/
- application
- system
- vendor
I have therefore edited the config.php setting the path like this:
$config['composer_autoload'] = '/var/www/html/vendor/autoload.php';
In my controller tried to use the SDK as documented in the Twilio SDK:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Test extends CI_Controller {
use Twilio\Rest\Client;
public function twilio()
{
$client = new Client($AccountSid, $AuthToken);
}
}
However I get back an error:
Fatal error: Test cannot use Twilio\Rest\Client - it is not a trait in /var/www/html/application/controllers/Test.php on line 6