mirror of
https://github.com/php/doc-ru.git
synced 2026-03-26 08:42:13 +01:00
140 lines
3.9 KiB
XML
140 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: f03806fcd8fe03a0501bd40b6e3939ff6589a1d2 Maintainer: rjhdby Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
<refentry xml:id="pharfileinfo.iscompressed" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>PharFileInfo::isCompressed</refname>
|
||
<refpurpose>Проверить, сжат ли файл</refpurpose>
|
||
</refnamediv>
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis role="PharFileInfo">
|
||
<modifier>public</modifier> <type>bool</type><methodname>PharFileInfo::isCompressed</methodname>
|
||
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>compression</parameter><initializer>&null;</initializer></methodparam>
|
||
</methodsynopsis>
|
||
|
||
<para>
|
||
Проверяет, сжат ли файл внутри Phar-архива с помощью Gzip или Bzip2.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>compression</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Одна из констант <constant>Phar::GZ</constant> или <constant>Phar::BZ2</constant>.
|
||
По умолчанию - любой тип сжатия.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
&true;, если файл сжат и &false; в противном случае.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="changelog">
|
||
&reftitle.changelog;
|
||
<informaltable>
|
||
<tgroup cols="2">
|
||
<thead>
|
||
<row>
|
||
<entry>&Version;</entry>
|
||
<entry>&Description;</entry>
|
||
</row>
|
||
</thead>
|
||
<tbody>
|
||
<row>
|
||
<entry>8.0.0</entry>
|
||
<entry>
|
||
<parameter>compression</parameter> теперь допускает значение null.
|
||
</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</informaltable>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title>Пример использования <function>PharFileInfo::isCompressed</function></title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
try {
|
||
$p = new Phar('/path/to/my.phar', 0, 'my.phar');
|
||
$p['myfile.txt'] = 'hi';
|
||
$p['myfile2.txt'] = 'hi';
|
||
$p['myfile2.txt']->setCompressedGZ();
|
||
$file = $p['myfile.txt'];
|
||
$file2 = $p['myfile2.txt'];
|
||
var_dump($file->isCompressed());
|
||
var_dump($file2->isCompressed());
|
||
} catch (Exception $e) {
|
||
echo 'Не удалось создать/изменить phar my.phar: ', $e;
|
||
}
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs;
|
||
<screen>
|
||
<![CDATA[
|
||
bool(false)
|
||
bool(true)
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>PharFileInfo::getCompressedSize</function></member>
|
||
<member><function>PharFileInfo::decompress</function></member>
|
||
<member><function>PharFileInfo::compress</function></member>
|
||
<member><function>Phar::decompress</function></member>
|
||
<member><function>Phar::compress</function></member>
|
||
<member><function>Phar::canCompress</function></member>
|
||
<member><function>Phar::isCompressed</function></member>
|
||
<member><function>Phar::getSupportedCompression</function></member>
|
||
<member><function>Phar::decompressFiles</function></member>
|
||
<member><function>Phar::compressFiles</function></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
|
||
-->
|