私の質問はこの文字列に関するものです:Mage::helper('catalog/image')->init($product, 'image', $image->getFile())->resize(265)
この文字列を見つける方法を見つけようとしています。しかし...文字列には、$ product、image、および265変数が含まれます。だから私は次のような文字列を見つける必要があります:
Mage::helper('catalog/image')->init($product, 'image', $image->getFile())->resize(265)
Mage::helper('catalog/image')->init($product, 'thumb', $image->getFile())->resize(75)
Mage::helper('catalog/image')->init($image, 'mini', $image->getFile())->resize(25)
など...
今のところ私はこれを持っていますが、それはただthrougファイルを検索しますMage::helper('catalog
function listFolderFiles($dir){
$ffs = scandir($dir);
foreach($ffs as $ff){
if($ff != '.' && $ff != '..'){
if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);
if(strpos($ff, '.phtml')!==false){
$contents = file_get_contents($dir.'/'.$ff);
$pattern = preg_quote("Mage::helper('catalog", "/");
$pattern = "/^.*$pattern.*\$/m";
if(preg_match_all($pattern, $contents, $matches)){
echo "Found matches in: ".$dir.'/'.$ff."\n";
}
else{
echo "No matches found in: ".$dir.'/'.$ff."\n";
}
}
}
}
}
listFolderFiles('../app/design');