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


PHP Mecha::SVR方法代码示例

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


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

示例1: set

 /**
  * =============================================================
  *  REGISTER NEW VARIABLE(S)
  * =============================================================
  *
  * -- CODE: ----------------------------------------------------
  *
  *    Config::set('foo', 'bar');
  *
  * -------------------------------------------------------------
  *
  *    Config::set(array(
  *        'a' => 1,
  *        'b' => 2
  *    ));
  *
  * -------------------------------------------------------------
  *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *  Parameter | Type   | Description
  *  --------- | ------ | ---------------------------------------
  *  $key      | string | Key of data to be called
  *  $key      | array  | Array of data's key and value
  *  $value    | mixed  | The value of your data key
  *  --------- | ------ | ---------------------------------------
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *
  */
 public static function set($key, $value = "")
 {
     if (is_object($key)) {
         $key = Mecha::A($key);
     }
     if (is_object($value)) {
         $value = Mecha::A($value);
     }
     $cargo = array();
     if (!is_array($key)) {
         Mecha::SVR($cargo, $key, $value);
     } else {
         foreach ($key as $k => $v) {
             Mecha::SVR($cargo, $k, $v);
         }
     }
     Mecha::extend(self::$bucket, $cargo);
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:46,代码来源:config.php

示例2: set

 public static function set($session, $value = "", $expire = 1, $path = '/', $domain = "", $secure = false, $http_only = false)
 {
     if (strpos($session, 'cookie:') === 0) {
         $name = substr($session, 7);
         $expire = time() + 60 * 60 * 24 * $expire;
         if (strpos($name, '.') !== false) {
             $parts = explode('.', $name);
             $name = array_shift($parts);
             $old = Converter::strEval(isset($_COOKIE[$name]) ? $_COOKIE[$name] : array());
             if (is_object($value)) {
                 $value = Mecha::A($value);
             }
             Mecha::SVR($old, implode('.', $parts), $value);
             $value = $old;
         }
         setcookie($name, base64_encode(json_encode($value, true)), $expire, $path, $domain, $secure, $http_only);
         setcookie('__' . $name, base64_encode(json_encode(array($expire, $path, $domain, $secure, $http_only), true)), $expire, '/', "", false, false);
     } else {
         Mecha::SVR($_SESSION, $session, $value);
     }
 }
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:21,代码来源:session.php

示例3: array

 Config::set(array('page_title' => $speak->configs . $config->title_separator . $config->manager->title, 'cargo' => 'cargo.config.php'));
 if ($request = Request::post()) {
     Guardian::checkToken($request['token']);
     $bools = array('comments.allow' => false, 'comments.moderation' => false, 'widget_include_css' => false, 'widget_include_js' => false, 'html_parser.active' => Request::post('html_parser.active', false));
     $pages = array('index' => 'article', 'tag' => 'tag', 'archive' => 'archive', 'search' => 'search', 'manager' => 'manager');
     $slugs = array();
     if ($files = Get::pages()) {
         foreach ($files as $file) {
             list($_time, $_kind, $_slug) = explode('_', File::N($file), 3);
             $slugs[$_slug] = 1;
         }
         unset($files);
     }
     foreach ($bools as $bool => $fallback) {
         // Fix(es) for checkbox input(s)
         Mecha::SVR($request, $bool, Request::post($bool, $fallback));
     }
     foreach ($pages as $page => $default) {
         // Fix(es) for slug pattern input(s)
         $request[$page]['slug'] = Text::parse(Request::post($page . '.slug', $default), '->slug');
         if (Request::post($page . '.per_page') < 1 || floor(Request::post($page . '.per_page')) != Request::post($page . '.per_page')) {
             Notify::error($speak->notify_invalid_per_page_number);
             Guardian::memorize($request);
         }
         // Check if slug already exists on static page(s)
         if (isset($slugs[$request[$page]['slug']])) {
             Notify::error(Config::speak('notify_error_slug_exist', $request[$page]['slug']));
             Guardian::memorize($request);
         }
     }
     if (Request::post('per_page') < 1 || floor(Request::post('per_page')) != Request::post('per_page')) {
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:route.config.php


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