#!/usr/bin/env php
<?php
/**
 * Copyright 2002-2017 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (BSD). If you
 * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
 *
 * @author Chuck Hagenbuch <chuck@horde.org>
 */

if (file_exists(__DIR__ . '/../../hermes/lib/Application.php')) {
    $baseDir = __DIR__ . '/../';
} else {
    require_once 'PEAR/Config.php';
    $baseDir = PEAR_Config::singleton()
        ->get('horde_dir', null, 'pear.horde.org') . '/hermes/';
}
require_once $baseDir . 'lib/Application.php';
Horde_Registry::appInit('hermes', array('cli' => true));

printf(_("Deleting data that was exported/billed more than %s days ago.\n"), $conf['time']['days_to_keep']);
$GLOBALS['injector']->getInstance('Hermes_Driver')->purge();
