aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-03-20 17:46:50 -0700
committerCash Costello <cash.costello@gmail.com>2013-03-20 17:46:50 -0700
commit866c7ec71b9c2ef24cde71d03f52501c6ccad086 (patch)
tree7614401eabf8323de9978fc132d2c2421abacce9
parent45cf92ffe7ae503c5fea447dba1f1ab9815f4f7f (diff)
parentde9e434c2b1e606873beaee4d6e8b851a8f59fdb (diff)
downloadelgg-866c7ec71b9c2ef24cde71d03f52501c6ccad086.tar.gz
elgg-866c7ec71b9c2ef24cde71d03f52501c6ccad086.tar.bz2
Merge pull request #5254 from beck24/log-rotate-no-delete
Allow logs to rotate without being deleted
-rw-r--r--mod/logrotate/languages/en.php1
-rw-r--r--mod/logrotate/start.php7
-rw-r--r--mod/logrotate/views/default/plugins/logrotate/settings.php1
3 files changed, 7 insertions, 2 deletions
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,
));