• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • php_user_filter::onCreate()

    (PHP 5, PHP 7)

    Called when creating the filter

    说明

    publicphp_user_filter::onCreate(void): bool

    This method is called during instantiation of the filter class object. If your filter allocates or initializes any other resources (such as a buffer), this is the place to do it.

    When your filter is first instantiated,andyourfilter->onCreate()is called, a number of properties will be available as shown in the table below.

    PropertyContents
    FilterClass->filternameA string containing the name the filter was instantiated with. Filters may be registered under multiple names or under wildcards. Use this property to determine which name was used.
    FilterClass->paramsThe contents of the$paramsparameter passed tostream_filter_append()orstream_filter_prepend().
    FilterClass->streamThe stream resource being filtered. Maybe available only duringfilter()calls when theclosingparameter is set toFALSE.

    参数

    此函数没有参数。

    返回值

    Your implementation of this method should returnFALSEon failure,orTRUEon success.