mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-03 19:57:57 +02:00
Update engine/Monstra.php
New static method cleanTmp() added.
This commit is contained in:
@@ -177,12 +177,7 @@ class Monstra
|
|||||||
* Auto cleanup if MONSTRA_DEBUG is TRUE
|
* Auto cleanup if MONSTRA_DEBUG is TRUE
|
||||||
*/
|
*/
|
||||||
if (Monstra::$environment == Monstra::DEVELOPMENT) {
|
if (Monstra::$environment == Monstra::DEVELOPMENT) {
|
||||||
|
Monstra::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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -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
|
* Initialize Monstra Engine
|
||||||
|
Reference in New Issue
Block a user