SAND-framework/console/command/sand/Cache.php

39 lines
1.1 KiB
PHP
Raw Normal View History

<?php
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
* @package MVC\Command\Sand
2021-02-10 14:16:03 +01:00
*/
class Cache
{
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";
}
2020-12-09 10:26:26 +01:00
public static function clear()
{
$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";
}
2020-12-09 10:26:26 +01:00
public static function stabilize()
{
$git_cache_rm = system('rm -f '.VIEW_PATH.'/cache/*', $git_cache_rm_retval);
print $git_cache_rm_retval;
print "cache stabilized ! \n\n";
}
2020-12-09 10:26:26 +01:00
}