Exemple #1
0
function getUsedAclRuleIdsFromControllerFiles($dir)
{
    $files = glob_recursive($dir . '/*/Controller/*.php');
    $code = array_map(function ($file) {
        $function = getFunctionFromCode(file_get_contents($file), '_isAllowed');
        if (strpos($function, '_isAllowed')) {
            return getAclRulesFromIsAllowedFunction($function);
        }
        return false;
    }, $files);
    $code = array_filter($code);
    return $code;
}
Exemple #2
0
function getBaseConstructor($file, $tokens)
{
    $base = getBaseMagentoDirFromFile($file);
    $class = extractFullClassExtends($tokens);
    $base_file = $base . str_replace('\\', '/', $class) . '.php';
    $base_contents = file_get_contents($base_file);
    $function = getFunctionFromCode($base_contents, '__construct');
}