szurubooru/scripts/find-posts.php
2014-06-01 13:41:08 +02:00

19 lines
359 B
PHP

<?php
require_once __DIR__ . '/../src/core.php';
Access::disablePrivilegeChecking();
array_shift($argv);
$query = join(' ', $argv);
$posts = PostSearchService::getEntities($query, null, null);
foreach ($posts as $post)
{
echo implode("\t",
[
$post->getId(),
$post->getName(),
$post->tryGetWorkingFullPath(),
$post->getMimeType(),
]). PHP_EOL;
}