From de9e434c2b1e606873beaee4d6e8b851a8f59fdb Mon Sep 17 00:00:00 2001 From: Matt Beckett Date: Tue, 19 Mar 2013 21:27:47 -0600 Subject: Allow logs to rotate without being deleted --- mod/logrotate/languages/en.php | 1 + mod/logrotate/start.php | 7 +++++-- mod/logrotate/views/default/plugins/logrotate/settings.php | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'mod/logrotate') diff --git a/mod/logrotate/languages/en.php b/mod/logrotate/languages/en.php index 27731d732..3af83e553 100644 --- a/mod/logrotate/languages/en.php +++ b/mod/logrotate/languages/en.php @@ -20,6 +20,7 @@ $english = array( 'logrotate:week' => 'week', 'logrotate:month' => 'month', 'logrotate:year' => 'year', + 'logrotate:never' => 'never', 'logrotate:logdeleted' => "Log deleted\n", 'logrotate:lognotdeleted' => "Error deleting log\n", diff --git a/mod/logrotate/start.php b/mod/logrotate/start.php index 28f14ad14..313cf1fd5 100644 --- a/mod/logrotate/start.php +++ b/mod/logrotate/start.php @@ -21,8 +21,11 @@ function logrotate_init() { // Register cron hook for archival of logs elgg_register_plugin_hook_handler('cron', $period, 'logrotate_archive_cron'); - // Register cron hook for deletion of selected archived logs - elgg_register_plugin_hook_handler('cron', $delete, 'logrotate_delete_cron'); + + if ($delete != 'never') { + // Register cron hook for deletion of selected archived logs + elgg_register_plugin_hook_handler('cron', $delete, 'logrotate_delete_cron'); + } } /** diff --git a/mod/logrotate/views/default/plugins/logrotate/settings.php b/mod/logrotate/views/default/plugins/logrotate/settings.php index bef8b308d..9fd3e08df 100644 --- a/mod/logrotate/views/default/plugins/logrotate/settings.php +++ b/mod/logrotate/views/default/plugins/logrotate/settings.php @@ -40,6 +40,7 @@ if (!$delete) { 'weekly' => elgg_echo('logrotate:week'), 'monthly' => elgg_echo('logrotate:month'), 'yearly' => elgg_echo('logrotate:year'), + 'never' => elgg_echo('logrotate:never'), ), 'value' => $delete, )); -- cgit v1.2.3