Mercurial > hg > cmmr2012-drupal-site
comparison vendor/zendframework/zend-stdlib/src/Glob.php @ 2:5311817fb629
Theme updates
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 13:19:18 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
1:0b0e5f3b1e83 | 2:5311817fb629 |
---|---|
36 * @return array | 36 * @return array |
37 * @throws Exception\RuntimeException | 37 * @throws Exception\RuntimeException |
38 */ | 38 */ |
39 public static function glob($pattern, $flags = 0, $forceFallback = false) | 39 public static function glob($pattern, $flags = 0, $forceFallback = false) |
40 { | 40 { |
41 if (!defined('GLOB_BRACE') || $forceFallback) { | 41 if (! defined('GLOB_BRACE') || $forceFallback) { |
42 return static::fallbackGlob($pattern, $flags); | 42 return static::fallbackGlob($pattern, $flags); |
43 } | 43 } |
44 | 44 |
45 return static::systemGlob($pattern, $flags); | 45 return static::systemGlob($pattern, $flags); |
46 } | 46 } |
94 * @return array | 94 * @return array |
95 * @throws Exception\RuntimeException | 95 * @throws Exception\RuntimeException |
96 */ | 96 */ |
97 protected static function fallbackGlob($pattern, $flags) | 97 protected static function fallbackGlob($pattern, $flags) |
98 { | 98 { |
99 if (!$flags & self::GLOB_BRACE) { | 99 if (! $flags & self::GLOB_BRACE) { |
100 return static::systemGlob($pattern, $flags); | 100 return static::systemGlob($pattern, $flags); |
101 } | 101 } |
102 | 102 |
103 $flags &= ~self::GLOB_BRACE; | 103 $flags &= ~self::GLOB_BRACE; |
104 $length = strlen($pattern); | 104 $length = strlen($pattern); |
180 $length = strlen($pattern); | 180 $length = strlen($pattern); |
181 $depth = 0; | 181 $depth = 0; |
182 $current = $begin; | 182 $current = $begin; |
183 | 183 |
184 while ($current < $length) { | 184 while ($current < $length) { |
185 if (!$flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') { | 185 if (! $flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') { |
186 if (++$current === $length) { | 186 if (++$current === $length) { |
187 break; | 187 break; |
188 } | 188 } |
189 | 189 |
190 $current++; | 190 $current++; |