mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
106 lines
2.7 KiB
XML
106 lines
2.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="splfileinfo.setfileclass" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SplFileInfo::setFileClass</refname>
|
|
<refpurpose>Sets the class used with <methodname>SplFileInfo::openFile</methodname></refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="SplFileInfo">
|
|
<modifier>public</modifier> <type>void</type><methodname>SplFileInfo::setFileClass</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>class</parameter><initializer><constant>SplFileObject::class</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Use this method to set a custom class which will be used when
|
|
<methodname>SplFileInfo::openFile</methodname> is called. The class name
|
|
passed to this method must be <classname>SplFileObject</classname> or a class
|
|
derived from <classname>SplFileObject</classname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>class</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The class name to use when <methodname>SplFileInfo::openFile</methodname>
|
|
is called.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.void;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>SplFileInfo::setFileClass</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Create a class extending SplFileObject
|
|
class MyFoo extends SplFileObject {}
|
|
|
|
$info = new SplFileInfo(__FILE__);
|
|
// Set the class to use
|
|
$info->setFileClass('MyFoo');
|
|
var_dump($info->openFile());
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
object(MyFoo)#2 (0) { }
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>SplFileInfo::openFile</methodname></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|