Skip to content

Commit

Permalink
Changed output of find-posts script
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Kurczewski committed Jun 1, 2014
1 parent e32e569 commit 2c7f11e
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions scripts/find-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 2c7f11e

Please sign in to comment.