ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
hook_cron.php
Go to the documentation of this file.
1
<?
php
2
3
/*
4
* Copyright (c) 2012 The University of Queensland
5
*
6
* Permission to use, copy, modify, and distribute this software for any
7
* purpose with or without fee is hereby granted, provided that the above
8
* copyright notice and this permission notice appear in all copies.
9
*
10
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
19
/*
20
* Written by David Gwynne <dlg@uq.edu.au> as part of the IT
21
* Infrastructure Group in the Faculty of Engineering, Architecture
22
* and Information Technology.
23
*/
24
25
31
function
riak_hook_cron
(&
$croninfo
) {
32
assert(is_array(
$croninfo
));
33
assert(array_key_exists(
'summary'
,
$croninfo
));
34
assert(array_key_exists(
'tag'
,
$croninfo
));
35
36
if
(
$croninfo
[
'tag'
] !==
'hourly'
)
return
;
37
38
try
{
39
$store
=
new
sspmod_riak_Store_Store
();
40
$result
=
$store
->bucket->indexSearch(
'expires'
,
'int'
,
41
1, time() - 30);
42
foreach
(
$result
as $link) {
43
$link->getBinary()->delete();
44
}
45
46
SimpleSAML\Logger::info
(sprintf(
"deleted %s riak key%s"
,
47
sizeof
(
$result
),
sizeof
(
$result
) == 1 ?
''
:
's'
));
48
}
catch
(
Exception
$e) {
49
$message
=
'riak threw exception: '
. $e->getMessage();
50
SimpleSAML\Logger::warning
(
$message
);
51
$croninfo
[
'summary'
][] =
$message
;
52
}
53
}
$result
$result
Definition:
CleanUpTest.php:463
$croninfo
$croninfo
Definition:
cron.php:23
$store
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Definition:
getUserInfo.php:11
SimpleSAML\Logger\info
static info($string)
Definition:
Logger.php:199
$message
catch(Exception $e) $message
Definition:
saml2-logout.php:34
SimpleSAML\Logger\warning
static warning($string)
Definition:
Logger.php:177
php
riak_hook_cron
riak_hook_cron(&$croninfo)
Hook to run a cron job.
Definition:
hook_cron.php:31
sspmod_riak_Store_Store
Definition:
Store.php:25
Exception
libs
composer
vendor
simplesamlphp
simplesamlphp
modules
riak
hooks
hook_cron.php
Generated on Thu Jan 16 2025 19:01:56 for ILIAS by
1.8.13 (using
Doxyfile
)