2019-12-06 22:56:15 +01:00
|
|
|
<?php
|
|
|
|
|
2021-04-19 16:23:22 +02:00
|
|
|
namespace MVC\Command\Sand;
|
2021-02-10 14:16:03 +01:00
|
|
|
/**
|
|
|
|
* Class Cache
|
|
|
|
* Commande Système du Framework permettant de gérer le cache
|
2021-04-19 16:23:22 +02:00
|
|
|
* @package MVC\Command\Sand
|
2021-02-10 14:16:03 +01:00
|
|
|
*/
|
2020-12-08 09:28:12 +01:00
|
|
|
class Cache
|
2019-12-06 22:56:15 +01:00
|
|
|
{
|
2021-02-10 14:16:03 +01:00
|
|
|
/**
|
|
|
|
* Méthode permettant d'afficher l'aide de la commande
|
|
|
|
*/
|
2020-12-09 10:26:26 +01:00
|
|
|
public static function help()
|
|
|
|
{
|
2021-02-10 13:56:18 +01:00
|
|
|
print "Cette commande permet de vider le cache du framework\n\n";
|
|
|
|
print "Elle peut accepter les attributs suivants\n";
|
|
|
|
print "\t- clear : pour vider les logs et le cache des vues\n";
|
|
|
|
print "\t- stabilize : pour vider uniquement le cache des vues\n";
|
2019-12-06 22:56:15 +01:00
|
|
|
}
|
|
|
|
|
2020-12-09 10:26:26 +01:00
|
|
|
public static function clear()
|
|
|
|
{
|
2020-04-01 09:45:51 +02:00
|
|
|
$git_cache_rm = system('rm -f '.VIEW_PATH.'/cache/*', $git_cache_rm_retval);
|
|
|
|
print $git_cache_rm_retval;
|
|
|
|
$git_logs_rm = system('rm -f '.LOG_PATH.'/*', $git_logs_rm_retval);
|
|
|
|
print $git_logs_rm_retval;
|
|
|
|
|
|
|
|
print "logs && cache cleared ! \n\n";
|
2019-12-06 22:56:15 +01:00
|
|
|
}
|
|
|
|
|
2020-12-09 10:26:26 +01:00
|
|
|
public static function stabilize()
|
|
|
|
{
|
2020-04-01 09:45:51 +02:00
|
|
|
$git_cache_rm = system('rm -f '.VIEW_PATH.'/cache/*', $git_cache_rm_retval);
|
|
|
|
print $git_cache_rm_retval;
|
2019-12-06 22:56:15 +01:00
|
|
|
print "cache stabilized ! \n\n";
|
|
|
|
}
|
2020-12-09 10:26:26 +01:00
|
|
|
}
|