TAILIEUCHUNG - Advanced PHP Programming- P13

Tham khảo tài liệu 'advanced php programming- p13', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 578 Chapter 22 Extending PHP Part II if fd open filename O_RDWR -1 return NULL if file_length if fstat fd sb -1 close fd return NULL file_length if mpos mmap NULL file_length PROT_READ PROT_WRITE MAP_PRIVATE fd 0 void -1 return NULL data emalloc sizeof struct mmap_stream_data data- base_pos mpos data- current_pos mpos data- len file_length close fd stream php_stream_alloc mmap_ops data NULL mode if opened_path opened_path estrdup filename return stream Now you only need to register this function with the do so you add a registration hook to the MINIT function as follows PHP_MINIT_FUNCTION mmap_session php_register_url_stream_wrapper mmap mmap_wrapper TSRMLS_CC Here the first argument mmap instructs the streams subsystem to dispatch to the wrapper any URLs with the protocol also need to register a de-registration function for the wrapper in MSHUTDOWN PHP_MSHUTDOWN_FUNCTION mmap_session php_unregister_url_stream_wrapper mmap TSRMLS_CC This section provides only a brief treatment of the streams API. Another of its cool features is the ability to write stacked stream filters. These stream filters allow you to transparently modify data read from or written to a stream. PHP 5 features a number of stock stream filters including the following Further Reading 579 Content compression HTTP chunked encoding decoding Streaming cryptographic ciphers via mcrypt Whitespace folding The streams API s ability to allow you to transparently affect all the internal I O functions in PHP is extremely powerful. It is only beginning to be fully explored but I expect some very ingenious uses of its capabilities over the coming years. Further Reading The official PHP documentation of how to author classes and streams is pretty sparse. As the saying goes Use the force read the source. That having been said there are some resources out there. For OOP extension code the following are some good resources The Zend Engine2 Reflection API in the PHP source tree .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.