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


PHP Package::take方法代码示例

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


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

示例1: function

/**
 * Shield Attacher
 * ---------------
 */
Route::accept($config->manager->slug . '/shield/(attach|eject)/id:(:any)', function ($path = "", $slug = "") use($config, $speak) {
    $new_config = Get::state_config();
    $new_config['shield'] = $path === 'attach' ? $slug : 'normal';
    File::serialize($new_config)->saveTo(STATE . DS . 'config.txt', 0600);
    $G = array('data' => array('id' => $slug, 'action' => $path));
    $mode = $path === 'eject' ? 'eject' : 'mount';
    Notify::success(Config::speak('notify_success_updated', $speak->shield));
    Weapon::fire('on_shield_update', array($G, $G));
    Weapon::fire('on_shield_' . $mode, array($G, $G));
    Weapon::fire('on_shield_' . md5($slug) . '_update', array($G, $G));
    Weapon::fire('on_shield_' . md5($slug) . '_' . $mode, array($G, $G));
    foreach (glob(SYSTEM . DS . 'log' . DS . 'asset.*.log', GLOB_NOSORT) as $asset_cache) {
        File::open($asset_cache)->delete();
    }
    Guardian::kick($config->manager->slug . '/shield/' . $slug);
});
/**
 * Shield Backup
 * -------------
 */
Route::accept($config->manager->slug . '/shield/backup/id:(:any)', function ($folder = "") use($config, $speak) {
    $name = $folder . '.zip';
    Package::take(SHIELD . DS . $folder)->pack(ROOT . DS . $name, true);
    $G = array('data' => array('path' => ROOT . DS . $name, 'file' => ROOT . DS . $name));
    Weapon::fire('on_backup_construct', array($G, $G));
    Guardian::kick($config->manager->slug . '/backup/send:' . $name);
});
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.shield.php

示例2:

<?php

if ($package = File::exist($destination . DS . $name)) {
    if (is_file($package)) {
        Package::take($package)->extract();
        // Extract the ZIP file
        File::open($package)->delete();
        // Delete the ZIP file
        Config::load();
        // Refresh the configuration data ...
        Guardian::kick(Config::get('manager.slug') . '/' . $segment);
    }
}
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:13,代码来源:task.package.php

示例3:

<?php

if ($uploaded = File::exist($task_connect_path . DS . $name)) {
    Package::take($uploaded)->extract();
    // Extract the ZIP file
    File::open($uploaded)->delete();
    // Delete the ZIP file
    Config::load();
    // Refresh the configuration data ...
    Guardian::kick(Config::get('manager')->slug . '/' . $task_connect_kick);
}
开发者ID:razordaze,项目名称:mecha-cms,代码行数:11,代码来源:task.package.2.php

示例4: array

        Shield::abort();
    }
    $info = Plugin::info($slug, true);
    $info['slug'] = $slug;
    Config::set(array('page_title' => $speak->deleting . ': ' . $info['title'] . $config->title_separator . $config->manager->title, 'file' => $info, 'cargo' => DECK . DS . 'workers' . DS . 'kill.plugin.php'));
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        File::open(PLUGIN . DS . $slug)->delete();
        $P = array('data' => array('id' => $slug));
        Notify::success(Config::speak('notify_success_deleted', $speak->plugin));
        Weapon::fire('on_plugin_update', array($P, $P));
        Weapon::fire('on_plugin_destruct', array($P, $P));
        Weapon::fire('on_plugin_' . md5($slug) . '_update', array($P, $P));
        Weapon::fire('on_plugin_' . md5($slug) . '_destruct', array($P, $P));
        Guardian::kick($config->manager->slug . '/plugin');
    } else {
        Notify::warning(Config::speak('notify_confirm_delete_', '<strong>' . $info['title'] . '</strong>'));
    }
    Shield::lot('segment', 'plugin')->attach('manager', false);
});
/**
 * Plugin Backup
 * -------------
 */
Route::accept($config->manager->slug . '/plugin/backup/id:(:any)', function ($folder = "") use($config, $speak) {
    $name = $folder . '.zip';
    Package::take(PLUGIN . DS . $folder)->pack(ROOT . DS . $name, true);
    $G = array('data' => array('path' => ROOT . DS . $name, 'file' => ROOT . DS . $name));
    Weapon::fire('on_backup_construct', array($G, $G));
    Guardian::kick($config->manager->slug . '/backup/send:' . $name);
});
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.plugin.php

示例5: function

 * ----------------
 */
Route::accept($config->manager->slug . '/backup/origin:(:all)', function ($path = "", $origin = "") use($config, $speak) {
    if (Guardian::get('status') !== 'pilot') {
        Shield::abort();
    }
    $time = date('Y-m-d-H-i-s');
    $site = Text::parse($config->title, '->slug');
    if (trim($origin, '.') === "") {
        $name = $site . '_' . $time . '.zip';
        Package::take(ROOT)->pack(ROOT . DS . $name);
    } else {
        $name = $site . '.cabinet.' . str_replace('/', '.', $origin) . '_' . $time . '.zip';
        Package::take(ROOT . DS . 'cabinet' . DS . $origin)->pack(ROOT . DS . $name);
        if ($origin === 'shields') {
            Package::take(ROOT . DS . $name)->deleteFiles(array('json.php', 'rss.php', 'sitemap.php', 'widgets.css', 'widgets.js'));
        }
    }
    Guardian::kick($config->manager->slug . '/backup/send:' . $name);
});
/**
 * Downloading Backup File(s)
 * --------------------------
 */
Route::accept($config->manager->slug . '/backup/send:(:any)', function ($file = "") use($config, $speak) {
    if (Guardian::get('status') !== 'pilot') {
        Shield::abort();
    }
    if ($backup = File::exist(ROOT . DS . $file)) {
        $G = array('data' => array('path' => $backup, 'file' => $backup));
        Weapon::fire('on_backup_construct', array($G, $G));
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.backup.php

示例6: str_replace

 }
 $time = Date::slug(time());
 $site = Text::parse($config->title, '->slug');
 if (trim($origin, '.') === "") {
     $name = $site . '_' . $time . '.zip';
     Package::take(ROOT)->pack(ROOT . DS . $name);
 } else {
     $name = $site . '.' . File::B(CARGO) . '.' . str_replace('/', '.', $origin) . '_' . $time . '.zip';
     Package::take(CARGO . DS . $origin)->pack(ROOT . DS . $name);
     if ($origin === 'shields') {
         Package::take(ROOT . DS . $name)->deleteFolder('normal');
         // delete `normal` shield
         Package::take(ROOT . DS . $name)->deleteFiles(array('json.php', 'rss.php', 'sitemap.php', 'widgets.css', 'widgets.js'));
     }
     if ($origin === 'extends') {
         Package::take(ROOT . DS . $name)->deleteFolder(File::B(CHUNK));
         // delete `chunk` folder
     }
     /*
     if($origin === 'plugins') {
         Package::take(ROOT . DS . $name)->deleteFolders(array( // delete built-in plugin(s)
             '__editor',
             '__editor-button',
             '__preview',
             'asset-version',
             'cache',
             'comment-location',
             'comment-notify',
             'empty',
             'facebook-open-graph',
             'manager',
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:route.backup.php


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