<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; use Illuminate\Support\Facades\Route; use Illuminate\Support\Str; class Request { public static function path() { return \Illuminate\Support\Facades\Request::path(); } public static function basePath() { goto O9btJ; u1wwh: if (empty($ceAjB)) { $ceAjB = '/'; } else { if (!Str::startsWith($ceAjB, '/')) { $ceAjB = '/' . $ceAjB; } } goto LScpG; fYMG1: if (null !== $ceAjB) { return $ceAjB; } goto MBeye; MBeye: $ceAjB = \Illuminate\Support\Facades\Request::path(); goto u1wwh; O9btJ: static $ceAjB = null; goto fYMG1; LScpG: return $ceAjB; goto MO7kQ; MO7kQ: } public static function basePathWithQueries() { goto j5rEF; ZTyAL: if ($g5laZ = \Illuminate\Support\Facades\Request::getQueryString()) { $BV17G .= '?' . $g5laZ; } goto MOUe8; j5rEF: $BV17G = self::basePath(); goto ZTyAL; MOUe8: return $BV17G; goto inhBY; inhBY: } public static function currentPageUrl() { if (\Illuminate\Support\Facades\Request::ajax()) { $lQ_Us = \Illuminate\Support\Facades\Request::server('HTTP_REFERER'); } else { $lQ_Us = \Illuminate\Support\Facades\Request::fullUrl(); } return self::fixUrlSubdir($lQ_Us); } public static function currentPageUrlWithOutQueries() { return self::fixUrlSubdir(\Illuminate\Support\Facades\Request::url()); } private static function fixUrlSubdir($BV17G) { goto txpGr; txpGr: $LXlU7 = config('modstart.subdirUrl'); goto WhCnH; WhCnH: if ($LXlU7) { return str_replace(self::domainUrl(), rtrim($LXlU7, '/'), $BV17G); } goto LXVyA; LXVyA: return $BV17G; goto Pu9L_; Pu9L_: } public static function mergeQueries($pbDP2 = array()) { goto DRrbz; Ot2Qi: foreach ($pbDP2 as $U9AsU => $ohYVl) { $QvaI_[$U9AsU] = $ohYVl; } goto aKAtL; DRrbz: $QvaI_ = !empty($_GET) && is_array($_GET) ? $_GET : array(); goto Ot2Qi; iod7u: foreach ($QvaI_ as $U9AsU => $ohYVl) { goto auHOf; auHOf: if (null === $ohYVl) { continue; } goto CnQEu; jRUY1: $E4Lu_[] = "{$U9AsU}=" . $ohYVl; goto QYpUs; CnQEu: if (is_array($ohYVl)) { $ohYVl = $ohYVl[0]; } else { $ohYVl = urlencode($ohYVl); } goto jRUY1; QYpUs: } goto Pe3Xt; Pe3Xt: return join('&', $E4Lu_); goto lLBOi; aKAtL: $E4Lu_ = array(); goto iod7u; lLBOi: } public static function domain() { return \Illuminate\Support\Facades\Request::server('HTTP_HOST'); } public static function isSecurity() { return \Illuminate\Support\Facades\Request::secure(); } public static function schema() { goto wqm6M; wqm6M: static $xSuYc = null; goto FzsBr; FzsBr: if (null === $xSuYc) { if (\Illuminate\Support\Facades\Request::secure()) { $xSuYc = 'https'; } else { $xSuYc = 'http'; } } goto sC1UK; sC1UK: return $xSuYc; goto DNA6q; DNA6q: } public static function domainUrl($dvJEE = false) { goto irTg5; irTg5: $BV17G = self::schema() . '://' . self::domain(); goto PPlrU; Q5Lc4: return $BV17G; goto x_6Ij; PPlrU: if ($dvJEE) { return self::fixUrlSubdir($BV17G); } goto Q5Lc4; x_6Ij: } public static function isPost() { return \Illuminate\Support\Facades\Request::isMethod('post'); } public static function instance() { return \Illuminate\Support\Facades\Request::instance(); } public static function getControllerAction() { goto JXlHm; gs51B: if (isset($HGZG4[0])) { $clsTY = $HGZG4[0]; } else { $clsTY = null; } goto E57O7; v3OvK: if (empty($clsTY)) { return array(null, null); } goto iBbWS; JXlHm: $COAft = Route::currentRouteAction(); goto ak4zt; ak4zt: $HGZG4 = explode('@', $COAft); goto gs51B; iBbWS: if (!Str::startsWith($clsTY, '\\')) { $clsTY = '\\' . $clsTY; } goto neoYF; E57O7: if (isset($HGZG4[1])) { $TFjGK = $HGZG4[1]; } else { $TFjGK = null; } goto v3OvK; neoYF: return array($clsTY, $TFjGK); goto a5OrL; a5OrL: } public static function headerGet($m1RYi, $r3J4G = null) { return self::instance()->header($m1RYi, $r3J4G); } public static function headerSet($m1RYi, $tzAUI) { self::instance()->headers->set($m1RYi, $tzAUI); } public static function headerReferer() { return self::headerGet('referer'); } public static function headers() { return self::instance()->headers->all(); } public static function ip() { return self::instance()->ip(); } public static function server($TUuqF) { return self::instance()->server($TUuqF); } }