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

Intl.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 2.14 KiB


01  <?php
02  /**
03   * Zend Framework (http://framework.zend.com/)
04   *
05   * @link      http://github.com/zendframework/zf2 for the canonical source repository
06   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
07   * @license   http://framework.zend.com/license/new-bsd New BSD License
08   */
09   
10  namespace Zend\Stdlib\StringWrapper;
11   
12  use Zend\Stdlib\Exception;
13   
14  class Intl extends AbstractStringWrapper
15  {
16      /**
17       * List of supported character sets (upper case)
18       *
19       * @var string[]
20       */
21      protected static $encodings = array('UTF-8');
22   
23      /**
24       * Get a list of supported character encodings
25       *
26       * @return string[]
27       */
28      public static function getSupportedEncodings()
29      {
30          return static::$encodings;
31      }
32   
33      /**
34       * Constructor
35       *
36       * @throws Exception\ExtensionNotLoadedException
37       */
38      public function __construct()
39      {
40          if (!extension_loaded('intl')) {
41              throw new Exception\ExtensionNotLoadedException(
42                  'PHP extension "intl" is required for this wrapper'
43              );
44          }
45      }
46   
47      /**
48       * Returns the length of the given string
49       *
50       * @param string $str
51       * @return int|false
52       */
53      public function strlen($str)
54      {
55          return grapheme_strlen($str);
56      }
57   
58      /**
59       * Returns the portion of string specified by the start and length parameters
60       *
61       * @param string   $str
62       * @param int      $offset
63       * @param int|null $length
64       * @return string|false
65       */
66      public function substr($str, $offset = 0, $length = null)
67      {
68          // Due fix of PHP #62759 The third argument returns an empty string if is 0 or null.
69          if ($length !== null) {
70              return grapheme_substr($str, $offset, $length);
71          }
72   
73          return grapheme_substr($str, $offset);
74      }
75   
76      /**
77       * Find the position of the first occurrence of a substring in a string
78       *
79       * @param string $haystack
80       * @param string $needle
81       * @param int    $offset
82       * @return int|false
83       */
84      public function strpos($haystack, $needle, $offset = 0)
85      {
86          return grapheme_strpos($haystack, $needle, $offset);
87      }
88  }
89