summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/file.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index fb4809164..cea976dc5 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -255,12 +255,13 @@ class File extends CI_Controller {
$this->file_mod->show_url($id, $extension);
}
+ /* Functions below this comment can only be run via the CLI
+ * `php index.php file <function name>`
+ */
+
// Removes old files
function cron()
{
- /* cron can only be run via the CLI
- * `php index.php file cron`
- */
if (!$this->input->is_cli_request()) return;
if ($this->config->item('upload_max_age') == 0) return;
@@ -286,9 +287,12 @@ class File extends CI_Controller {
}
}
}
+ }
+
+ /* remove files without database entries */
+ function clean_stale_files() {
+ if (!$this->input->is_cli_request()) return;
- /* remove files without database entries */
- // TODO: put into a function
$upload_path = $this->config->item("upload_path");
$outer_dh = opendir($upload_path);