diff --git a/engine/Monstra.php b/engine/Monstra.php index 5f97605..58f4a96 100644 --- a/engine/Monstra.php +++ b/engine/Monstra.php @@ -177,12 +177,7 @@ class Monstra * Auto cleanup if MONSTRA_DEBUG is TRUE */ if (Monstra::$environment == Monstra::DEVELOPMENT) { - - // Cleanup minify - if (count($files = File::scan(MINIFY, array('css', 'js', 'php'))) > 0) foreach ($files as $file) File::delete(MINIFY . DS . $file); - - // Cleanup cache - if (count($namespaces = Dir::scan(CACHE)) > 0) foreach ($namespaces as $namespace) Dir::delete(CACHE . DS . $namespace); + Monstra::cleanTmp(); } /** @@ -292,6 +287,18 @@ class Monstra } } + + /** + * Clean Monstra TMP folder. + */ + public static function cleanTmp() + { + // Cleanup minify + if (count($files = File::scan(MINIFY, array('css', 'js', 'php'))) > 0) foreach ($files as $file) File::delete(MINIFY . DS . $file); + + // Cleanup cache + if (count($namespaces = Dir::scan(CACHE)) > 0) foreach ($namespaces as $namespace) Dir::delete(CACHE . DS . $namespace); + } /** * Initialize Monstra Engine