php_user_filter::filter
(PHP 5, PHP 7)
php_user_filter::filter — Called when applying the filter
Description
$in
, resource $out
, int &$consumed
, bool $closing
)This method is called whenever data is read from or written to the attached stream (such as with fread() or fwrite()).
Parameters
-
in
-
in
is a resource pointing to a bucket brigade which contains one or more bucket objects containing data to be filtered. -
out
-
out
is a resource pointing to a second bucket brigade into which your modified buckets should be placed. -
consumed
-
consumed
, which must always be declared by reference, should be incremented by the length of the data which your filter reads in and alters. In most cases this means you will incrementconsumed
by $bucket->datalen for each $bucket. -
closing
-
If the stream is in the process of closing (and therefore this is the last pass through the filterchain), the
closing
parameter will be set toTRUE
.
Return Values
The filter() method must return one of three values upon completion.
Return Value | Meaning |
---|---|
PSFS_PASS_ON |
Filter processed successfully with data available in the
out bucket brigade.
|
PSFS_FEED_ME |
Filter processed successfully, however no data was available to return. More data is required from the stream or prior filter. |
PSFS_ERR_FATAL (default) |
The filter experienced an unrecoverable error and cannot continue. |
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-php-user-filter.filter.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.