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


PHP Get::files方法代码示例

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


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

示例1: glob

        if ($_file !== false) {
            // Remove empty folder(s)
            $f = glob(File::D($_file) . DS . '*', GLOB_NOSORT);
            if (empty($f)) {
                File::open(File::D($_file))->delete();
            }
            Notify::success(Config::speak('notify_file_deleted', '<code>' . File::B($_file) . '</code>'));
        } else {
            Notify::success(Config::speak('notify_success_deleted', $speak->shield));
        }
        Weapon::fire(array('on_shield_update', 'on_shield_destruct'), array($P, $P));
        Guardian::kick($config->manager->slug . '/shield' . ($_file !== false ? '/' . $folder : ""));
    } else {
        Notify::warning(Config::speak('notify_confirm_delete_', $file !== false ? '<code>' . $path . '</code>' : '<strong>' . $info->title . '</strong>'));
    }
    Shield::lot(array('segment' => 'shield', 'folder' => $folder, 'files' => Mecha::O(Get::files(SHIELD . DS . $folder, '*')), 'path' => $path))->attach('manager');
});
/**
 * Shield Attacher
 * ---------------
 */
Route::accept($config->manager->slug . '/shield/(attach|eject)/id:(:any)', function ($path = "", $slug = "") use($config, $speak) {
    if (!Guardian::happy(1) || !file_exists(SHIELD . DS . $slug)) {
        Shield::abort();
    }
    $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));
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:route.shield.php

示例2: array

     Shield::abort();
 }
 $info = Shield::info($folder, true);
 if ($path) {
     $path = File::path($path);
     if (!($file = File::exist(SHIELD . DS . $folder . DS . $path))) {
         Shield::abort();
         // File not found!
     }
 } else {
     if (!($file = File::exist(SHIELD . DS . $folder))) {
         Shield::abort();
         // Folder not found!
     }
 }
 Config::set(array('page_title' => $speak->deleting . ': ' . ($path ? File::B($file) : $info['title']) . $config->title_separator . $config->manager->title, 'files' => Get::files(SHIELD . DS . $folder, '*'), 'cargo' => DECK . DS . 'workers' . DS . 'kill.shield.php'));
 if ($request = Request::post()) {
     Guardian::checkToken($request['token']);
     $P = array('data' => array('path' => $file));
     File::open($file)->delete();
     if ($path) {
         Notify::success(Config::speak('notify_file_deleted', '<code>' . File::B($path) . '</code>'));
     } else {
         Notify::success(Config::speak('notify_success_deleted', $speak->shield));
     }
     Weapon::fire('on_shield_update', array($P, $P));
     Weapon::fire('on_shield_destruct', array($P, $P));
     Guardian::kick($config->manager->slug . '/shield' . ($path ? '/' . $folder : ""));
 } else {
     Notify::warning(Config::speak('notify_confirm_delete_', $path ? '<code>' . File::path($path) . '</code>' : '<strong>' . $info['title'] . '</strong>'));
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.shield.php

示例3: function

<?php

/**
 * Cache Manager
 * -------------
 */
Route::accept(array($config->manager->slug . '/cache', $config->manager->slug . '/cache/(:num)'), function ($offset = 1) use($config, $speak) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    $filter = Request::get('q', "");
    $filter = $filter ? Text::parse($filter, '->safe_file_name') : "";
    $files = Get::files(CACHE, '*', 'DESC', 'update', $filter);
    $files_chunk = Mecha::eat($files)->chunk($offset, $config->per_page * 2)->vomit();
    Config::set(array('page_title' => $speak->caches . $config->title_separator . $config->manager->title, 'offset' => $offset, 'pagination' => Navigator::extract($files, $offset, $config->per_page * 2, $config->manager->slug . '/cache'), 'cargo' => 'cargo.cache.php'));
    Shield::lot(array('segment' => 'cache', 'files' => $files_chunk ? Mecha::O($files_chunk) : false))->attach('manager');
});
/**
 * Cache Repairer
 * --------------
 */
Route::accept($config->manager->slug . '/cache/repair/(file|files):(:all)', function ($prefix = "", $file = "") use($config, $speak) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    $path = File::path($file);
    if (!($file = File::exist(CACHE . DS . $path))) {
        Shield::abort();
        // File not found!
    }
    $G = array('data' => array('path' => $file));
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:31,代码来源:route.cache.php


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