dolibarr 19.0.3
api_status.class.php
1<?php
2/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php';
19require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
20
21
28class Status extends DolibarrApi
29{
33 public function __construct()
34 {
35 global $db;
36 $this->db = $db;
37 }
38
44 public function index()
45 {
46 global $conf;
47
48 return array(
49 'success' => array(
50 'code' => 200,
51 'dolibarr_version' => DOL_VERSION,
52 'access_locked' => (!getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED') ? '0' : $conf->global->MAIN_ONLY_LOGIN_ALLOWED),
53 ),
54 );
55 }
56}
Class for API REST v1.
Definition api.class.php:31
__construct()
Constructor of the class.
index()
Get status (Dolibarr version)
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.