From 2c7f11e57eeb9074b795b386fbb1f13f9a6386f1 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 1 Jun 2014 14:38:40 +0200 Subject: [PATCH] Changed output of find-posts script --- scripts/find-posts.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/find-posts.php b/scripts/find-posts.php index 2b4a1aad1..cd33c100e 100644 --- a/scripts/find-posts.php +++ b/scripts/find-posts.php @@ -9,11 +9,24 @@ $posts = PostSearchService::getEntities($query, null, null); foreach ($posts as $post) { - echo implode("\t", + $info = [ $post->getId(), $post->getName(), - $post->getContentPath(), - $post->getMimeType(), - ]). PHP_EOL; + $post->getType()->toDisplayString(), + ]; + + $additionalInfo = []; + if ($post->getType()->toInteger() != PostType::Youtube) + { + $additionalInfo = + [ + file_exists($post->getContentPath()) + ? $post->getContentPath() + : 'DOES NOT EXIST', + $post->getMimeType(), + ]; + } + + echo implode("\t", array_merge($info, $additionalInfo)) . PHP_EOL; }