Skip to content

Instantly share code, notes, and snippets.

@ilyautkin
Created April 6, 2022 10:21
Show Gist options
  • Save ilyautkin/fb326bbf121b6e593090b438bc83c313 to your computer and use it in GitHub Desktop.
Save ilyautkin/fb326bbf121b6e593090b438bc83c313 to your computer and use it in GitHub Desktop.
<?php
$modxminify = $modx->getService('modxminify','modxMinify', MODX_CORE_PATH . 'components/modxminify/model/modxminify/',[]);
$files = $modx->getCollection('modxMinifyFile');
$list = [];
foreach ($files as $file) {
if (empty($list[$file->group]) || !in_array($file->filename, $list[$file->group])) {
echo $file->filename . '<br>';
$list[$file->group][] = $file->filename;
} else {
$file->remove();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment