<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Called when creating the filter</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="php-user-filter.onclose.html">php_user_filter::onClose</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.streamwrapper.html">streamWrapper</a></div> <div class="up"><a href="class.php-user-filter.html">php_user_filter</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="php-user-filter.oncreate" class="refentry"> <div class="refnamediv"> <h1 class="refname">php_user_filter::onCreate</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">php_user_filter::onCreate</span> — <span class="dc-title">Called when creating the filter</span></p> </div> <div class="refsect1 description" id="refsect1-php-user-filter.oncreate-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>php_user_filter::onCreate</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> 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. </p> <p class="para"> When your filter is first instantiated, and <em>yourfilter->onCreate()</em> is called, a number of properties will be available as shown in the table below. </p> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Property</th> <th>Contents</th> </tr> </thead> <tbody class="tbody"> <tr> <td><em>FilterClass->filtername</em></td> <td> A 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. </td> </tr> <tr> <td><em>FilterClass->params</em></td> <td> The contents of the <em><code class="parameter">params</code></em> parameter passed to <span class="function"><a href="function.stream-filter-append.html" class="function">stream_filter_append()</a></span> or <span class="function"><a href="function.stream-filter-prepend.html" class="function">stream_filter_prepend()</a></span>. </td> </tr> <tr> <td><em>FilterClass->stream</em></td> <td> The stream resource being filtered. Maybe available only during <span class="methodname"><strong>filter()</strong></span> calls when the <em>closing</em> parameter is set to <strong><code>FALSE</code></strong>. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 parameters" id="refsect1-php-user-filter.oncreate-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-php-user-filter.oncreate-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Your implementation of this method should return <strong><code>FALSE</code></strong> on failure, or <strong><code>TRUE</code></strong> on success. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="php-user-filter.onclose.html">php_user_filter::onClose</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.streamwrapper.html">streamWrapper</a></div> <div class="up"><a href="class.php-user-filter.html">php_user_filter</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>