ryxeo-glpi-git / front / cron.php @ b67d8923
Historique | Voir | Annoter | Télécharger (2,79 ko)
1 | b67d8923 | Eric Seigne | <?php
|
---|---|---|---|
2 | /*
|
||
3 | * @version $Id: cron.php 7763 2009-01-06 18:44:50Z moyo $
|
||
4 | -------------------------------------------------------------------------
|
||
5 | GLPI - Gestionnaire Libre de Parc Informatique
|
||
6 | Copyright (C) 2003-2009 by the INDEPNET Development Team.
|
||
7 | |||
8 | http://indepnet.net/ http://glpi-project.org
|
||
9 | -------------------------------------------------------------------------
|
||
10 | |||
11 | LICENSE
|
||
12 | |||
13 | This file is part of GLPI.
|
||
14 | |||
15 | GLPI is free software; you can redistribute it and/or modify
|
||
16 | it under the terms of the GNU General Public License as published by
|
||
17 | the Free Software Foundation; either version 2 of the License, or
|
||
18 | (at your option) any later version.
|
||
19 | |||
20 | GLPI is distributed in the hope that it will be useful,
|
||
21 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
23 | GNU General Public License for more details.
|
||
24 | |||
25 | You should have received a copy of the GNU General Public License
|
||
26 | along with GLPI; if not, write to the Free Software
|
||
27 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||
28 | --------------------------------------------------------------------------
|
||
29 | */
|
||
30 | |||
31 | // ----------------------------------------------------------------------
|
||
32 | // Original Author of file: JMD
|
||
33 | // Purpose of file:
|
||
34 | // ----------------------------------------------------------------------
|
||
35 | |||
36 | // Ensure current directory when run from crontab
|
||
37 | chdir(dirname($_SERVER["SCRIPT_FILENAME"])); |
||
38 | |||
39 | $NEEDED_ITEMS=array("cron","computer","device","printer","networking","peripheral","monitor","setup", |
||
40 | "software","infocom","phone","tracking","enterprise","ocsng","mailgate","rulesengine","rule.tracking","rule.softwarecategories","rule.ocs", |
||
41 | "user","reservation","reminder","admininfo","group","mailing","document","rule.dictionnary.software","rule.dictionnary.dropdown","registry"); |
||
42 | define('GLPI_ROOT', '..'); |
||
43 | include (GLPI_ROOT . "/inc/includes.php"); |
||
44 | |||
45 | |||
46 | if (!is_writable(GLPI_LOCK_DIR)) { |
||
47 | echo "\tERROR : " .GLPI_LOCK_DIR. " not writable\n"; |
||
48 | echo "\trun script as 'apache' user\n"; |
||
49 | exit (1); |
||
50 | } |
||
51 | |||
52 | if (!isCommandLine()) {
|
||
53 | //The advantage of using background-image is that cron is called in a separate
|
||
54 | //request and thus does not slow down output of the main page as it would if called
|
||
55 | //from there.
|
||
56 | $image = pack("H*", "47494638396118001800800000ffffff00000021f90401000000002c0000000018001800000216848fa9cbed0fa39cb4da8bb3debcfb0f86e248965301003b"); |
||
57 | header("Content-Type: image/gif"); |
||
58 | header("Content-Length: ".strlen($image)); |
||
59 | header("Cache-Control: no-cache,no-store"); |
||
60 | header("Pragma: no-cache"); |
||
61 | header("Connection: close"); |
||
62 | echo $image; |
||
63 | flush();
|
||
64 | } |
||
65 | |||
66 | //Definitions possibles des taches directement en passant un array (rappel les taches appellent des fonctions cron_matache() )
|
||
67 | //$taches=array("test"=>30,"test2"=>10);
|
||
68 | //$cron=new Cron($taches);
|
||
69 | |||
70 | $cron=new Cron(); |
||
71 | $cron->launch();
|
||
72 | |||
73 | ?> |