#!/usr/bin/php findAll() as $post) { $paths[] = $post->getContentPath(); $paths[] = $post->getThumbnailSourceContentPath(); } $paths = array_flip($paths); foreach ($publicFileDao->listAll() as $path) { if (dirname($path) !== 'posts') continue; if (!isset($paths[$path])) { echo $path . PHP_EOL; flush(); } }