dolibarr  19.0.0-dev
modSyslog.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
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 <https://www.gnu.org/licenses/>.
17  */
18 
28 include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
29 
34 {
35 
41  public function __construct($db)
42  {
43  $this->db = $db;
44  $this->numero = 42;
45 
46  // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
47  // It is used to group modules in module setup page
48  $this->family = "base";
49  // Module position in the family on 2 digits ('01', '10', '20', ...)
50  $this->module_position = '75';
51  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
52  $this->name = preg_replace('/^mod/i', '', get_class($this));
53  // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
54  $this->description = "Activate debug logs (syslog)";
55  // Can be enabled / disabled only in the main company
56  $this->core_enabled = 1;
57  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
58  $this->version = 'dolibarr';
59  // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
60  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
61  // Name of image file used for this module.
62  $this->picto = 'bug';
63 
64  // Data directories to create when module is enabled
65  $this->dirs = array();
66 
67  // Config pages
68  $this->config_page_url = array("syslog.php");
69 
70  // Dependencies
71  $this->hidden = false; // A condition to hide module
72  $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
73  $this->requiredby = array(); // List of module ids to disable if this one is disabled
74  $this->conflictwith = array(); // List of module class names as string this module is in conflict with
75  $this->phpmin = array(7, 0); // Minimum version of PHP required by module
76 
77  // Constants
78  $this->const = array();
79 
80  // Boxes
81  $this->boxes = array();
82 
83  // Permissions
84  $this->rights = array();
85  $this->rights_class = 'syslog';
86 
87  // Cronjobs
88  $comment = 'Compress and archive log files. The number of versions to keep is defined into the setup of module. ';
89  $comment .= 'Warning: Main application cron script must be run with same account than your web server to avoid to get log files with different owner than required by web server. ';
90  $comment .= 'Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission "rws" on this directory so log files will always have the group and permissions of the web server Operating System group.';
91 
92  $this->cronjobs = array(
93  0 => array(
94  'label' => 'CompressSyslogs',
95  'jobtype' => 'method',
96  'class' => 'core/class/utils.class.php',
97  'objectname' => 'Utils',
98  'method' => 'compressSyslogs',
99  'parameters' => '',
100  'comment' => $comment,
101  'frequency' => 1,
102  'unitfrequency' => 3600 * 24,
103  'priority' => 50,
104  'status' => 0,
105  'test' => true
106  )
107  );
108  }
109 }
Class DolibarrModules.
Class to enable/disable module Logs.
__construct($db)
Constructor.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:123