[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: class-kkart-cli-tool-command.php
File is not writable. Editing disabled.
<?php /** * KKART_CLI_Tool_Command class file. * * @package Kkart\CLI */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Hooks up our system status tools to the CLI. * * Forked from wp-cli/restful (by Daniel Bachhuber, released under the MIT license https://opensource.org/licenses/MIT). * https://github.com/wp-cli/restful * * @version 3.0.0 * @package Kkart */ class KKART_CLI_Tool_Command { /** * Registers just a 'list' and 'run' command to the KKART CLI * since we only want to enable certain actions on the system status * tools endpoints. */ public static function register_commands() { global $wp_rest_server; $request = new WP_REST_Request( 'OPTIONS', '/kkart/v2/system_status/tools' ); $response = $wp_rest_server->dispatch( $request ); $response_data = $response->get_data(); if ( empty( $response_data ) ) { return; } $parent = 'kkart tool'; $supported_commands = array( 'list', 'run' ); foreach ( $supported_commands as $command ) { $synopsis = array(); if ( 'run' === $command ) { $synopsis[] = array( 'name' => 'id', 'type' => 'positional', 'description' => __( 'The id for the resource.', 'kkart' ), 'optional' => false, ); $method = 'update_item'; $route = '/kkart/v2/system_status/tools/(?P<id>[\w-]+)'; } elseif ( 'list' === $command ) { $synopsis[] = array( 'name' => 'fields', 'type' => 'assoc', 'description' => __( 'Limit response to specific fields. Defaults to all fields.', 'kkart' ), 'optional' => true, ); $synopsis[] = array( 'name' => 'field', 'type' => 'assoc', 'description' => __( 'Get the value of an individual field.', 'kkart' ), 'optional' => true, ); $synopsis[] = array( 'name' => 'format', 'type' => 'assoc', 'description' => __( 'Render response in a particular format.', 'kkart' ), 'optional' => true, 'default' => 'table', 'options' => array( 'table', 'json', 'csv', 'ids', 'yaml', 'count', 'headers', 'body', 'envelope', ), ); $method = 'list_items'; $route = '/kkart/v2/system_status/tools'; } $before_invoke = null; if ( empty( $command_args['when'] ) && WP_CLI::get_config( 'debug' ) ) { $before_invoke = function() { kkart_maybe_define_constant( 'SAVEQUERIES', true ); }; } $rest_command = new KKART_CLI_REST_Command( 'system_status_tool', $route, $response_data['schema'] ); WP_CLI::add_command( "{$parent} {$command}", array( $rest_command, $method ), array( 'synopsis' => $synopsis, 'when' => ! empty( $command_args['when'] ) ? $command_args['when'] : '', 'before_invoke' => $before_invoke, ) ); } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.12 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A