Slide 17
Slide 17 text
2. requireに渡されているパス文字列(定数等含む)を取得
const INCLUDE_STMT_PATTERN =
'/^(*)(include_once|include|require_once|require)(\((?P.*)\)|+(?P.*));( *)$/';
$isMatch = preg_match(Turpan::INCLUDE_STMT_PATTERN, $line, $matches);
if (!$isMatch) { continue; }
$tmp['file'] = realpath($file->getOldName());
$tmp['required_file'] = (!empty($matches['required_file_1'])) ? $matches['required_file_1']
: $matches['required_file_2'];
$tmp['required_file'] = str_replace('__FILE__', "'{$tmp['file']}'", $tmp['required_file']);