phpthumbofcachemanager.plugin.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * Handles cache cleanup
  4. * pThumb
  5. * Copyright 2013 Jason Grant
  6. *
  7. * Please see the GitHub page for documentation or to report bugs:
  8. * https://github.com/oo12/phpThumbOf
  9. *
  10. * pThumb is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the Free
  12. * Software Foundation; either version 2 of the License, or (at your option) any
  13. * later version.
  14. *
  15. * pThumb is distributed in the hope that it will be useful, but WITHOUT ANY
  16. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  17. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along with
  20. * phpThumbOf; if not, write to the Free Software Foundation, Inc., 59 Temple
  21. * Place, Suite 330, Boston, MA 02111-1307 USA
  22. */
  23. if ($modx->event->name === 'OnSiteRefresh') {
  24. if (!$modx->loadClass('pThumbCacheCleaner', MODX_CORE_PATH . 'components/phpthumbof/model/', true, true)) {
  25. $modx->log(modX::LOG_LEVEL_ERROR, '[pThumb] Could not load pThumbCacheCleaner class.');
  26. return;
  27. }
  28. static $pt_settings = array();
  29. $pThumb = new pThumbCacheCleaner($modx, $pt_settings, array(), true);
  30. $pThumb->cleanCache();
  31. }