Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

Parameters.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 2.37 KiB


 001  <?php
 002  /**
 003   * Zend Framework (http://framework.zend.com/)
 004   *
 005   * @link      http://github.com/zendframework/zf2 for the canonical source repository
 006   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 007   * @license   http://framework.zend.com/license/new-bsd New BSD License
 008   */
 009   
 010  namespace Zend\Stdlib;
 011   
 012  use ArrayObject as PhpArrayObject;
 013   
 014  class Parameters extends PhpArrayObject implements ParametersInterface
 015  {
 016      /**
 017       * Constructor
 018       *
 019       * Enforces that we have an array, and enforces parameter access to array
 020       * elements.
 021       *
 022       * @param  array $values
 023       */
 024      public function __construct(array $values = null)
 025      {
 026          if (null === $values) {
 027              $values = array();
 028          }
 029          parent::__construct($values, ArrayObject::ARRAY_AS_PROPS);
 030      }
 031   
 032      /**
 033       * Populate from native PHP array
 034       *
 035       * @param  array $values
 036       * @return void
 037       */
 038      public function fromArray(array $values)
 039      {
 040          $this->exchangeArray($values);
 041      }
 042   
 043      /**
 044       * Populate from query string
 045       *
 046       * @param  string $string
 047       * @return void
 048       */
 049      public function fromString($string)
 050      {
 051          $array = array();
 052          parse_str($string, $array);
 053          $this->fromArray($array);
 054      }
 055   
 056      /**
 057       * Serialize to native PHP array
 058       *
 059       * @return array
 060       */
 061      public function toArray()
 062      {
 063          return $this->getArrayCopy();
 064      }
 065   
 066      /**
 067       * Serialize to query string
 068       *
 069       * @return string
 070       */
 071      public function toString()
 072      {
 073          return http_build_query($this);
 074      }
 075   
 076      /**
 077       * Retrieve by key
 078       *
 079       * Returns null if the key does not exist.
 080       *
 081       * @param  string $name
 082       * @return mixed
 083       */
 084      public function offsetGet($name)
 085      {
 086          if ($this->offsetExists($name)) {
 087              return parent::offsetGet($name);
 088          }
 089          return;
 090      }
 091   
 092      /**
 093       * @param string $name
 094       * @param mixed $default optional default value
 095       * @return mixed
 096       */
 097      public function get($name, $default = null)
 098      {
 099          if ($this->offsetExists($name)) {
 100              return parent::offsetGet($name);
 101          }
 102          return $default;
 103      }
 104   
 105      /**
 106       * @param string $name
 107       * @param mixed $value
 108       * @return Parameters
 109       */
 110      public function set($name, $value)
 111      {
 112          $this[$name] = $value;
 113          return $this;
 114      }
 115  }
 116