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


PHP Options::set方法代码示例

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


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

示例1: action_plugin_activation

 /**
  * function action_plugin_activation
  * adds the optional options to configure Spamspan
  **/
 public function action_plugin_activation($file)
 {
     if (realpath($file) == __FILE__) {
         Options::set('spamspan__at', '[@]');
         Options::set('spamspan__graphics', 0);
     }
 }
开发者ID:s43,项目名称:Spamspan,代码行数:11,代码来源:spamspan.plugin.php

示例2: testRequires_upgrade

 public function testRequires_upgrade()
 {
     Options::set('db_version', Version::DB_VERSION - 1);
     $this->assertEquals(true, Version::requires_upgrade());
     Options::set('db_version', Version::DB_VERSION);
     $this->assertEquals(false, Version::requires_upgrade());
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:7,代码来源:versionTest.php

示例3: action_plugin_activation

 /**
  * function action_plugin_activation
  * adds the "deleted" status type to the poststatus table
  * when this plugin is activated.
  **/
 public function action_plugin_activation($file)
 {
     if (realpath($file) == __FILE__) {
         Post::add_new_status('deleted', true);
         Options::set('undelete__style', '#primarycontent .deleted { background-color: #933; text-decoration: line-through; }');
     }
 }
开发者ID:ringmaster,项目名称:system,代码行数:12,代码来源:undelete.plugin.php

示例4: action_plugin_activation

 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('calendar__week_start', 0);
 }
开发者ID:habari-extras,项目名称:calendar,代码行数:14,代码来源:calendar.plugin.php

示例5: action_plugin_activation

 /**
  * When Plugin is activated insert default options
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         Options::set('syntax__default_lang', 'php');
         Options::set('syntax__line_numbers', '');
     }
 }
开发者ID:habari-extras,项目名称:syntaxhighlighter,代码行数:10,代码来源:syntax.plugin.php

示例6: filter_default_rewrite_rules

 public function filter_default_rewrite_rules($rules)
 {
     if ($this->current_load() > self::KILL_LOAD) {
         foreach ($rules as $key => $rule) {
             if (strpos($rule['build_str'], 'admin') !== false) {
                 $rules[$key]['handler'] = 'UserThemeHandler';
                 $rules[$key]['action'] = 'display_throttle';
             }
         }
         if (Options::get('throttle') == '') {
             EventLog::log(sprintf(_t('Kill - Load is %s'), $this->current_load()));
             Options::set('throttle', 'kill');
         }
     } elseif ($this->current_load() > self::MAX_LOAD) {
         foreach ($rules as $key => $rule) {
             if ($rule['name'] == 'search') {
                 unset($rules[$key]);
             }
         }
         $rules[] = array('name' => 'search', 'parse_regex' => '%^search(?:/(?P<criteria>[^/]+))?(?:/page/(?P<page>\\d+))?/?$%i', 'build_str' => 'search(/{$criteria})(/page/{$page})', 'handler' => 'UserThemeHandler', 'action' => 'display_throttle', 'priority' => 8, 'description' => 'Searches posts');
         if (Options::get('throttle') == '') {
             EventLog::log(sprintf(_t('Restrict - Load is %s'), $this->current_load()));
             Options::set('throttle', 'restrict');
         }
     } else {
         if (Options::get('throttle') != '') {
             EventLog::log(sprintf(_t('Normal - Load is %s'), $this->current_load()));
             Options::set('throttle', '');
         }
     }
     return $rules;
 }
开发者ID:habari-extras,项目名称:throttle,代码行数:32,代码来源:throttle.plugin.php

示例7: action_plugin_activation

 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('socialink__link_pos', 'top');
     Options::set('socialink__services', serialize(array('digg', 'delicious', 'technorati', 'google', 'yahoo', 'furl', 'reddit', 'magnolia')));
 }
开发者ID:habari-extras,项目名称:socialink,代码行数:15,代码来源:socialink.plugin.php

示例8: action_plugin_activation

 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('photozousilo__username', '');
     Options::set('photozousilo__password', '');
 }
开发者ID:habari-extras,项目名称:photozousilo,代码行数:14,代码来源:photozousilo.plugin.php

示例9: action_plugin_activation

 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('woopra__tag_registered', false);
     Options::set('woopra__display_avatar', 'no');
 }
开发者ID:habari-extras,项目名称:woopra,代码行数:8,代码来源:woopra.plugin.php

示例10: action_plugin_activation

 /**
  * On plugin activation, pick a random quote file.
  **/
 public function action_plugin_activation($file)
 {
     if (Options::get(self::OPTION_NAME) == null) {
         $files = array();
         $files = glob($this->get_path() . "/files/*.xml");
         Options::set(self::OPTION_NAME, basename($files[rand(0, count($files) - 1)], ".xml"));
     }
 }
开发者ID:habari-extras,项目名称:randomquotes,代码行数:11,代码来源:randomquotes.plugin.php

示例11: action_plugin_activation

 public function action_plugin_activation($file)
 {
     if (realpath($file) == __FILE__) {
         Modules::add('Technorati');
         Session::notice(_t('Please set your Technorati API Key in the configuration.'));
         Options::set('technorati__apikey', '');
     }
 }
开发者ID:habari-extras,项目名称:technorati,代码行数:8,代码来源:technorati.plugin.php

示例12: update_settings

 public function update_settings()
 {
     $allowed = array('base_url', 'theme_path', 'timezone', 'log_path', 'pagination');
     $options = array_intersect_key($_POST, array_fill_keys($allowed, true));
     foreach ($options as $name => $value) {
         Options::set($name, $value);
     }
 }
开发者ID:ahutchings,项目名称:logbox,代码行数:8,代码来源:SiteHandler.php

示例13: action_plugin_activation

 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         if (Options::get('dateyurl__format') == null) {
             Options::set('dateyurl__format', 'date');
         }
     }
 }
开发者ID:habari-extras,项目名称:dateyurl,代码行数:8,代码来源:dateyurl.plugin.php

示例14: action_plugin_activation

 /**
  * On activation, check and set default options
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         foreach (self::default_options() as $name => $value) {
             Options::set('jambo__' . $name, $value);
         }
     }
 }
开发者ID:habari-extras,项目名称:jambo,代码行数:11,代码来源:jambo.plugin.php

示例15: action_plugin_activation

 public function action_plugin_activation($file)
 {
     if (realpath($file) == __FILE__) {
         Modules::add('GetClicky');
         Options::set('getclicky__cachetime', '300');
         Options::set('getclicky__loggedin', 1);
     }
 }
开发者ID:habari-extras,项目名称:getclicky,代码行数:8,代码来源:getclicky.plugin.php


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