mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document SplFileInfo::getFilename and make it consistent with getBasename
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@269027 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
77f441f4f8
commit
252cfdcdd9
2 changed files with 34 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
|
||||
<refentry xml:id="splfileinfo.getbasename" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>SplFileInfo::getBasename</methodname>
|
||||
<modifier>public</modifier> <type>string</type><methodname>SplFileInfo::getBasename</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>suffix</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
@ -53,8 +53,10 @@
|
|||
<?php
|
||||
$info = new SplFileInfo('file.txt');
|
||||
var_dump($info->getbaseName());
|
||||
|
||||
$info = new SplFileInfo('/path/to/file.txt');
|
||||
var_dump($info->getbaseName());
|
||||
|
||||
$info = new SplFileInfo('/path/to/file.txt');
|
||||
var_dump($info->getbaseName('.txt'));
|
||||
?>
|
||||
|
@ -72,6 +74,15 @@ string(4) "file"
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>SplFileInfo::getFilename</methodname></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
|
||||
<refentry xml:id="splfileinfo.getfilename" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>SplFileInfo::getFilename</refname>
|
||||
<refpurpose>The getFilename purpose</refpurpose>
|
||||
<refpurpose>Get the filename</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>SplFileInfo::getFilename</methodname>
|
||||
<modifier>public</modifier> <type>string</type><methodname>SplFileInfo::getFilename</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The method description goes here.
|
||||
Get the filename without any path information.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Description...
|
||||
The filename.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -38,14 +38,27 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* ... */
|
||||
$info = new SplFileInfo('foo.txt');
|
||||
var_dump($info->getFilename());
|
||||
|
||||
$info = new SplFileInfo('/path/to/foo.txt');
|
||||
var_dump($info->getFilename());
|
||||
|
||||
$info = new SplFileInfo('http://www.php.net/');
|
||||
var_dump($info->getFilename());
|
||||
|
||||
$info = new SplFileInfo('http://www.php.net/anoncvs.php');
|
||||
var_dump($info->getFilename());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
...
|
||||
string(7) "foo.txt"
|
||||
string(7) "foo.txt"
|
||||
string(0) ""
|
||||
string(11) "anoncvs.php"
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
@ -56,7 +69,7 @@
|
|||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>Classname::Method</methodname></member>
|
||||
<member><methodname>SplFileInfo::getBasename</methodname></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
Loading…
Reference in a new issue