mirror of
https://github.com/php/doc-pl.git
synced 2026-03-25 15:42:11 +01:00
160 lines
4.8 KiB
XML
160 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: e82ff8a846af03b863c4a57fbedc0a93af0e68db Maintainer: adi Status: ready -->
|
|
<!-- $Revision$ -->
|
|
<!-- CREDITS: sobak, grzesiek -->
|
|
<refentry xml:id="function.clearstatcache" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>clearstatcache</refname>
|
|
<refpurpose>Czyści bufor statusu pliku</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>clearstatcache</methodname>
|
|
<methodparam choice="opt"><type>bool</type><parameter>clear_realpath_cache</parameter><initializer>&false;</initializer></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>filename</parameter><initializer>""</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Kiedy używasz <function>stat</function>, <function>lstat</function> lub
|
|
dowolnej z funkcji wymienionej niżej, PHP buforuje informacje, zwrócone
|
|
przez te funkcje w celu zapewnienia większej wydajności. Jednakże,
|
|
w kilku przypadkach, możesz chcieć wyczyścić zbuforowane informacje.
|
|
W przypadku, gdy ten sam plik jest sprawdzany wiele razy w tym samym
|
|
skrypcie i istnieje obawa, że plik ten zostanie zmieniony lub usunięty
|
|
podczas pracy skryptu, możesz wywołać czyszczenie bufora stanu.
|
|
W takim przypadku, możesz użyć funkcji <function>clearstatcache</function>
|
|
do wyczyszczenia informacji o pliku zbuforowanej przez PHP.
|
|
</para>
|
|
<para>
|
|
Weź pod uwagę, że PHP nie buforuje informacji o nie istniejących plikach.
|
|
Jeśli wywołasz <function>file_exists</function> na pliku, który nie istnieje
|
|
zostanie zwrócone &false; dopóki nie stworzysz tego pliku. Jeśli go utworzysz
|
|
funkcja zwróci &true; nawet jeśli go później skasujesz.
|
|
Jednakże <function>unlink</function> czyści automatycznie bufor.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Ta funkcja buforuje informacje o podanych nazwach plików, więc potrzebujesz
|
|
wywoływać <function>clearstatcache</function> jeśli wykonujesz wiele
|
|
operacji na tym samym pliku i potrzebujesz, aby informacje o tym
|
|
pliku nie były buforowane.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
Dotyczy funkcji <function>stat</function>,
|
|
<function>lstat</function>,
|
|
<function>file_exists</function>,
|
|
<function>is_writable</function>,
|
|
<function>is_readable</function>,
|
|
<function>is_executable</function>,
|
|
<function>is_file</function>,
|
|
<function>is_dir</function>,
|
|
<function>is_link</function>,
|
|
<function>filectime</function>,
|
|
<function>fileatime</function>,
|
|
<function>filemtime</function>,
|
|
<function>fileinode</function>,
|
|
<function>filegroup</function>,
|
|
<function>fileowner</function>,
|
|
<function>filesize</function>,
|
|
<function>filetype</function> i
|
|
<function>fileperms</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>clear_realpath_cache</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Czy czyścić <emphasis>również</emphasis> bufor ścieżki prawdziwej.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>filename</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Czyści bufor o prawdziwej ścieżce tylko dla podanego pliku; tylko jeśli
|
|
<parameter>clear_realpath_cache</parameter> jest ustawiony na &true;.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.void;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Przykład <function>clearstatcache</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$file = 'output_log.txt';
|
|
|
|
function get_owner($file)
|
|
{
|
|
$stat = stat($file);
|
|
$user = posix_getpwuid($stat['uid']);
|
|
return $user['name'];
|
|
}
|
|
|
|
$format = "UID @ %s: %s\n";
|
|
|
|
printf($format, date('r'), get_owner($file));
|
|
|
|
chown($file, 'ross');
|
|
printf($format, date('r'), get_owner($file));
|
|
|
|
clearstatcache();
|
|
printf($format, date('r'), get_owner($file));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
UID @ Sun, 12 Oct 2008 20:48:28 +0100: root
|
|
UID @ Sun, 12 Oct 2008 20:48:28 +0100: root
|
|
UID @ Sun, 12 Oct 2008 20:48:28 +0100: ross
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|