Detect the current request informations

@return void
558964
protected function detectRequest()
    {
        $parseUrl = parse_url($this->serverValue('REQUEST_URI'));
        $scheme   = ($this->ssl === true) ? 'https' : 'http';

        $request = [
            'scheme'   => $scheme,
            'host'     => $this->serverValue('HTTP_HOST'),
            'port'     => $this->serverValue('SERVER_PORT'),
            'user'     => $this->serverValue('PHP_AUTH_USER'),
            'pass'     => $this->serverValue('PHP_AUTH_PW'),
            'path'     => '',
            'query'    => '',
            'fragment' => '',
        ];

        //Keep auto-convert to object. Less complexity for merge with array.
        $this->request = (object) array_merge($request, $parseUrl);
    }
1242474
public function getCurrentData()
        {
            $current_data = $this->session->getValue($this->key_name);

            return isset($current_data) ? $current_data : $current_data = array();
        }
1183828
protected function sniffStatus()
    {
        $this->status = "idle";
        ///// show /////
        if ($this->url->value('show' . $this->cid)) {
            $this->status = "show";
            $this->process_url = "";
            if (!$this->find($this->url->value('show' . $this->cid))) {
                $this->status = "unknow_record";
            }
            ///// modify /////
        } elseif ($this->url->value('modify' . $this->cid.'|update' . $this->cid)) {
            $this->status = "modify";
            $this->method = "patch";
            $this->process_url = $this->url->replace('modify' . $this->cid, 'update' . $this->cid)->get();
            if (!$this->find($this->url->value('modify' . $this->cid.'|update'. $this->cid))) {
                $this->status = "unknow_record";
            }
            ///// create /////
        } elseif ($this->url->value('show' . $this->cid . "|modify" . $this->cid . "|create" . $this->cid . "|delete" . $this->cid) === false) {
            $this->status = "create";
            $this->method = "post";
            $this->process_url = $this->url->append('insert' . $this->cid, 1)->get();
        } elseif ($this->url->value('create' . $this->cid)) {
            $this->status = "create";
            $this->method = "post";
            $this->process_url = $this->url->replace('create' . $this->cid, 'insert' . $this->cid)->get();
            ///// delete /////
        } elseif ($this->url->value('delete' . $this->cid)) {
            $this->status = "delete";
            $this->method = "delete";
            $this->process_url = $this->url->replace('delete' . $this->cid, 'do_delete' . $this->cid)->get();
            $this->undo_url = $this->url->replace('delete' . $this->cid, 'show' . $this->cid)->get();
            if (!$this->find($this->url->value('delete' . $this->cid))) {
                $this->status = "unknow_record";
            }
        } else {
            $this->status = "unknow_record";
        }
    }
501243
public function getCurrentRequestMethod()
    {
        if ($this->requestStack->getCurrentRequest() instanceof Request) {
            return $this->requestStack->getCurrentRequest()->getMethod();
        }
        return null;
    }
270365
protected function refresh_info()
    {

        $this->pid   = (int)getmypid();
        $this->gid   = (int)getmygid();
        $this->inode = (int)getmyinode();
        $this->uid   = (int)getmyuid();
        $this->user  = (string)get_current_user();
        $this->uname = posix_uname();

        return true;
    }
1072193
protected function currentUrlMatches()
    {
        if ($this->url() == Request::url()) { // If URLs are equal, always return true
            return true;
        }

        if ($this->activeUrlPattern) { // If pattern was set, see if it matches
            $pattern = ltrim(preg_replace('/\/\*/', '(/.*)?', $this->activeUrlPattern), '/');
            return preg_match("@^{$pattern}\z@", Request::path());
        }

        return false; // No match
    }
1090496
public function current()
    {
        return call_user_func(
            $this->fetchCallback,
            pg_fetch_array( $this->resource, $this->fetchRowNumber, $this->fetchType )
        );
    }
181205
public function getCurrentRequestContent()
    {
        if ($this->requestStack->getCurrentRequest() instanceof Request) {
            return $this->requestStack->getCurrentRequest()->getContent();
        }
        return null;
    }
113805
public function getStatus(): bool
    {
        foreach ($this->requestVersion() as $key => $version) {
            if (! Str::contains($key, 'dev')) {
                continue;
            }

            if (version_compare($version['version'], $this->currentVersion, '>')) {
                return true;
            }
        }

        return false;
    }
934929
public static function handleCurrentRequest() {
		try {
			CLIRoute::initialize();
			static::$mainRequest = static::generateFromEnvironment();
			$response = static::$mainRequest->process();
		} catch( \Exception $e ) {
			$response = CLIResponse::generateFromException($e);
		}
		$response->process();
		exit($response->getCode());
	}
529791
public function getStatus(): array
    {
        return [
            'url' => $this->request_url,
            'route' => $this->getCurrentRoute(),
            'ajax' => $this->ajax,
            'method' => $_SERVER['REQUEST_METHOD'],
            'format' => $this->format,
            'match' => $this->match
        ];
    }
925913
public function handleRequest(): self
    {
        if ($this->params->getBotParam('webhook.url')) {
            return $this->handleWebhook();
        }

        if ($loop_time = $this->getLoopTime()) {
            return $this->handleGetUpdatesLoop($loop_time, $this->getLoopInterval());
        }

        return $this->handleGetUpdates();
    }
1210473
protected function prepareRequest(): void
    {
        // HTTP method
        $method = Request::getMethod();
        $this->method = strtoupper($method);

        // get path
        // %module% / %controller% / %id% / %relation% / %id%
        $path = Router::getCleanUri();

        $this->params = explode('/', rtrim($path, '/'));

        // module
        $this->module = array_shift($this->params);

        // controller
        $this->controller = array_shift($this->params);

        $data = Request::getParams();

        unset($data['_method'], $data['_module'], $data['_controller']);

        $this->data = array_merge($data, $this->data);

        $primary = $this->crud->getPrimaryKey();

        $this->primary = array_intersect_key($this->data, array_flip($primary));
    }
187391
private function checkUserInfo() : void
    {
        foreach ($this->user->getAttributes() as $key => $value) {
            $this->{$key} = $value;
        }
    }
592991
protected function handleRequest(): void
    {
        $validator = Validator::make(
            $this->getAttribute('request')->only('rowsNumber', 'search', 'sortBy', 'sortDir'),
            [
                'rowsNumber' => 'required|numeric',
                'search'     => 'nullable|string',
                'sortBy'     => 'nullable|string|in:' . $this->getAttribute('columns')->implode('attribute', ','),
                'sortDir'    => 'nullable|string|in:asc,desc',
            ]
        );
        if ($validator->fails()) {
            $this->getAttribute('request')->merge([
                'rowsNumber' => $this->getAttribute('rowsNumber')
                    ? $this->getAttribute('rowsNumber')
                    : config('tablelist.value.rows_number'),
                'search'     => null,
                'sortBy'     => $this->getAttribute('sortBy'),
                'sortDir'    => $this->getAttribute('sortDir'),
            ]);
        } else {
            $this->setAttribute('rowsNumber', $this->getAttribute('request')->rowsNumber);
            $this->setAttribute('search', $this->getAttribute('request')->search);
        }
    }
154448
protected function detectOtherValues()
    {
        $this->totalPages = ceil($this->maxItems / $this->itemsPerPage);

        $this->half = floor($this->numberOfPageLinks / 2);
        $this->startPage = $this->currentPage - $this->half;

        if ($this->startPage < 1) {
            $this->startPage = 1;
        }

        $this->endPage = $this->startPage + $this->numberOfPageLinks - 1;

        if ($this->endPage > $this->totalPages) {
            $this->endPage = $this->totalPages;
        }
    }
1263054
public function notify()
    {
        if ($this->log()) {
            return;
        }
        if (PHP_SAPI == 'cli') {
            echo 'WARNING: '.$this->getMessage()."\n";
        } else if (
            Zend_Registry::get('config')->debug->firephp &&
            class_exists('FirePHP') &&
            FirePHP::getInstance() &&
            FirePHP::getInstance()->detectClientExtension()
        ) {
            p($this->getMessage(), 'WARNING');
        }
    }