CommunityID/scripts/clear_logs.php

34 lines
776 B
PHP
Raw Normal View History

2019-07-17 20:08:50 +00:00
<?php
/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/
/**
* This scripts clears the log entries older than the number of days set in the
* directive keep_history_days in config.ini
*
* Intended to be run by cron.
*/
define('APP_DIR', dirname(__FILE__) . '/../');
2019-07-17 20:16:19 +00:00
require APP_DIR . '/Application.php';
2019-07-17 20:08:50 +00:00
2019-07-17 20:16:19 +00:00
Application::setIncludePath();
Application::setAutoLoader();
Application::setConfig();
Application::setLogger();
Application::setDatabase();
2019-07-17 20:08:50 +00:00
require 'modules/default/models/Histories.php';
2019-07-17 20:16:19 +00:00
$histories = new Model_Histories();
2019-07-17 20:08:50 +00:00
$histories->clearOldEntries();
?>