0 follower

Final Class Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy

InheritanceYiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
ImplementsYiisoft\Yii\Debug\Helper\StreamWrapper\StreamWrapperInterface

Public Methods

Hide inherited methods

Method Description Defined By
__call() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
__construct() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
__destruct() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
__get() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
dir_closedir() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
dir_opendir() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
dir_readdir() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
dir_rewinddir() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
mkdir() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
register() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
rename() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
rmdir() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_cast() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_close() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_eof() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_flush() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_lock() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_metadata() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_open() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_read() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_seek() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_set_option() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_stat() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_tell() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_truncate() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
stream_write() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
unlink() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
unregister() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy
url_stat() Yiisoft\Yii\Debug\Collector\Stream\FilesystemStreamProxy

Property Details

Hide inherited properties

$collector public static property
$context public property
public resource|null $context null
$decorated public property
$ignored public property
public boolean $ignored false
$ignoredClasses public static property
public static string[] $ignoredClasses = []
$ignoredPathPatterns public static property
public static string[] $ignoredPathPatterns = []
$operations public property
public array $operations = []
$registered public static property
public static boolean $registered false

Method Details

Hide inherited methods

__call() public method

public mixed __call ( string $name, array $arguments )
$name string
$arguments array

                public function __call(string $name, array $arguments)
{
    try {
        self::unregister();
        return $this->decorated->{$name}(...$arguments);
    } finally {
        self::register();
    }
}

            
__construct() public method

public mixed __construct ( )

                public function __construct()
{
    $this->decorated = new StreamWrapper();
    $this->decorated->context = $this->context;
}

            
__destruct() public method

public mixed __destruct ( )

                public function __destruct()
{
    if (self::$collector === null) {
        return;
    }
    foreach ($this->operations as $name => $operation) {
        self::$collector->collect(
            operation: $name,
            path: $operation['path'],
            args: $operation['args'],
        );
    }
    self::unregister();
}

            
__get() public method

public mixed __get ( string $name )
$name string

                public function __get(string $name)
{
    return $this->decorated->{$name};
}

            
dir_closedir() public method

public boolean dir_closedir ( )

                public function dir_closedir(): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
dir_opendir() public method

public boolean dir_opendir ( string $path, integer $options )
$path string
$options integer

                public function dir_opendir(string $path, int $options): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
dir_readdir() public method

public false|string dir_readdir ( )

                public function dir_readdir(): false|string
{
    if (!$this->ignored) {
        $this->operations['readdir'] = [
            'path' => $this->decorated->filename ?? '',
            'args' => [],
        ];
    }
    return $this->__call(__FUNCTION__, func_get_args());
}

            
dir_rewinddir() public method

public boolean dir_rewinddir ( )

                public function dir_rewinddir(): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
mkdir() public method

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
{
    if (!$this->isIgnored()) {
        $this->operations['mkdir'] = [
            'path' => $path,
            'args' => [
                'mode' => $mode,
                'options' => $options,
            ],
        ];
    }
    return $this->__call(__FUNCTION__, func_get_args());
}

            
register() public static method

public static void register ( )

                public static function register(): void
{
    if (self::$registered) {
        return;
    }
    /**
     * It's important to trigger autoloader before unregistering the file stream handler
     */
    class_exists(BacktraceMatcher::class);
    class_exists(StreamWrapper::class);
    class_exists(CombinedRegexp::class);
    class_exists(StringHelper::class);
    stream_wrapper_unregister('file');
    stream_wrapper_register('file', self::class, STREAM_IS_URL);
    self::$registered = true;
}

            
rename() public method

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
{
    if (!$this->isIgnored()) {
        $this->operations['rename'] = [
            'path' => $path_from,
            'args' => [
                'path_to' => $path_to,
            ],
        ];
    }
    return $this->__call(__FUNCTION__, func_get_args());
}

            
rmdir() public method

public boolean rmdir ( string $path, integer $options )
$path string
$options integer

                public function rmdir(string $path, int $options): bool
{
    if (!$this->isIgnored()) {
        $this->operations['rmdir'] = [
            'path' => $path,
            'args' => [
                'options' => $options,
            ],
        ];
    }
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_cast() public method

public mixed stream_cast ( integer $castAs )
$castAs integer

                public function stream_cast(int $castAs)
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_close() public method

public void stream_close ( )

                public function stream_close(): void
{
    $this->__call(__FUNCTION__, func_get_args());
}

            
stream_eof() public method

public boolean stream_eof ( )

                public function stream_eof(): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_flush() public method

public boolean stream_flush ( )

                public function stream_flush(): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_lock() public method

public boolean stream_lock ( integer $operation )
$operation integer

                public function stream_lock(int $operation): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_metadata() public method

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
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_open() public method

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->ignored = $this->isIgnored();
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_read() public method

public string|false stream_read ( integer $count )
$count integer

                public function stream_read(int $count): string|false
{
    if (!$this->ignored) {
        $this->operations['read'] = [
            'path' => $this->decorated->filename ?? '',
            'args' => [],
        ];
    }
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_seek() public method

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
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_set_option() public method

public boolean stream_set_option ( integer $option, integer $arg1, integer|null $arg2 )
$option integer
$arg1 integer
$arg2 integer|null

                public function stream_set_option(int $option, int $arg1, ?int $arg2): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_stat() public method

public array|false stream_stat ( )

                public function stream_stat(): array|false
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_tell() public method

public integer stream_tell ( )

                public function stream_tell(): int
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_truncate() public method

public boolean stream_truncate ( integer $new_size )
$new_size integer

                public function stream_truncate(int $new_size): bool
{
    return $this->__call(__FUNCTION__, func_get_args());
}

            
stream_write() public method

public integer stream_write ( string $data )
$data string

                public function stream_write(string $data): int
{
    if (!$this->ignored) {
        $this->operations['write'] = [
            'path' => $this->decorated->filename ?? '',
            'args' => [],
        ];
    }
    return $this->__call(__FUNCTION__, func_get_args());
}

            
unlink() public method

public boolean unlink ( string $path )
$path string

unregister() public static method

public static void unregister ( )

                public static function unregister(): void
{
    if (!self::$registered) {
        return;
    }
    @stream_wrapper_restore('file');
    self::$registered = false;
}

            
url_stat() public method

public array|false url_stat ( string $path, integer $flags )
$path string
$flags integer

                public function url_stat(string $path, int $flags): array|false
{
    return $this->__call(__FUNCTION__, func_get_args());
}