dolibarr
25.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
Examples
File List
File Members
dolibarr_dev
htdocs
api
class
api_status.class.php
1
<?php
2
/*
3
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
4
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
5
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19
*/
20
21
require_once DOL_DOCUMENT_ROOT.
'/api/class/api.class.php'
;
22
23
30
class
Status
extends
DolibarrApi
31
{
35
public
function
__construct
()
36
{
37
global $db;
38
$this->db = $db;
39
}
40
48
public
function
index
()
49
{
50
global $dolibarr_main_prod;
51
52
$response = array(
53
'success'
=> array(
54
'code'
=> 200,
55
'dolibarr_version'
=> DOL_VERSION,
56
'access_locked'
=>
getDolGlobalString
(
'MAIN_ONLY_LOGIN_ALLOWED'
,
'0'
),
57
),
58
);
59
60
if
(empty($dolibarr_main_prod)) {
61
$response[
'success'
][
'environment'
] =
'non-production'
;
62
$response[
'success'
][
'timestamp_now_utc'
] =
dol_now
();
63
$response[
'success'
][
'timestamp_php_tz'
] = date_default_timezone_get();
64
$response[
'success'
][
'date_tz'
] =
dol_print_date
(
dol_now
(
'gmt'
),
'standard'
);
65
}
66
67
return
$response;
68
}
69
}
DolibarrApi
Class for API REST v1.
Definition
api.class.php:35
Status
Definition
api_status.class.php:31
Status\__construct
__construct()
Constructor of the class.
Definition
api_status.class.php:35
Status\index
index()
Get status (Dolibarr version)
Definition
api_status.class.php:48
dol_now
dol_now($mode='gmt')
Return date for now.
Definition
functions.lib.php:3258
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
Definition
functions.lib.php:2847
getDolGlobalString
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
Definition
functions.lib.php:324
Generated on Thu Oct 1 2026 01:00:15 for
dolibarr
by Doxygen 1.11.0