Skip to content
Snippets Groups Projects
Select Git revision
  • 8086295cb5112d35208894f371abcccb2d8d121b
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

UserManagement.class.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Request.class.php 23.27 KiB
    <?php
    # Lifter007: TODO
    /*
     * Request.php - class representing a HTTP request in Stud.IP
     *
     * Copyright (c) 2009  Elmar Ludwig
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License as
     * published by the Free Software Foundation; either version 2 of
     * the License, or (at your option) any later version.
     */
    
    /**
     * Singleton class representing a HTTP request in Stud.IP.
     */
    class Request implements ArrayAccess, IteratorAggregate
    {
        /**
         * cached request parameter array
         */
        private $params;
    
        /**
         * Initialize a new Request instance.
         */
        private function __construct()
        {
            $this->params = array_merge($_GET, $_POST);
        }
    
        /**
         * Return the Request singleton instance.
         */
        public static function getInstance()
        {
            static $instance;
    
            if (isset($instance)) {
                return $instance;
            }
    
            return $instance = new Request();
        }
    
        /**
         * ArrayAccess: Check whether the given offset exists.
         *
         * @todo Add bool return type when Stud.IP requires PHP8 minimal
         */
        #[ReturnTypeWillChange]
        public function offsetExists($offset)
        {
            return isset($this->params[$offset]);
        }
    
        /**
         * ArrayAccess: Get the value at the given offset.
         *
         * @todo Add mixed return type when Stud.IP requires PHP8 minimal
         */
        #[ReturnTypeWillChange]
        public function offsetGet($offset)
        {
            return $this->params[$offset] ?? null;
        }
    
        /**
         * ArrayAccess: Set the value at the given offset.
         *