views_oai_pmh.module in Views OAI-PMH 6
File
views_oai_pmh.module
View source
<?php
define('OAI_TOKEN_LIFETIME', 24 * 3600);
function views_oai_pmh_init() {
module_load_include('inc', 'views_oai_pmh', 'theme/views_oai_pmh.theme');
}
function views_oai_pmh_views_api() {
return array(
'api' => 2,
);
}
function views_oai_pmh_theme() {
module_load_include('inc', 'views_oai_pmh', 'theme/views_oai_pmh.theme');
return array(
'oai_field_mapper_form' => array(
'file' => 'theme/views_oai_pmh.theme.inc',
'render element' => 'form',
),
);
}
function views_oai_pmh_cron() {
views_oai_pmh_garbage_collect();
}
function views_oai_pmh_garbage_collect() {
$cache_flush = time() - OAI_TOKEN_LIFETIME;
db_query("DELETE FROM {cache_views_oai_pmh} WHERE expire <= %d", $cache_flush);
}