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


PHP module::clear_var方法代码示例

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


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

示例1: upgrade

 static function upgrade($version)
 {
     $db = Database::instance();
     if ($version == 1) {
         $db->query("ALTER TABLE {comments} CHANGE `state` `state` varchar(15) default 'unpublished'");
         module::set_version("comment", $version = 2);
     }
     if ($version == 2) {
         module::set_var("comment", "access_permissions", "everybody");
         module::set_version("comment", $version = 3);
     }
     if ($version == 3) {
         // 40 bytes for server_remote_addr is enough to swallow the longest
         // representation of an IPv6 addy.
         //
         // 255 bytes for server_remote_host is enough to swallow the longest
         // legit DNS entry, with a few bytes to spare.
         $db->query("ALTER TABLE {comments} CHANGE `server_remote_addr` `server_remote_addr` varchar(40)");
         $db->query("ALTER TABLE {comments} CHANGE `server_remote_host` `server_remote_host` varchar(255)");
         module::set_version("comment", $version = 4);
     }
     if ($version == 4) {
         module::set_var("comment", "rss_visible", "all");
         module::set_version("comment", $version = 5);
     }
     // In version 5 we accidentally set the installer variable to rss_available when it should
     // have been rss_visible.  Migrate it over now, if necessary.
     if ($version == 5) {
         if (!module::get_var("comment", "rss_visible")) {
             module::set_var("comment", "rss_visible", module::get_var("comment", "rss_available"));
         }
         module::clear_var("comment", "rss_available");
         module::set_version("comment", $version = 6);
     }
 }
开发者ID:JasonWiki,项目名称:docs,代码行数:35,代码来源:comment_installer.php

示例2: clear_parameter_test

 public function clear_parameter_test()
 {
     module::set_var("gallery", "Parameter", "original value");
     $this->assert_equal("original value", module::get_var("gallery", "Parameter"));
     module::clear_var("gallery", "Parameter");
     $this->assert_equal(null, module::get_var("gallery", "Parameter"));
 }
开发者ID:xafr,项目名称:gallery3,代码行数:7,代码来源:Var_Test.php

示例3: user_login

 static function user_login($user)
 {
     // If this user is an admin, check to see if there are any post-install tasks that we need
     // to run and take care of those now.
     if ($user->admin && module::get_var("gallery", "choose_default_tookit", null)) {
         graphics::choose_default_toolkit();
         module::clear_var("gallery", "choose_default_tookit");
     }
 }
开发者ID:xafr,项目名称:gallery3,代码行数:9,代码来源:gallery_event.php

示例4: uninstall

 static function uninstall()
 {
     module::delete("piwik");
     module::clear_var("piwik", "installation_url");
     module::clear_var("piwik", "site_id");
     module::clear_var("piwik", "token_auth");
     module::clear_var("piwik", "enabled_mode");
     module::clear_var("piwik", "tracking_code");
 }
开发者ID:usef,项目名称:gallery3-modules-piwik,代码行数:9,代码来源:piwik_installer.php

示例5: deactivate

 static function deactivate()
 {
     module::clear_var("menu_links", "url");
     module::clear_var("menu_links", "url3");
     module::clear_var("menu_links", "title");
     module::clear_var("menu_links", "title2");
     module::clear_var("menu_links", "title3");
     module::clear_var("menu_links", "hidden");
 }
开发者ID:qboy1987,项目名称:mooiyou,代码行数:9,代码来源:menu_links_installer.php

示例6: uninstall

 static function uninstall()
 {
     module::clear_var("content_warning", "title");
     module::clear_var("content_warning", "message");
     module::clear_var("content_warning", "enter_link_text");
     module::clear_var("content_warning", "exit_link_text");
     module::clear_var("content_warning", "exit_link_url");
     module::delete("content_warning");
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:9,代码来源:content_warning_installer.php

示例7: upgrade

 static function upgrade($version)
 {
     if ($version == 1) {
         module::clear_var("digibug", "default_company_id");
         module::clear_var("digibug", "default_event_id");
         module::clear_var("digibug", "basic_default_company_id");
         module::clear_var("digibug", "basic_event_id");
         module::set_var("digibug", "company_id", "3153");
         module::set_var("digibug", "event_id", "8491");
         module::set_version("digibug", $version = 2);
     }
 }
开发者ID:Okat,项目名称:gallery3,代码行数:12,代码来源:digibug_installer.php

示例8: upgrade

 static function upgrade($version)
 {
     if ($version == 1) {
         module::set_var("user", "mininum_password_length", 5);
         module::set_version("user", $version = 2);
     }
     if ($version == 2) {
         db::build()->update("users")->set("email", "unknown@unknown.com")->where("guest", "=", 0)->and_open()->where("email", "IS", null)->or_where("email", "=", "")->close()->execute();
         module::set_version("user", $version = 3);
     }
     if ($version == 3) {
         $password_length = module::get_var("user", "mininum_password_length", 5);
         module::set_var("user", "minimum_password_length", $password_length);
         module::clear_var("user", "mininum_password_length");
         module::set_version("user", $version = 4);
     }
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:17,代码来源:user_installer.php

示例9: upgrade

 static function upgrade($version)
 {
     if ($version < 1) {
         module::set_version("social_share", $version = 1);
     }
     if ($version < 2) {
         module::set_var("social_share", "facebook_share_enabled", module::get_var("social_share", "facebook"));
         module::clear_var("social_share", "facebook");
         module::set_var("social_share", "google_enabled", module::get_var("social_share", "google"));
         module::clear_var("social_share", "google");
         module::set_var("social_share", "twitter_enabled", module::get_var("social_share", "twitter"));
         module::clear_var("social_share", "twitter");
         module::set_version("social_share", $version = 2);
     }
     if ($version < 3) {
         module::set_version("social_share", $version = 3);
     }
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:18,代码来源:social_share_installer.php

示例10: delete

 public function delete()
 {
     $form = watermark::get_delete_form();
     if ($form->validate()) {
         if ($name = module::get_var("watermark", "name")) {
             @unlink(VARPATH . "modules/watermark/{$name}");
             module::clear_var("watermark", "name");
             module::clear_var("watermark", "width");
             module::clear_var("watermark", "height");
             module::clear_var("watermark", "mime_type");
             module::clear_var("watermark", "position");
             $this->_update_graphics_rules();
             log::success("watermark", t("Watermark deleted"));
             message::success(t("Watermark deleted"));
         }
         print json_encode(array("result" => "success", "location" => url::site("admin/watermarks")));
     } else {
         print json_encode(array("result" => "error", "form" => $form->__toString()));
     }
 }
开发者ID:xafr,项目名称:gallery3,代码行数:20,代码来源:admin_watermarks.php

示例11: upgrade

 static function upgrade($version)
 {
     $db = Database::instance();
     if ($version == 1) {
         module::set_var("tag_albums", "tag_index", "default");
         module::set_var("tag_albums", "tag_index_scope", "0");
         module::set_var("tag_albums", "tag_index_filter", "0");
         module::set_version("tag_albums", 2);
     }
     if ($version == 2) {
         $db->query("CREATE TABLE IF NOT EXISTS {tags_album_tag_covers} (\n               `id` int(9) NOT NULL auto_increment,\n               `tag_id` int(9) NOT NULL,\n               `photo_id` int(9) NOT NULL,\n               PRIMARY KEY (`id`),\n               KEY(`tag_id`, `id`))\n               DEFAULT CHARSET=utf8;");
         module::set_version("tag_albums", 3);
     }
     if ($version == 3) {
         module::set_var("tag_albums", "tag_index_filter_top", module::get_var("tag_albums", "tag_index_filter", "0"));
         module::set_var("tag_albums", "tag_index_filter_bottom", module::get_var("tag_albums", "tag_index_filter", "0"));
         module::clear_var("tag_albums", "tag_index_filter");
         module::set_version("tag_albums", 4);
     }
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:20,代码来源:tag_albums_installer.php

示例12: delete

 public function delete()
 {
     access::verify_csrf();
     $form = watermark::get_delete_form();
     if ($form->validate()) {
         if ($name = module::get_var("watermark", "name")) {
             @unlink(VARPATH . "modules/watermark/{$name}");
             module::clear_var("watermark", "name");
             module::clear_var("watermark", "width");
             module::clear_var("watermark", "height");
             module::clear_var("watermark", "mime_type");
             module::clear_var("watermark", "position");
             $this->_update_graphics_rules();
             log::success("watermark", t("Watermark deleted"));
             message::success(t("Watermark deleted"));
         }
         json::reply(array("result" => "success", "location" => url::site("admin/watermarks")));
     } else {
         json::reply(array("result" => "error", "html" => (string) $form));
     }
 }
开发者ID:kandsten,项目名称:gallery3,代码行数:21,代码来源:admin_watermarks.php

示例13: deactivate

 static function deactivate()
 {
     module::clear_var("sitemap_xtra", "path");
     module::clear_var("sitemap_xtra", "base_url");
     module::clear_var("sitemap_xtra", "zip");
     module::clear_var("sitemap_xtra", "ping_google");
     module::clear_var("sitemap_xtra", "ping_bing");
     module::clear_var("sitemap_xtra", "ping_ask");
     module::clear_var("sitemap_xtra", "robots_txt");
     module::clear_var("sitemap_xtra", "albums");
     module::clear_var("sitemap_xtra", "albums_freq");
     module::clear_var("sitemap_xtra", "albums_prio");
     module::clear_var("sitemap_xtra", "photos");
     module::clear_var("sitemap_xtra", "photos_freq");
     module::clear_var("sitemap_xtra", "photos_prio");
     module::clear_var("sitemap_xtra", "movies");
     module::clear_var("sitemap_xtra", "movies_freq");
     module::clear_var("sitemap_xtra", "movies_prio");
     module::clear_var("sitemap_xtra", "pages");
     module::clear_var("sitemap_xtra", "pages_freq");
     module::clear_var("sitemap_xtra", "pages_prio");
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:22,代码来源:sitemap_xtra_installer.php

示例14: delete

 public function delete()
 {
     access::verify_csrf();
     $form = watermark::get_delete_form();
     if ($form->validate()) {
         if ($name = basename(module::get_var("watermark", "name"))) {
             system::delete_later(VARPATH . "modules/watermark/{$name}");
             module::clear_var("watermark", "name");
             module::clear_var("watermark", "width");
             module::clear_var("watermark", "height");
             module::clear_var("watermark", "mime_type");
             module::clear_var("watermark", "position");
             $this->_update_graphics_rules();
             log::success("watermark", t("Watermark deleted"));
             message::success(t("Watermark deleted"));
         }
         json::reply(array("result" => "success", "location" => url::site("admin/watermarks")));
     } else {
         json::reply(array("result" => "error", "html" => (string) $form));
     }
     // Override the application/json mime type for iframe compatibility.  See ticket #2022.
     header("Content-Type: text/plain; charset=" . Kohana::CHARSET);
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:23,代码来源:admin_watermarks.php

示例15: save

 public function save()
 {
     site_status::clear("gd_init_configuration");
     access::verify_csrf();
     $form = self::get_edit_form_admin();
     if ($form->validate()) {
         module::clear_var("th_greydragon", "photonav_top");
         module::clear_var("th_greydragon", "photonav_bottom");
         module::clear_var("th_greydragon", "hide_sidebar_photo");
         module::clear_var("th_greydragon", "hide_thumbdesc");
         module::clear_var("th_greydragon", "use_detailview");
         if ($form->maintenance->reset_theme->value) {
             module::set_var("gallery", "page_size", 9);
             module::set_var("gallery", "resize_size", 640);
             module::set_var("gallery", "thumb_size", 200);
             module::set_var("gallery", "header_text", "");
             module::set_var("gallery", "footer_text", "");
             module::clear_var("th_greydragon", "copyright");
             module::clear_var("th_greydragon", "logo_path");
             module::clear_var("th_greydragon", "color_pack");
             module::clear_var("th_greydragon", "enable_pagecache");
             module::set_var("gallery", "show_credits", FALSE);
             module::clear_var("th_greydragon", "show_guest_menu");
             module::clear_var("th_greydragon", "mainmenu_position");
             module::clear_var("th_greydragon", "loginmenu_position");
             module::clear_var("th_greydragon", "hide_breadcrumbs");
             module::clear_var("th_greydragon", "horizontal_crop");
             module::clear_var("th_greydragon", "thumb_descmode");
             module::clear_var("th_greydragon", "hide_thumbmeta");
             module::clear_var("th_greydragon", "hide_blockheader");
             module::clear_var("th_greydragon", "photonav_position");
             module::clear_var("th_greydragon", "photo_descmode");
             module::clear_var("th_greydragon", "desc_allowbbcode");
             module::clear_var("th_greydragon", "hide_photometa");
             module::clear_var("th_greydragon", "disable_seosupport");
             module::clear_var("th_greydragon", "sidebar_albumonly");
             module::clear_var("th_greydragon", "sidebar_allowed");
             module::clear_var("th_greydragon", "sidebar_visible");
             module::event("theme_edit_form_completed", $form);
             message::success(t("Theme details are reset"));
         } else {
             // * General Settings ****************************************************
             $_priorratio = module::get_var("th_greydragon", "thumb_ratio");
             if (!$_priorratio) {
                 $_priorratio = "digital";
             }
             $resize_size = $form->edit_theme->resize_size->value;
             $thumb_size = 200;
             $build_resize = $form->maintenance->build_resize->value;
             $build_thumbs = $form->maintenance->build_thumbs->value;
             $build_exif = $form->maintenance->build_exif->value;
             $thumb_ratio = $form->edit_theme_adv_thumb->thumb_ratio->value;
             if ($thumb_ratio == "photo") {
                 $rule = Image::AUTO;
             } else {
                 $rule = Image::WIDTH;
             }
             $color_pack = $form->edit_theme->colorpack->value;
             $thumb_descmode = $form->edit_theme_adv_thumb->thumb_descmode->value;
             $photo_descmode = $form->edit_theme_adv_photo->photo_descmode->value;
             if ($build_resize) {
                 graphics::remove_rule("gallery", "resize", "gallery_graphics::resize");
                 graphics::add_rule("gallery", "resize", "gallery_graphics::resize", array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO), 100);
             }
             if (module::get_var("gallery", "resize_size") != $resize_size) {
                 module::set_var("gallery", "resize_size", $resize_size);
             }
             if ($build_thumbs) {
                 graphics::remove_rule("gallery", "thumb", "gallery_graphics::resize");
                 graphics::add_rule("gallery", "thumb", "gallery_graphics::resize", array("width" => $thumb_size, "height" => $thumb_size, "master" => $rule), 100);
             }
             if ($build_exif) {
                 db::build()->delete("exif_records")->execute();
             }
             if (module::get_var("gallery", "thumb_size") != $thumb_size) {
                 module::set_var("gallery", "thumb_size", $thumb_size);
             }
             module::set_var("gallery", "header_text", $form->edit_theme->header_text->value);
             module::set_var("gallery", "footer_text", $form->edit_theme->footer_text->value);
             $this->save_item_state("copyright", $form->edit_theme->copyright->value, $form->edit_theme->copyright->value);
             $this->save_item_state("logo_path", $form->edit_theme->logo_path->value, $form->edit_theme->logo_path->value);
             $this->save_item_state("color_pack", $color_pack and $color_pack != "greydragon", $color_pack);
             // * Advanced Options - main *********************************************
             module::set_var("gallery", "show_credits", $form->edit_theme_adv_main->show_credits->value);
             $this->save_item_state("show_guest_menu", $form->edit_theme_adv_main->show_guest_menu->value, TRUE);
             $this->save_item_state("loginmenu_position", $form->edit_theme_adv_main->loginmenu_position->value == "1", "header");
             $this->save_item_state("mainmenu_position", $form->edit_theme_adv_main->mainmenu_position->value == "1", "top");
             $this->save_item_state("hide_breadcrumbs", $form->edit_theme_adv_main->hide_breadcrumbs->value, TRUE);
             $this->save_item_state("photonav_position", $form->edit_theme_adv_main->photonav_position->value != "top", $form->edit_theme_adv->photonav_position->value);
             $this->save_item_state("enable_pagecache", $form->edit_theme_adv_main->enable_pagecache->value, TRUE);
             $this->save_item_state("disable_seosupport", $form->edit_theme_adv_main->disable_seosupport->value, TRUE);
             // * Advanced Options - Album page ***************************************
             $this->save_item_state("thumb_ratio", $thumb_ratio != "photo", $thumb_ratio);
             $this->save_item_state("thumb_descmode", $thumb_descmode != "overlay", $thumb_descmode);
             $this->save_item_state("hide_thumbmeta", $form->edit_theme_adv_thumb->hide_thumbmeta->value, TRUE);
             // * Advanced Options - Photo page ***************************************
             $this->save_item_state("photo_descmode", $photo_descmode != "overlay", $photo_descmode);
             $this->save_item_state("desc_allowbbcode", $form->edit_theme_adv_photo->desc_allowbbcode->value, TRUE);
             $this->save_item_state("hide_photometa", !$form->edit_theme_adv_photo->hide_photometa->value, FALSE);
             // * Sidebar Options ****************************************************
//.........这里部分代码省略.........
开发者ID:Glooper,项目名称:gallery3-contrib,代码行数:101,代码来源:admin_theme_options.php


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