list($module, $name) = getModuleName($factoryName, $compositeModules); $patterns = array('::getModel(\'%s\'' => 'Model', '::getSingleton(\'%s\'' => 'Model', '::getResourceModel(\'%s\'' => 'Model_Resource', '::getResourceSingleton(\'%s\'' => 'Model_Resource', 'addBlock(\'%s\'' => 'Block', 'createBlock(\'%s\'' => 'Block', 'getBlockClassName(\'%s\'' => 'Block', 'getBlockSingleton(\'%s\'' => 'Block'); foreach ($patterns as $pattern => $classType) { if (isPatternExist($content, $pattern, $factoryName)) { if (!isset($map[$classType])) { $map[$classType] = array(); } $map[$classType][$factoryName] = getClassName($module, $classType, $name); } } } } } // layouts $classType = 'Block'; $layouts = $utilityFiles->getLayoutFiles(array(), false); foreach ($layouts as $file) { $xml = simplexml_load_file($file); $classes = Utility_Classes::collectLayoutClasses($xml); $factoryNames = array_filter($classes, 'isFactoryName'); if (!$factoryNames) { continue; } foreach ($factoryNames as $factoryName) { list($module, $name) = getModuleName($factoryName, $compositeModules); $map[$classType][$factoryName] = getClassName($module, $classType, $name); } } echo Zend_Json::prettyPrint(Zend_Json::encode($map)); /** * Get combined array from similar files by pattern