예제 #1
0
파일: module.php 프로젝트: astorm/pestle
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;
}
예제 #2
0
파일: module.php 프로젝트: astorm/pestle
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');
}