����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.144.23.53 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/ideyshare.name.ng/app/helpers/ |
Upload File : |
<?php namespace App\Helpers; use App\Core\Database; use App\Helpers\CoreHelper; use App\Helpers\FileHelper; use App\Helpers\FileServerHelper; use App\Models\File; use App\Models\User; /** * API V2 class for remote file management. * * See /api/v2/index.php for full usage details. */ class ApiV2Helper { public static function init($requestUrl, $origin) { // convert $requestUrl to path $requestUrl = trim(strip_tags($requestUrl)); $requestUrl = strtolower($requestUrl); $args = explode('/', rtrim($requestUrl, '/')); $endpoint = array_shift($args); // make sure endpoint exists, if so instantiate it $endPointClassPath = CORE_FRAMEWORK_SERVICES_ROOT . '/api/v2/endpoint/Api' . str_replace(' ', '', ucwords(str_replace('_', ' ', $endpoint))) . '.class.php'; if(!file_exists($endPointClassPath)) { header("HTTP/1.1 404 Not Found'"); return json_encode("No endpoint found for: " . $endpoint); } // include the endpoint include_once($endPointClassPath); // instantiae the object $className = 'App\Services\Api\V2\Endpoint\Api' . str_replace(' ', '', ucwords(str_replace('_', ' ', $endpoint))); $endPointInit = new $className($requestUrl, $origin); return $endPointInit; } public static function getApiUrl() { // load it from the config if we have it if (strlen(SITE_CONFIG_API_ACCESS_HOST)) { return SITE_CONFIG_API_ACCESS_HOST; } // fallback on the default return WEB_ROOT . '/api/v2/'; } }