-
Notifications
You must be signed in to change notification settings - Fork 2
/
modGetVersion.php
71 lines (65 loc) · 2.55 KB
/
modGetVersion.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/*
* Pharinix Copyright (C) 2015 Pedro Pelaez <aaaaa976@gmail.com>
* Sources https://github.com/PSF1/pharinix
*
* 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 the Free Software Foundation; either version 2
* of the License, or (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
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
if (!defined("CMS_VERSION")) { header("HTTP/1.0 404 Not Found"); die(""); }
if (!class_exists("commandModGetVersion")) {
class commandModGetVersion extends driverCommand {
public static function runMe(&$params, $debug = true) {
$params = array_merge(array(
'name' => ''
), $params);
$sql = 'select `version` from `node_modules` where `title` = \''.$params['name'].'\'';
$resp = '';
$q = dbConn::get()->Execute($sql);
if (!$q->EOF) {
$resp = $q->fields['version'];
}
return array('ver' => $resp);
}
public static function getHelp() {
return array(
"package" => 'core',
"description" => __("Get the version of a module."),
"parameters" => array(
"name" => __("Module name."),
),
"response" => array(
"ver" => __("Module version."),
),
"type" => array(
"parameters" => array(
"name" => "string",
),
"response" => array(
"ver" => "string",
),
),
"echo" => false
);
}
public static function getAccess($ignore = "") {
$me = __FILE__;
return parent::getAccess($me);
}
public static function getAccessFlags() {
return driverUser::PERMISSION_FILE_ALL_EXECUTE;
}
}
}
return new commandModGetVersion();