-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelper.php
More file actions
79 lines (64 loc) · 1.83 KB
/
Copy pathHelper.php
File metadata and controls
79 lines (64 loc) · 1.83 KB
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
72
73
74
75
76
77
78
79
<?php
function random_num() {
rand(1000,5000);
}
function get_package_json() {
$start = false;
$jsondata = file_get_contents("c:\\xampp\\htdocs\\MyHealth-master\\package.json");
$jsonIterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator(json_decode($jsondata, TRUE)),
RecursiveIteratorIterator::SELF_FIRST);
foreach ($jsonIterator as $key => $val) {
if ($key == 'devDependencies')
{
$start = true;
}
if($start == true) {
if(is_array($val)) {
echo "packages\n";
} else {
print "$key => $val\n";
}
}
}
}
function get_package_json2($pkg) {
$jsondata = file_get_contents("c:\\xampp\\htdocs\\MyHealth-master\\package.json");//
//$jsondata = file_get_contents('/home/vagrant/sites/MyHealth-master/package.json');
$jsonIterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator(json_decode($jsondata, TRUE)),
RecursiveIteratorIterator::SELF_FIRST);
foreach ($jsonIterator as $key => $val) {
if ($key == $pkg) {
if(is_array($val)) {
echo "package\n";
} else {
print "$key => $val\n";
}
}
}
}
function cwd() {
echo getcwd() . "\n";
}
function php_ver()
{
print 'PHP => ' . phpversion();
}
function mysql_ver()
{
$ver = exec("mysql -V");
print('MySql Version => ' . substr($ver,24,7));
}
function mysql_db_ver()
{
$results = DB::select( DB::raw('SHOW VARIABLES LIKE "version"') );
$test = json_encode($results);
$test2 = strrchr($test,":");
// var_dump($test2);
$len = strlen($test2);
$pos = strpos($test2,"}");
$test3 = substr($test2,1,$pos-1);
echo 'MySql => ' . $test3;
echo '';
}