| @@ 270-285 (lines=16) @@ | ||
| 267 | */ |
|
| 268 | public function isReadable() |
|
| 269 | { |
|
| 270 | if ($this->readable === null) { |
|
| 271 | if ($this->isPipe()) { |
|
| 272 | $this->readable = true; |
|
| 273 | } else { |
|
| 274 | $this->readable = false; |
|
| 275 | if ($this->isAttached()) { |
|
| 276 | $meta = $this->getMetadata(); |
|
| 277 | foreach (self::$modes['readable'] as $mode) { |
|
| 278 | if (strpos($meta['mode'], $mode) === 0) { |
|
| 279 | $this->readable = true; |
|
| 280 | break; |
|
| 281 | } |
|
| 282 | } |
|
| 283 | } |
|
| 284 | } |
|
| 285 | } |
|
| 286 | ||
| 287 | return $this->readable; |
|
| 288 | } |
|
| @@ 297-308 (lines=12) @@ | ||
| 294 | */ |
|
| 295 | public function isWritable() |
|
| 296 | { |
|
| 297 | if ($this->writable === null) { |
|
| 298 | $this->writable = false; |
|
| 299 | if ($this->isAttached()) { |
|
| 300 | $meta = $this->getMetadata(); |
|
| 301 | foreach (self::$modes['writable'] as $mode) { |
|
| 302 | if (strpos($meta['mode'], $mode) === 0) { |
|
| 303 | $this->writable = true; |
|
| 304 | break; |
|
| 305 | } |
|
| 306 | } |
|
| 307 | } |
|
| 308 | } |
|
| 309 | ||
| 310 | return $this->writable; |
|
| 311 | } |
|