Hướng dẫn registered php streams - luồng php đã đăng ký

(Php 4> = 4.3.2, Php 5, Php 7, Php 8)

Stream_WRAPPER_REGISTER - Đăng ký trình bao bọc URL được triển khai dưới dạng lớp PHPRegister a URL wrapper implemented as a PHP class

Sự mô tả

Stream_WRAPPER_REGISTER (Chuỗi $protocol, Chuỗi $class, int $flags = 0): Bool(string $protocol, string $class, int $flags = 0): bool

Thông số

protocol

Tên trình bao sẽ được đăng ký. Tên giao thức hợp lệ phải chứa Alphanumerics, Dots (.), Kiểu (+) hoặc dấu gạch nối (-).

class

Tên lớp thực hiện protocol.

flags

Nên được đặt thành STREAM_IS_URL nếu protocol là giao thức URL. Mặc định là 0, luồng cục bộ.STREAM_IS_URL if protocol is a URL protocol. Default is 0, local stream.

Trả về giá trị

Trả về $protocol0 khi thành công hoặc $protocol1 về thất bại.$protocol0 on success or $protocol1 on failure.

Stream_Wrapper_Register () sẽ trả về $protocol1 nếu protocol đã có trình xử lý. will return $protocol1 if the protocol already has a handler.

Ví dụ

Ví dụ #1 Cách đăng ký trình bao bọc luồng

$protocol4

$protocol5

$protocol6

Ví dụ trên sẽ xuất ra:

line1
line2
line3
string(18) "line1
line2
line3
"

Xem thêm

  • Lớp nguyên mẫu StreamWrapper
  • Lớp học ví dụ được đăng ký làm trình bao
  • stream_wrapper_unregister () - unnegister một trình bao bọc URL
  • stream_wrapper_restore () - khôi phục trình bao bọc tích hợp chưa đăng ký trước đó
  • stream_get_wrappers () - Lấy danh sách các luồng đã đăng ký

Fordiman tại Gmail Dot Com ¶

15 năm trước

$protocol7

$protocol8

$protocol9

cellog tại php dot net ¶

17 năm trước

$class0

$class1

$class2

$protocol9

phpnet tại povaddict dot com dot ar ¶

15 năm trước

$class4

$class5

$class6

$class7

$class8

$class9

Fordiman tại Gmail Dot Com ¶

15 năm trước

$flags0

$flags1

$protocol9

cellog tại php dot net ¶

17 năm trước

$flags3

$flags4

$flags5

$flags6

$protocol9

phpnet tại povaddict dot com dot ar ¶

15 năm trước

$flags8

$flags9

protocol0

$protocol9

cellog tại php dot net ¶

17 năm trước

protocol2

protocol3

$protocol9

phpnet tại povaddict dot com dot ar ¶

Phrank ¶

protocol5

14 năm trước

yeiniel tại gmail dot com

protocol6

protocol7

protocol8

$protocol9

Ẩn danh ¶

17 năm trước

class0

phpnet tại povaddict dot com dot ar ¶

Phrank ¶

class1

class2

class3

$protocol9

14 năm trước

17 năm trước

class5

phpnet tại povaddict dot com dot ar ¶

15 năm trước

class6

class7

class8

class9

protocol0

protocol1

protocol2

protocol3

protocol4

$protocol9