2005-04-07 15:05:30 +02:00
< ? php
/* Copyright ( C ) 2004 - 2005 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2009-05-08 03:16:34 +02:00
* Copyright ( C ) 2004 - 2009 Laurent Destailleur < eldy @ users . sourceforge . net >
2005-04-07 15:05:30 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2005-04-07 15:05:30 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:24:38 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2005-04-07 15:05:30 +02:00
*/
/**
2009-05-08 03:16:34 +02:00
* \defgroup syslog Module syslog
* \brief Module pour gerer les messages d ' erreur dans syslog
2011-10-24 14:11:49 +02:00
* \file htdocs / core / modules / modSyslog . class . php
2009-05-08 03:16:34 +02:00
* \ingroup syslog
* \brief Fichier de description et activation du module de syslog
2008-10-01 21:10:17 +02:00
*/
2005-04-07 15:05:30 +02:00
2012-08-23 02:04:35 +02:00
include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php' ;
2005-04-07 15:05:30 +02:00
/**
2012-10-03 00:30:50 +02:00
* Class to enable / disable module Logs
2008-10-01 21:10:17 +02:00
*/
2005-04-07 15:05:30 +02:00
class modSyslog extends DolibarrModules
{
2008-10-01 21:10:17 +02:00
/**
2011-09-26 16:22:35 +02:00
* Constructor . Define names , constants , directories , boxes , permissions
*
2012-01-04 21:23:50 +01:00
* @ param DoliDB $db Database handler
2008-10-01 21:10:17 +02:00
*/
2012-07-30 17:17:33 +02:00
function __construct ( $db )
2008-10-01 21:10:17 +02:00
{
2012-01-04 21:23:50 +01:00
$this -> db = $db ;
$this -> numero = 42 ;
2008-10-01 21:10:17 +02:00
2009-05-08 03:16:34 +02:00
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this -> family = " base " ;
2018-01-25 17:53:02 +01:00
// Module position in the family on 2 digits ('01', '10', '20', ...)
$this -> module_position = '50' ;
2008-10-01 21:10:17 +02:00
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
2009-10-21 15:09:42 +02:00
$this -> name = preg_replace ( '/^mod/i' , '' , get_class ( $this ));
2009-05-08 03:16:34 +02:00
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this -> description = " Activate debug logs (syslog) " ;
// Can be enabled / disabled only in the main company
2018-03-16 00:16:32 +01:00
$this -> core_enabled = 1 ;
2009-05-08 03:16:34 +02:00
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
2017-08-22 18:34:58 +02:00
$this -> version = 'dolibarr' ;
2009-05-08 03:16:34 +02:00
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
2008-10-06 09:39:52 +02:00
$this -> const_name = 'MAIN_MODULE_' . strtoupper ( $this -> name );
2009-05-08 14:08:54 +02:00
// Name of image file used for this module.
2010-06-02 21:56:14 +02:00
$this -> picto = 'technic' ;
2008-10-01 21:10:17 +02:00
2009-04-29 17:02:40 +02:00
// Data directories to create when module is enabled
2008-10-01 21:10:17 +02:00
$this -> dirs = array ();
// Config pages
$this -> config_page_url = array ( " syslog.php " );
2015-09-07 15:29:51 +02:00
// Dependencies
2008-10-01 21:10:17 +02:00
$this -> depends = array ();
$this -> requiredby = array ();
2015-09-07 15:40:55 +02:00
// Constants
2008-10-01 21:10:17 +02:00
$this -> const = array ();
2015-09-07 15:46:57 +02:00
// Boxes
2008-10-01 21:10:17 +02:00
$this -> boxes = array ();
// Permissions
$this -> rights = array ();
$this -> rights_class = 'syslog' ;
2018-03-09 16:52:06 +01:00
// Cronjobs
$this -> cronjobs = array (
2018-03-21 13:56:24 +01:00
0 => array ( 'label' => 'CompressSyslogs' , 'jobtype' => 'method' , 'class' => 'core/class/utils.class.php' , 'objectname' => 'Utils' , 'method' => 'compressSyslogs' , 'parameters' => '' , 'comment' => 'Compress and archive log files' , 'frequency' => 1 , 'unitfrequency' => 3600 * 24 , 'priority' => 50 , 'status' => 0 , 'test' => true ),
2018-03-09 16:52:06 +01:00
);
2008-10-01 21:10:17 +02:00
}
2005-04-07 15:05:30 +02:00
}