-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.php
More file actions
29 lines (23 loc) · 913 Bytes
/
Copy pathexample.php
File metadata and controls
29 lines (23 loc) · 913 Bytes
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
<?php
/**
* Demonstrate hos to use the cp_eximstats_query.pl script
*
* This script was made to be executed from cPanel shell. Make sure the
* installed PHP executable have access to the "system()" function. If not,
* must enable the function.
*
* @author Astral Internet inc <info@astralinternet.com>
* @link https://github.com/AstralInternet/query_cpanel_eximstats_sqlite
*/
# Full path to the script.
$script = "/root/cp_eximstats_query.pl";
# Build a query to list all tables within the Eximstats SQLite database.
$query = "SELECT name FROM sqlite_master WHERE type='table'";
# Build the command for the Perl script.
$command = "perl " . $script . ' "' . $query . '"';
# Call the Perl script to get the result in a json format.
$json_records = json_encode(system($command));
echo "\n";
echo "\033[1;32mBold Php Output:\033[0m \n";
echo "\033[32m". $json_records . "\033[0m \n";
?>