0ef5f1b46d
- No random chdir() calls - No more exceptions when executing scripts from dirs other than root - find-posts.php prints absolute paths making piping more useful
26 lines
444 B
PHP
26 lines
444 B
PHP
<?php
|
|
require_once __DIR__ . '/../src/core.php';
|
|
|
|
function usage()
|
|
{
|
|
echo 'Usage: ' . basename(__FILE__);
|
|
echo ' QUERY' . PHP_EOL;
|
|
return true;
|
|
}
|
|
|
|
array_shift($argv);
|
|
if (empty($argv))
|
|
usage() and die;
|
|
|
|
$query = array_shift($argv);
|
|
$posts = Model_Post::getEntities($query, null, null);
|
|
foreach ($posts as $post)
|
|
{
|
|
echo implode("\t",
|
|
[
|
|
$post->id,
|
|
$post->name,
|
|
Model_Post::getFullPath($post->name),
|
|
$post->mimeType,
|
|
]). PHP_EOL;
|
|
}
|