Completed
Branch develop (96aaeb)
by
unknown
31:19
created

modSyslog   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 57
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 48 1
1
<?php
2
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <[email protected]>
3
 * Copyright (C) 2004-2009 Laurent Destailleur  <[email protected]>
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
/**
20
 *	\defgroup   syslog  Module syslog
21
 *	\brief      Module pour gerer les messages d'erreur dans syslog
22
 *	\file       htdocs/core/modules/modSyslog.class.php
23
 *	\ingroup    syslog
24
 *	\brief      Fichier de description et activation du module de syslog
25
 */
26
27
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
28
29
/**
30
 *	Class to enable/disable module Logs
31
 */
32
class modSyslog extends DolibarrModules
33
{
34
35
	/**
36
	 *   Constructor. Define names, constants, directories, boxes, permissions
37
	 *
38
	 *   @param      DoliDB		$db      Database handler
39
	 */
40
	function __construct($db)
41
	{
42
		$this->db = $db;
43
		$this->numero = 42;
44
45
		// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
46
		// It is used to group modules in module setup page
47
		$this->family = "base";
48
		// Module position in the family on 2 digits ('01', '10', '20', ...)
49
		$this->module_position = '50';
50
		// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
51
		$this->name = preg_replace('/^mod/i','',get_class($this));
52
		// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
53
		$this->description = "Activate debug logs (syslog)";
54
		// Can be enabled / disabled only in the main company
55
		$this->core_enabled = true;
56
		// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
57
		$this->version = 'dolibarr';
58
		// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
59
		$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
60
		// Name of image file used for this module.
61
		$this->picto='technic';
62
63
		// Data directories to create when module is enabled
64
		$this->dirs = array();
65
66
		// Config pages
67
		$this->config_page_url = array("syslog.php");
68
69
		// Dependencies
70
		$this->depends = array();
71
		$this->requiredby = array();
72
73
		// Constants
74
		$this->const = array();
75
76
		// Boxes
77
		$this->boxes = array();
78
79
		// Permissions
80
		$this->rights = array();
81
		$this->rights_class = 'syslog';
82
83
		// Cronjobs
84
		$this->cronjobs = array(
85
		    0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true),
86
		);
87
	}
88
}
89