Created
March 26, 2016 11:57
-
-
Save av-jok/4bd0af3f854155a95d5b to your computer and use it in GitHub Desktop.
modx recreate TicketFile previews
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('MODX_API_MODE', true); | |
$modx->getService('error','error.modError'); | |
$modx->setLogLevel(modX::LOG_LEVEL_ERROR); | |
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); | |
$modx->addPackage('Tickets', MODX_CORE_PATH . 'components/tickets/model/'); | |
$files = $modx->getIterator('TicketFile'); | |
foreach ($files as $file) { | |
$file->set('thumbs', null); | |
$file->save(); | |
$file->generateThumbnail(); | |
$file->save(); | |
} | |
echo microtime(true) - $modx->startTime; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment