public function analyze()
{
$functions = array('glob', 'fopen', 'file', 'file_get_contents', 'file_put_contents', 'unlink', 'opendir', 'rmdir', 'mkdir');
$regexStartWithTmp = '^(/tmp/|C:\\\\\\\\WINDOWS\\\\\\\\TEMP|C:\\\\\\\\WINDOWS)';
// string literal fopen('a', 'r');
$this->atomFunctionIs($functions)->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('String')->tokenIs('T_CONSTANT_ENCAPSED_STRING')->regexIs('noDelimiter', $regexStartWithTmp)->back('first');
$this->prepareQuery();
// string literal fopen("a$b", 'r');
// may need some regex to exclude http...
$this->atomFunctionIs($functions)->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('String')->is('constant', true)->tokenIs('T_QUOTE')->outWithRank('CONCAT', 0)->tokenIs('T_ENCAPSED_AND_WHITESPACE')->regexIs('noDelimiter', $regexStartWithTmp)->back('first');
$this->prepareQuery();
// string literal fopen('a'.$b, 'r');
// may need some regex to exclude http...
$this->atomFunctionIs($functions)->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('Concatenation')->is('constant', true)->outWithRank('CONCAT', 0)->tokenIs('T_CONSTANT_ENCAPSED_STRING')->regexIs('noDelimiter', $regexStartWithTmp)->back('first');
$this->prepareQuery();
}