Final Class Yiisoft\Yii\Debug\Helper\StreamWrapper\StreamWrapper
| Inheritance | Yiisoft\Yii\Debug\Helper\StreamWrapper\StreamWrapper |
|---|---|
| Implements | Yiisoft\Yii\Debug\Helper\StreamWrapper\StreamWrapperInterface |
Public Properties
Public Methods
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| STREAM_OPEN_FOR_INCLUDE | 128 | Yiisoft\Yii\Debug\Helper\StreamWrapper\StreamWrapper |
Property Details
Method Details
| public boolean dir_closedir ( ) |
public function dir_closedir(): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
closedir($this->stream);
/**
* @psalm-suppress RedundantCondition
*/
return is_resource($this->stream);
}
| public boolean dir_opendir ( string $path, integer $options ) | ||
| $path | string | |
| $options | integer | |
public function dir_opendir(string $path, int $options): bool
{
$this->filename = $path;
/**
* @psalm-suppress PossiblyNullArgument
*/
$this->stream = opendir($path, $this->context);
return is_resource($this->stream);
}
| public false|string dir_readdir ( ) |
public function dir_readdir(): false|string
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return readdir($this->stream);
}
| public boolean dir_rewinddir ( ) |
public function dir_rewinddir(): bool
{
if (!is_resource($this->stream)) {
return false;
}
rewinddir($this->stream);
/**
* @noinspection PhpConditionAlreadyCheckedInspection
* @psalm-suppress RedundantCondition
*/
return is_resource($this->stream);
}
| public boolean mkdir ( string $path, integer $mode, integer $options ) | ||
| $path | string | |
| $mode | integer | |
| $options | integer | |
public function mkdir(string $path, int $mode, int $options): bool
{
$this->filename = $path;
/**
* @psalm-suppress PossiblyNullArgument
*/
return mkdir($path, $mode, ($options & STREAM_MKDIR_RECURSIVE) === STREAM_MKDIR_RECURSIVE, $this->context);
}
| public boolean rename ( string $path_from, string $path_to ) | ||
| $path_from | string | |
| $path_to | string | |
public function rename(string $path_from, string $path_to): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return rename($path_from, $path_to, $this->context);
}
| public boolean rmdir ( string $path, integer $options ) | ||
| $path | string | |
| $options | integer | |
public function rmdir(string $path, int $options): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return rmdir($path, $this->context);
}
| public void stream_cast ( integer $castAs ) | ||
| $castAs | integer | |
public function stream_cast(int $castAs): void
{
// ???
}
| public void stream_close ( ) |
public function stream_close(): void
{
/**
* @psalm-suppress InvalidPropertyAssignmentValue
*/
if ($this->stream !== null) {
fclose($this->stream);
}
$this->stream = null;
}
| public boolean stream_eof ( ) |
public function stream_eof(): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return feof($this->stream);
}
| public boolean stream_flush ( ) |
public function stream_flush(): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return fflush($this->stream);
}
| public boolean stream_lock ( integer $operation ) | ||
| $operation | integer | |
public function stream_lock(int $operation): bool
{
if ($operation === 0) {
$operation = LOCK_EX;
}
/**
* @psalm-suppress PossiblyNullArgument
*/
return flock($this->stream, $operation);
}
| public boolean stream_metadata ( string $path, integer $option, mixed $value ) | ||
| $path | string | |
| $option | integer | |
| $value | mixed | |
public function stream_metadata(string $path, int $option, mixed $value): bool
{
/** @psalm-suppress MixedArgument */
return match ($option) {
STREAM_META_TOUCH => touch($path, ...$value),
STREAM_META_OWNER_NAME, STREAM_META_OWNER => chown($path, $value),
STREAM_META_GROUP_NAME, STREAM_META_GROUP => chgrp($path, $value),
STREAM_META_ACCESS => chmod($path, $value),
default => false
};
}
| public boolean stream_open ( string $path, string $mode, integer $options, string|null &$opened_path ) | ||
| $path | string | |
| $mode | string | |
| $options | integer | |
| $opened_path | string|null | |
public function stream_open(string $path, string $mode, int $options, ?string &$opened_path): bool
{
$this->filename = realpath($path) ?: $path;
if ((self::STREAM_OPEN_FOR_INCLUDE & $options) === self::STREAM_OPEN_FOR_INCLUDE && function_exists(
'opcache_invalidate'
)) {
opcache_invalidate($path, false);
}
$this->stream = fopen(
$path,
$mode,
($options & STREAM_USE_PATH) === STREAM_USE_PATH,
(self::STREAM_OPEN_FOR_INCLUDE & $options) === self::STREAM_OPEN_FOR_INCLUDE ? null : $this->context
);
if (!is_resource($this->stream)) {
return false;
}
if ($opened_path !== null) {
$metaData = stream_get_meta_data($this->stream);
$opened_path = $metaData['uri'];
}
return true;
}
| public string|false stream_read ( integer $count ) | ||
| $count | integer | |
public function stream_read(int $count): string|false
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return fread($this->stream, $count);
}
| public boolean stream_seek ( integer $offset, integer $whence = SEEK_SET ) | ||
| $offset | integer | |
| $whence | integer | |
public function stream_seek(int $offset, int $whence = SEEK_SET): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return fseek($this->stream, $offset, $whence) !== -1;
}
| public boolean stream_set_option ( integer $option, integer $arg1, integer $arg2 ) | ||
| $option | integer | |
| $arg1 | integer | |
| $arg2 | integer | |
public function stream_set_option(int $option, int $arg1, int $arg2): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return match ($option) {
STREAM_OPTION_BLOCKING => stream_set_blocking($this->stream, $arg1 === STREAM_OPTION_BLOCKING),
STREAM_OPTION_READ_TIMEOUT => stream_set_timeout($this->stream, $arg1, $arg2),
STREAM_OPTION_WRITE_BUFFER => stream_set_write_buffer($this->stream, $arg2) === 0,
default => false,
};
}
| public array|false stream_stat ( ) |
public function stream_stat(): array|false
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return fstat($this->stream);
}
| public integer stream_tell ( ) |
public function stream_tell(): int
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return ftell($this->stream);
}
| public boolean stream_truncate ( integer $new_size ) | ||
| $new_size | integer | |
public function stream_truncate(int $new_size): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return ftruncate($this->stream, $new_size);
}
| public integer stream_write ( string $data ) | ||
| $data | string | |
public function stream_write(string $data): int
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return fwrite($this->stream, $data);
}
| public boolean unlink ( string $path ) | ||
| $path | string | |
public function unlink(string $path): bool
{
/**
* @psalm-suppress PossiblyNullArgument
*/
return unlink($path, $this->context);
}
| public array|false url_stat ( string $path, integer $flags ) | ||
| $path | string | |
| $flags | integer | |
public function url_stat(string $path, int $flags): array|false
{
try {
if (($flags & STREAM_URL_STAT_QUIET) === STREAM_URL_STAT_QUIET) {
return @stat($path);
}
return stat($path);
} catch (Throwable $e) {
if (($flags & STREAM_URL_STAT_QUIET) === STREAM_URL_STAT_QUIET) {
return false;
}
trigger_error($e->getMessage(), E_USER_ERROR);
}
}
Signup or Login in order to comment.