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


PHP Notify::clear方法代码示例

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


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

示例1: function

        Shield::abort();
    }
    if (!$folder) {
        $folder = $config->shield;
    }
    if (!File::exist(SHIELD . DS . $folder)) {
        Shield::abort();
        // Folder not found!
    }
    if (isset($_FILES) && !empty($_FILES)) {
        Guardian::checkToken(Request::post('token'));
        $task_connect_path = SHIELD;
        include DECK . DS . 'workers' . DS . 'task.package.1.php';
        if (!Notify::errors()) {
            File::upload($_FILES['file'], SHIELD, function () use($speak) {
                Notify::clear();
                Notify::success(Config::speak('notify_success_uploaded', $speak->shield));
            });
            $P = array('data' => $_FILES);
            Weapon::fire('on_shield_update', array($P, $P));
            Weapon::fire('on_shield_construct', array($P, $P));
            $task_connect_kick = 'shield';
            include DECK . DS . 'workers' . DS . 'task.package.2.php';
        } else {
            Weapon::add('SHIPMENT_REGION_BOTTOM', function () {
                echo '<script>
(function($) {
    $(\'.tab-area .tab[href$="#tab-content-2"]\').trigger("click");
})(window.Zepto || window.jQuery);
</script>';
            }, 11);
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.shield.php

示例2: attach

 /**
  * ==========================================================
  *  RENDER A PAGE
  * ==========================================================
  *
  * -- CODE: -------------------------------------------------
  *
  *    Shield::attach('article', true, false);
  *
  * ----------------------------------------------------------
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *  Parameter | Type    | Description
  *  --------- | ------- | -----------------------------------
  *  $name     | string  | Name of the shield
  *  $minify   | boolean | Minify HTML output?
  *  $cache    | boolean | Create a cache file on page visit?
  *  $expire   | integer | Define cache file expiration time
  *  --------- | ------- | -----------------------------------
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
  */
 public static function attach($name, $minify = null, $cache = false, $expire = null)
 {
     $config = Config::get();
     if (is_null($minify)) {
         $minify = $config->html_minifier;
     }
     $G = array('data' => array('name' => $name, 'minify' => $minify, 'cache' => $cache, 'expire' => $expire));
     $shield = false;
     $shield_base = explode('-', $name, 2);
     if ($_file = File::exist(self::path($name))) {
         $shield = $_file;
     } else {
         if ($_file = File::exist(self::path($shield_base[0]))) {
             $shield = $_file;
         } else {
             Guardian::abort(Config::speak('notify_file_not_exist', '<code>' . self::path($name) . '</code>'));
         }
     }
     $G['data']['path'] = $shield;
     $q = !empty($config->url_query) ? '.' . md5($config->url_query) : "";
     $cache_path = is_string($cache) ? $cache : CACHE . DS . str_replace(array('/', ':'), '.', $config->url_path) . $q . '.cache';
     if ($G['data']['cache'] && file_exists($cache_path)) {
         if (is_null($expire) || is_int($expire) && time() - $expire < filemtime($cache_path)) {
             // Begin shield cache
             Weapon::fire('shield_cache_before', array($G, $G));
             echo Filter::apply('shield:cache', File::open($cache_path)->read());
             // Clear session
             Notify::clear();
             Guardian::forget();
             self::$lot = array();
             // End shield cache
             Weapon::fire('shield_cache_after', array($G, $G));
             exit;
         }
     }
     // Begin shield
     Weapon::fire('shield_before', array($G, $G));
     ob_start($minify ? 'self::s_o' : 'self::s_o_d');
     extract(Filter::apply('shield:lot', self::cargo()));
     require Filter::apply('shield:path', $shield);
     // Clear session
     Notify::clear();
     Guardian::forget();
     self::$lot = array();
     // Get shield content
     $content = ob_get_contents();
     ob_end_flush();
     // Create shield cache
     $G['data']['content'] = $minify ? self::s_o($content) : self::s_o_d($content);
     if ($G['data']['cache']) {
         $G['data']['cache'] = $cache_path;
         File::write($G['data']['content'])->saveTo($cache_path);
         Weapon::fire('on_cache_construct', array($G, $G));
     }
     // End shield
     Weapon::fire('shield_after', array($G, $G));
     exit;
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:80,代码来源:shield.php


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