/**
* Method to return a list of actions from a file for which permissions can be set.
*
* @param string $file The path to the XML file.
* @param string $xpath An optional xpath to search for the fields.
*
* @return boolean|array False if case of error or the list of actions available.
*
* @since 3.0.0
*/
public static function getActionsFromFile($file, $xpath = "/access/section[@name='component']/")
{
if (!is_file($file) || !is_readable($file)) {
// If unable to find the file return false.
return false;
} else {
// Else return the actions from the xml.
$xml = simplexml_load_file($file);
return self::getActionsFromData($xml, $xpath);
}
}