mirror of
https://github.com/php/doc-de.git
synced 2026-03-23 23:02:13 +01:00
153 lines
4.0 KiB
XML
153 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0545e305cf06937b14b3f0694d6e716c9881ffd7 Maintainer: sammywg Status: ready -->
|
|
<refentry xml:id="ziparchive.addfromstring" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>ZipArchive::addFromString</refname>
|
|
<refpurpose>Fügt eine Datei unter Verwendung ihres Inhalts zu einem ZIP-Archiv hinzu</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="ZipArchive">
|
|
<modifier>public</modifier> <type>bool</type><methodname>ZipArchive::addFromString</methodname>
|
|
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>content</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>ZipArchive::FL_OVERWRITE</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Fügt eine Datei unter Verwendung ihres Inhalts zu einem ZIP-Archiv hinzu.
|
|
</para>
|
|
&zip.filename.separator;
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>name</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Der Name des anzulegenden Eintrags.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>content</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Der Inhalt, der zum Erstellen des Eintrags verwendet werden soll. Dieser
|
|
wird im Binary-safe-Modus verwendet.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Eine Bitmaske bestehend aus
|
|
<constant>ZipArchive::FL_OVERWRITE</constant>,
|
|
<constant>ZipArchive::FL_ENC_GUESS</constant>,
|
|
<constant>ZipArchive::FL_ENC_UTF_8</constant>,
|
|
<constant>ZipArchive::FL_ENC_CP437</constant>.
|
|
Das Verhalten dieser Konstanten wird in der
|
|
<link linkend="zip.constants">ZIP-Konstanten</link> Seite beschrieben.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0, PECL zip 1.18.0</entry>
|
|
<entry>
|
|
<parameter>flags</parameter> wurde hinzugefügt.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Einen Eintrag zu einem neuen Archiv hinzufügen</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$zip = new ZipArchive;
|
|
$res = $zip->open('test.zip', ZipArchive::CREATE);
|
|
if ($res === TRUE) {
|
|
$zip->addFromString('test.txt', 'Dateiinhalt kommt hier');
|
|
$zip->close();
|
|
echo 'ok';
|
|
} else {
|
|
echo 'Fehler';
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<example>
|
|
<title>Eine Datei zu einem Verzeichnis innerhalb eines Archivs hinzufügen</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$zip = new ZipArchive;
|
|
if ($zip->open('test.zip') === TRUE) {
|
|
$zip->addFromString('dir/test.txt', 'file content goes here');
|
|
$zip->close();
|
|
echo 'ok';
|
|
} else {
|
|
echo 'Fehler';
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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
|
|
-->
|