Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Antoine
ae2
Commits
1033e91e
Commit
1033e91e
authored
Aug 01, 2007
by
Ayolo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hourly cron
parent
c2d0f1de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
phpcron/hourly.php
phpcron/hourly.php
+35
-0
No files found.
phpcron/hourly.php
0 → 100644
View file @
1033e91e
<?php
/*
* hourly
*/
$topdir
=
"../"
;
define
(
'MAGPIE_CACHE_DIR'
,
'/var/www/ae/www/var/cache/planet/'
);
define
(
'MAGPIE_CACHE_ON'
,
true
);
define
(
'MAGPIE_CACHE_AGE'
,
50
*
60
);
//50minutes pour etre certain d'avoir un truc à jour :)
define
(
'MAGPIE_OUTPUT_ENCODING'
,
"UTF-8"
);
define
(
'MAX_NUM'
,
20
);
define
(
'MAX_SUM_LENGHT'
,
200
);
require_once
(
$topdir
.
"include/site.inc.php"
);
require_once
(
$topdir
.
"include/lib/magpierss/rss_fetch.inc.php"
);
$site
=
new
site
();
// Tâche 1 : mettre à jour le cache
$req
=
new
requete
(
$site
->
db
,
"SELECT `url` FROM `planet_flux` WHERE `modere`='1'"
);
while
(
list
(
$url
)
=
$req
->
get_row
()
)
$rs
=
fetch_rss
(
$flux
[
$id_flux
][
'url_flux'
]);
// Tâche 1 : nettoyage du cache
$cache
=
opendir
(
MAGPIE_CACHE_DIR
);
while
(
$file
=
readdir
(
$cache
))
if
(
is_file
(
MAGPIE_CACHE_DIR
.
$file
)
&&
filemtime
(
MAGPIE_CACHE_DIR
.
$file
)
<
(
time
()
-
MAGPIE_CACHE_AGE
)
)
unlink
(
MAGPIE_CACHE_DIR
.
$file
);
closedir
(
$cache
);
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment