2014-10-17 19:47:27 +02:00
|
|
|
<?php
|
|
|
|
require_once(__DIR__
|
2015-06-28 12:25:35 +02:00
|
|
|
. DIRECTORY_SEPARATOR . '..'
|
|
|
|
. DIRECTORY_SEPARATOR . 'src'
|
|
|
|
. DIRECTORY_SEPARATOR . 'Bootstrap.php');
|
2014-10-17 19:47:27 +02:00
|
|
|
|
|
|
|
use Szurubooru\Injector;
|
|
|
|
use Szurubooru\Dao\PublicFileDao;
|
|
|
|
use Szurubooru\Dao\PostDao;
|
|
|
|
use Szurubooru\Services\PostThumbnailService;
|
|
|
|
|
|
|
|
$size = isset($argv[1]) ? $argv[1] : 160;
|
|
|
|
|
|
|
|
$postDao = Injector::get(PostDao::class);
|
|
|
|
$postThumbnailService = Injector::get(PostThumbnailService::class);
|
|
|
|
|
2014-10-25 20:43:25 +02:00
|
|
|
foreach (array_reverse($postDao->findAll()) as $post)
|
2014-10-17 19:47:27 +02:00
|
|
|
{
|
2015-06-28 12:25:35 +02:00
|
|
|
try
|
|
|
|
{
|
|
|
|
$thumbnailName = $postThumbnailService->generateIfNeeded($post, $size, $size);
|
|
|
|
echo '.';
|
|
|
|
}
|
|
|
|
catch (Exception $e)
|
|
|
|
{
|
|
|
|
echo PHP_EOL . $post->getId() . ': ' . $e->getMessage() . PHP_EOL;
|
|
|
|
}
|
2014-10-17 19:47:27 +02:00
|
|
|
}
|
|
|
|
echo PHP_EOL;
|