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
e96eb867
Commit
e96eb867
authored
Aug 09, 2007
by
Feu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
galaxy hourly
parent
257010e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
include/galaxy.inc.php
include/galaxy.inc.php
+2
-0
phpcron/hourly.php
phpcron/hourly.php
+22
-21
No files found.
include/galaxy.inc.php
View file @
e96eb867
...
...
@@ -30,6 +30,8 @@ define("GALAXY_SCORE_PARRAINAGE",15);
define
(
"GALAXY_SCORE_1PTJOURSASSO"
,
75
);
define
(
"GALAXY_MINSCORE"
,
10
);
setlocale
(
LC_NUMERIC
,
"en_US"
);
class
galaxy
{
var
$db
;
...
...
phpcron/hourly.php
View file @
e96eb867
...
...
@@ -4,40 +4,27 @@
* hourly
*/
$topdir
=
"../"
;
$_SERVER
[
'SCRIPT_FILENAME'
]
=
"/var/www/ae/www/ae2/phpcron"
;
require_once
(
$topdir
.
"include/site.inc.php"
);
$site
=
new
site
();
// Tâche 2 [galaxy] : màj, et cycles
require_once
(
$topdir
.
"include/galaxy.inc.php"
);
$galaxy
=
new
galaxy
(
$site
->
db
,
$site
->
dbrw
);
$galaxy
->
update
();
for
(
$i
=
0
;
$i
<
45
;
$i
++
)
// Environs 1100 cycles/jours
$galaxy
->
cycle
();
print_r
(
$galaxy
);
$galaxy
->
mini_render
(
$topdir
.
"var/mini_galaxy.png"
);
print_r
(
$galaxy
);
// Tâche 1 [planet]
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
);
$_SERVER
[
'SCRIPT_FILENAME'
]
=
"/var/www/ae/www/ae2/phpcron"
;
require_once
(
$topdir
.
"include/site.inc.php"
);
require_once
(
$topdir
.
"include/lib/magpierss/rss_fetch.inc.php"
);
$site
=
new
site
();
// Tâche 1 [planet] : 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
(
$url
);
// Tâche 1 [planet] : nettoyage du cache
$cache
=
opendir
(
MAGPIE_CACHE_DIR
);
while
(
$file
=
readdir
(
$cache
))
...
...
@@ -46,5 +33,19 @@ while ($file = readdir($cache))
closedir
(
$cache
);
// Tâche 2 [galaxy] : màj, et cycles
require_once
(
$topdir
.
"include/galaxy.inc.php"
);
$galaxy
=
new
galaxy
(
$site
->
db
,
$site
->
dbrw
);
$galaxy
->
update
();
for
(
$i
=
0
;
$i
<
45
;
$i
++
)
// Environs 1100 cycles/jours
$galaxy
->
cycle
();
$galaxy
->
mini_render
(
$topdir
.
"var/mini_galaxy.png"
);
?>
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