I have installed the twilio extension (extensions, github) on a new civicrm site.
I was unable to install using the in civicrm method so uploaded via FTP and then refreshed the installed extension page. Pressed install and got the following error message.
Warning: Invalid argument supplied for foreach() in _twilio_civix_civicrm_xmlMenu() (line 34 of /var/www/vhosts/XXXX.net/httpdocs/sites/default/files/civicrm/custom_ext/org.civicrm.sms.twilio-master/twilio.civix.php).
Warning: Invalid argument supplied for foreach() in _twilio_civix_find_files() (line 118 of /var/www/vhosts/XXXXX.net/httpdocs/sites/default/files/civicrm/custom_ext/org.civicrm.sms.twilio-master/twilio.civix.php).
I have gone and looked the twilio.civix.php file
The first instance:
function _twilio_civix_civicrm_xmlMenu(&$files) {
foreach (glob(__DIR__ . '/xml/Menu/*.xml') as $file) { // this is line 34
$files[] = $file;
}
}
And the second instance:
function _twilio_civix_find_files($dir, $pattern) {
$todos = array($dir);
$result = array();
while (!empty($todos)) {
$subdir = array_shift($todos);
foreach (glob("$subdir/$pattern") as $match) { // this is line 118
if (!is_dir($match)) {
$result[] = $match;
}
}
if ($dh = opendir($subdir)) {
while (FALSE !== ($entry = readdir($dh))) {
$path = $subdir . DIRECTORY_SEPARATOR . $entry;
if ($entry == '.' || $entry == '..') {
} elseif (is_dir($path)) {
$todos[] = $path;
}
}
closedir($dh);
}
}
return $result;
}
But I literally have no clue what is wrong as I am not that familiar with PHP. I have tried to install both the new version of twilio and the previous version but the error message is the same. I have successfully used the twilio extension on another site.
Any thoughts about where to go with this woudl be gratefully received!
Thanks Caroline
Site is drupal 7/CiviCRM 4.6.8.