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


PHP Arr::unique方法代码示例

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


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

示例1: _init

 /**
  * Class init
  *
  * Fetches CSRF settings and current token
  *
  * @throws SecurityException it the CSRF token validation failed
  * @throws FuelException if no security output filter is defined
  */
 public static function _init()
 {
     static::$csrf_token_key = \Config::get('security.csrf_token_key', 'fuel_csrf_token');
     static::$csrf_old_token = \Input::cookie(static::$csrf_token_key, false);
     // if csrf automatic checking is enabled, and it fails validation, bail out!
     if (\Config::get('security.csrf_autoload', true)) {
         $check_token_methods = \Config::get('security.csrf_autoload_methods', array('post', 'put', 'delete'));
         if (in_array(strtolower(\Input::method()), $check_token_methods) and !static::check_token()) {
             throw new \SecurityException('CSRF validation failed, Possible hacking attempt detected!');
         }
     }
     // throw an exception if the output filter setting is missing from the app config
     if (\Config::get('security.output_filter', null) === null) {
         throw new \FuelException('There is no security.output_filter defined in your application config file');
     }
     // deal with duplicate filters, no need to slow the framework down
     foreach (array('output_filter', 'uri_filter', 'input_filter') as $setting) {
         $config = \Config::get('security.' . $setting, array());
         is_array($config) and \Config::set('security.' . $setting, \Arr::unique($config));
     }
 }
开发者ID:SainsburysTests,项目名称:sainsburys,代码行数:29,代码来源:security.php

示例2: hookGetMultisiteTables

 /**
  * hook plugin to get multisite tables names.<br>
  * this will get module's tables that need to be copy while create new site.<br>
  * attention! you must call this method everytime when you want to access multisite tables list.
  * 
  * @todo [fuelstart][multisite][plug] get module's multisite tables plug.
  */
 public function hookGetMultisiteTables()
 {
     $plugin = new \Library\Plugins();
     if ($plugin->hasFilter('SitesGetModulesMultisiteTables') !== false) {
         $plugin->doFilter('SitesGetModulesMultisiteTables');
         if (is_array($plugin->original_data) && !empty($plugin->original_data)) {
             foreach ($plugin->original_data as $table) {
                 if (!empty($table)) {
                     if (is_array($table) && !\Arr::is_multi($table)) {
                         $this->multisite_tables = array_merge($this->multisite_tables, $table);
                     } elseif (is_string($table)) {
                         $this->multisite_tables = array_merge($this->multisite_tables, [$table]);
                     }
                 }
             }
             unset($each_cfg);
             $this->multisite_tables = \Arr::unique($this->multisite_tables);
         }
     }
     unset($plugin);
 }
开发者ID:rundiz,项目名称:fuel-start,代码行数:28,代码来源:sites.php


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