当前位置: 首页>>代码示例>>PHP>>正文


PHP CliGuy::taskExtract方法代码示例

本文整理汇总了PHP中CliGuy::taskExtract方法的典型用法代码示例。如果您正苦于以下问题:PHP CliGuy::taskExtract方法的具体用法?PHP CliGuy::taskExtract怎么用?PHP CliGuy::taskExtract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CliGuy的用法示例。


在下文中一共展示了CliGuy::taskExtract方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

$I->amInPath(codecept_data_dir() . 'sandbox');
$I->seeDirFound('some/deeply/nested');
$I->seeFileFound('structu.re', 'some/deeply/nested');
$I->seeFileFound('existing_file', 'some/deeply');
// Test a bunch of archive types that we support
foreach (['zip', 'tar', 'tar.gz', 'tar.bz2', 'tgz'] as $archiveType) {
    // First, take everything from the folder 'some/deeply' and make
    // an archive for it located in 'deep'
    $I->taskPack("deeply.{$archiveType}")->add(['deep' => 'some/deeply'])->run();
    $I->seeFileFound("deeply.{$archiveType}");
    // We are next going to extract the archive we created, this time
    // putting it into a folder called "extracted-$archiveType" (different
    // for each archive type we test).  We rely on the default behavior
    // of our extractor to remove the top-level directory in the archive
    // ("deeply").
    $I->taskExtract("deeply.{$archiveType}")->to("extracted-{$archiveType}")->preserveTopDirectory(false)->run();
    $I->seeDirFound("extracted-{$archiveType}");
    $I->seeDirFound("extracted-{$archiveType}/nested");
    $I->seeFileFound('structu.re', "extracted-{$archiveType}/nested");
    // Next, we'll extract the same archive again, this time preserving
    // the top-level folder.
    $I->taskExtract("deeply.{$archiveType}")->to("preserved-{$archiveType}")->preserveTopDirectory()->run();
    $I->seeDirFound("preserved-{$archiveType}");
    $I->seeDirFound("preserved-{$archiveType}/deep/nested");
    $I->seeFileFound('structu.re', "preserved-{$archiveType}/deep/nested");
    // Make another archive, this time composed of fanciful locations
    $I->taskPack("composed.{$archiveType}")->add(['a/b/existing_file' => 'some/deeply/existing_file'])->add(['x/y/z/structu.re' => 'some/deeply/nested/structu.re'])->run();
    $I->seeFileFound("composed.{$archiveType}");
    // Extract our composed archive, and see if the resulting file
    // structure matches expectations.
    $I->taskExtract("composed.{$archiveType}")->to("decomposed-{$archiveType}")->preserveTopDirectory()->run();
开发者ID:surjit,项目名称:PHP-Robo-Task-Runner,代码行数:31,代码来源:PackExtractCept.php


注:本文中的CliGuy::taskExtract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。