JStream/prependFilter: Difference between revisions
From Joomla! Documentation
New page:
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JStream/prependFil... |
m clean up |
||
| Line 1: | Line 1: | ||
{{subst:Description:JStream/prependFilter}} | |||
{{Description:JStream/prependFilter}} | |||
===Syntax=== | ===Syntax=== | ||
| Line 61: | Line 56: | ||
</source> | </source> | ||
{{subst:SeeAlso:JStream/prependFilter}} | |||
{{SeeAlso:JStream/prependFilter}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 14:27, 24 March 2017
{{subst:Description:JStream/prependFilter}}
Syntax
prependFilter($filtername, $read_write=STREAM_FILTER_READ, $params=Array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $filtername | ||
| $read_write | STREAM_FILTER_READ | |
| $params | Array() |
Defined in
libraries/joomla/filesystem/stream.php
Importing
jimport( 'joomla.filesystem.stream' );
Source Body
function prependFilter($filtername, $read_write=STREAM_FILTER_READ, $params=Array() )
{
$res = false;
if($this->_fh)
{
// Capture PHP errors
$php_errormsg = '';
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
$res = @stream_filter_prepend($this->_fh, $filtername, $read_write, $params);
if(!$res && $php_errormsg)
{
$this->setError($php_errormsg); // set the error msg
}
else
{
array_unshift($res,'');
$res[0] =&$this->filters;
}
// restore error tracking to what it was before
ini_set('track_errors',$track_errors);
}
return $res;
}
{{subst:SeeAlso:JStream/prependFilter}}
Examples
<CodeExamplesForm />