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


PHP Feature::zip方法代码示例

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


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

示例1: dirname

$context = $addon->callHook('context');
require dirname(__FILE__) . "/../system/dbconnection.class.php";
require dirname(__FILE__) . "/../system/feature.class.php";
$dbc = new DBConnection();
$dbh = $dbc->connect();
$work_dir = $addon->callHook('babel_working');
$work_context_dir = $work_dir . $context . "_feature/";
$tmp_dir = $work_context_dir . "tmp/";
$output_dir = $work_context_dir . "output/";
$features_dir = $work_context_dir . "features/";
exec("rm -rf {$work_context_dir}*");
exec("mkdir -p {$output_dir}");
exec("mkdir -p {$features_dir}");
//iterate over all the release trains
foreach (ReleaseTrain::all() as $train) {
    // create a dedicated folder for each of them
    exec("mkdir -p {$features_dir}/{$train->id}");
    // create the output folder for temporary artifacts
    $output_dir_for_train = "{$output_dir}/{$train->id}/";
    // iterate over each language
    foreach (Language::all() as $lang) {
        // create a new feature object
        $feature = new Feature($lang, $train, $tmp_dir, $output_dir_for_train);
        // make it generate itself
        $feature->generateAll();
        // now zip it directly
        $featureZip = $feature->zip("{$features_dir}/{$train->id}");
        // output the creation of the feature notification
        echo "Feature created here: {$featureZip}\n";
    }
}
开发者ID:joklaps,项目名称:mytourbook,代码行数:31,代码来源:generate_feature.php


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