2013-10-30 22:38:59 +01:00
|
|
|
<?php
|
|
|
|
require_once __DIR__ . '/../src/core.php';
|
|
|
|
|
2014-05-17 17:14:58 +02:00
|
|
|
Access::disablePrivilegeChecking();
|
2013-10-30 22:38:59 +01:00
|
|
|
|
|
|
|
array_shift($argv);
|
2014-06-01 13:41:08 +02:00
|
|
|
$query = join(' ', $argv);
|
2013-10-30 22:38:59 +01:00
|
|
|
|
2014-05-17 17:14:58 +02:00
|
|
|
$posts = PostSearchService::getEntities($query, null, null);
|
2013-10-30 22:38:59 +01:00
|
|
|
foreach ($posts as $post)
|
|
|
|
{
|
2014-06-01 14:38:40 +02:00
|
|
|
$info =
|
2013-10-30 22:38:59 +01:00
|
|
|
[
|
2014-05-17 17:14:58 +02:00
|
|
|
$post->getId(),
|
|
|
|
$post->getName(),
|
2014-06-01 14:38:40 +02:00
|
|
|
$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;
|
2013-10-30 22:38:59 +01:00
|
|
|
}
|