本文整理汇总了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);
}
}
示例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());
}
示例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; }');
}
}
示例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);
}
示例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', '');
}
}
示例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;
}
示例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')));
}
示例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', '');
}
示例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');
}
示例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"));
}
}
示例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', '');
}
}
示例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);
}
}
示例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');
}
}
}
示例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);
}
}
}
示例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);
}
}