File_Archive (Previous) (Next) ギャラリーのファイルからの動的なアーカイブ生成

View this page in Last updated: Sun, 05 Oct 2008
English | French | Japanese | Plain HTML

例 -- シンプルな使用例

tar アーカイブのサブディレクトリへの展開

この例では、archive.tar という tar アーカイブの内容をフォルダに展開します。


<?php
require_once "File/Archive.php";

File_Archive::extract('archive.tar/''output');
?>

Send a zip archive containing the content of a tar file to the standard output


<?php
require_once "File/Archive.php";

File_Archive::extract(
    // archive.tar の中身がルートフォルダにあらわれます (デフォルトの引数)
    'archive.tar/',

    // そして書き出し先は ...
    File_Archive::toArchive(       // zip アーカイブで、その名前は
        'archive.zip',             // archive.zip
        File_Archive::toOutput()   // それが標準出力に送られます
    )
);
?>

アーカイブからのファイルの取り出し

extract() でファイルをアーカイブから取り出します。 取り出すファイルを指定する際には、 アーカイブ名を最初のフォルダとして指定します。


<?php
require_once "File/Archive.php";

File_Archive::extract(
    'archive.tar/inner.tgz/file.txt',
    File_Archive::toOutput()
);
?>

File_Archive (Previous) (Next) ギャラリーのファイルからの動的なアーカイブ生成

Download Documentation Last updated: Sun, 05 Oct 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.