當前位置: 首頁>>代碼示例>>PHP>>正文


PHP module::get_version方法代碼示例

本文整理匯總了PHP中module::get_version方法的典型用法代碼示例。如果您正苦於以下問題:PHP module::get_version方法的具體用法?PHP module::get_version怎麽用?PHP module::get_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在module的用法示例。


在下文中一共展示了module::get_version方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: install

 static function install()
 {
     $version = module::get_version("organize");
     if ($version == 0) {
         module::set_version("organize", 1);
     }
 }
開發者ID:xafr,項目名稱:gallery3,代碼行數:7,代碼來源:organize_installer.php

示例2: install

 static function install()
 {
     $db = Database::instance();
     $version = module::get_version("user");
     if ($version == 0) {
         $db->query("CREATE TABLE IF NOT EXISTS {users} (\n                   `id` int(9) NOT NULL auto_increment,\n                   `name` varchar(32) NOT NULL,\n                   `full_name` varchar(255) NOT NULL,\n                   `password` varchar(64) NOT NULL,\n                   `login_count` int(10) unsigned NOT NULL DEFAULT 0,\n                   `last_login` int(10) unsigned NOT NULL DEFAULT 0,\n                   `email` varchar(64) default NULL,\n                   `admin` BOOLEAN default 0,\n                   `guest` BOOLEAN default 0,\n                   `hash` char(32) default NULL,\n                   `url` varchar(255) default NULL,\n                   `locale` char(10) default NULL,\n                   PRIMARY KEY (`id`),\n                   UNIQUE KEY(`hash`),\n                   UNIQUE KEY(`name`))\n                 ENGINE=InnoDB DEFAULT CHARSET=utf8;");
         $db->query("CREATE TABLE IF NOT EXISTS {groups} (\n                   `id` int(9) NOT NULL auto_increment,\n                   `name` char(64) default NULL,\n                   `special` BOOLEAN default 0,\n                   PRIMARY KEY (`id`),\n                   UNIQUE KEY(`name`))\n                 ENGINE=InnoDB DEFAULT CHARSET=utf8;");
         $db->query("CREATE TABLE IF NOT EXISTS {groups_users} (\n                   `group_id` int(9) NOT NULL,\n                   `user_id` int(9) NOT NULL,\n                   PRIMARY KEY (`group_id`, `user_id`),\n                   UNIQUE KEY(`user_id`, `group_id`))\n                 ENGINE=InnoDB DEFAULT CHARSET=utf8;");
         $everybody = group::create("Everybody");
         $everybody->special = true;
         $everybody->save();
         $registered = group::create("Registered Users");
         $registered->special = true;
         $registered->save();
         $guest = user::create("guest", "Guest User", "");
         $guest->guest = true;
         $guest->remove($registered);
         $guest->save();
         $admin = user::create("admin", "Gallery Administrator", "admin");
         $admin->admin = true;
         $admin->save();
         // Let the admin own everything
         $db->update("items", array("owner_id" => $admin->id), array("owner_id" => "IS NULL"));
         module::set_version("user", 1);
         $root = ORM::factory("item", 1);
         access::allow($everybody, "view", $root);
         access::allow($everybody, "view_full", $root);
         access::allow($registered, "view", $root);
         access::allow($registered, "view_full", $root);
     }
 }
開發者ID:xafr,項目名稱:gallery3,代碼行數:31,代碼來源:user_installer.php

示例3: install

 static function install()
 {
     $version = module::get_version("recaptcha");
     if ($version == 0) {
         module::set_version("recaptcha", 1);
     }
     recaptcha::check_config();
 }
開發者ID:Juuro,項目名稱:Dreamapp-Website,代碼行數:8,代碼來源:recaptcha_installer.php

示例4: install

 static function install()
 {
     $db = Database::instance();
     $version = module::get_version("polar_rose");
     if ($version == 0) {
         module::set_version("polar_rose", 1);
     }
 }
開發者ID:Juuro,項目名稱:Dreamapp-Website,代碼行數:8,代碼來源:polar_rose_installer.php

示例5: install

 static function install()
 {
     $version = module::get_version("themeroller");
     if ($version == 0) {
         /* @todo Put database creation here */
         module::set_version("themeroller", 1);
     }
 }
開發者ID:Glooper,項目名稱:gallery3-contrib,代碼行數:8,代碼來源:themeroller_installer.php

示例6: install

 static function install()
 {
     $version = module::get_version("akismet");
     if ($version == 0) {
         module::set_version("akismet", 1);
     }
     akismet::check_config();
 }
開發者ID:Juuro,項目名稱:Dreamapp-Website,代碼行數:8,代碼來源:akismet_installer.php

示例7: can_activate

 static function can_activate()
 {
     $messages = array();
     if (module::get_version("gallery") < 56) {
         $messages["warn"][] = t("Movie Tools requires Gallery v3.0.5 or newer.");
     }
     return $messages;
 }
開發者ID:webmatter,項目名稱:gallery3-contrib,代碼行數:8,代碼來源:movie_tools_installer.php

示例8: install

 static function install()
 {
     $version = module::get_version("exif");
     if ($version == 0) {
         $db = Database::instance();
         $db->query("CREATE TABLE IF NOT EXISTS {exif_records} (\n                   `id` int(9) NOT NULL auto_increment,\n                   `item_id` INTEGER(9) NOT NULL,\n                   `key_count` INTEGER(9) default 0,\n                   `data` TEXT,\n                   `dirty` BOOLEAN default 1,\n                   PRIMARY KEY (`id`),\n                   KEY(`item_id`))\n                 ENGINE=InnoDB DEFAULT CHARSET=utf8;");
         module::set_version("exif", 1);
     }
 }
開發者ID:xafr,項目名稱:gallery3,代碼行數:9,代碼來源:exif_installer.php

示例9: install

 static function install()
 {
     $version = module::get_version("search");
     $db = Database::instance();
     if ($version == 0) {
         $db->query("CREATE TABLE {search_records} (\n                   `id` int(9) NOT NULL auto_increment,\n                   `item_id` int(9),\n                   `dirty` boolean default 1,\n                   `data` LONGTEXT default NULL,\n                   PRIMARY KEY (`id`),\n                   KEY(`item_id`),\n                   FULLTEXT INDEX (`data`))\n                 ENGINE=MyISAM DEFAULT CHARSET=utf8;");
         module::set_version("search", 1);
     }
 }
開發者ID:xafr,項目名稱:gallery3,代碼行數:9,代碼來源:search_installer.php

示例10: install

 static function install()
 {
     $db = Database::instance();
     $version = module::get_version("notification");
     if ($version == 0) {
         $db->query("CREATE TABLE IF NOT EXISTS `subscriptions` (\n                 `id` int(9) NOT NULL auto_increment,\n                 `item_id` int(9) NOT NULL,\n                 `user_id` int(9) NOT NULL,\n                 PRIMARY KEY (`id`),\n                 UNIQUE KEY (`item_id`, `user_id`),\n                 UNIQUE KEY (`user_id`, `item_id`))\n                 ENGINE=InnoDB DEFAULT CHARSET=utf8;");
         module::set_version("notification", 1);
     }
 }
開發者ID:Juuro,項目名稱:Dreamapp-Website,代碼行數:9,代碼來源:notification_installer.php

示例11: module_change

 static function module_change($changes)
 {
     // Gallery version must be >= 32
     if (module::get_version("gallery") < 32) {
         site_status::warning(t("The module 'Module Order' requires Gallery core version of 32 or higher."), "moduleorder_needs_higherversion");
     } else {
         site_status::clear("moduleorder_needs_higherversion");
     }
 }
開發者ID:Glooper,項目名稱:gallery3-contrib,代碼行數:9,代碼來源:moduleorder_event.php

示例12: install

 static function install()
 {
     $version = module::get_version("dynamic");
     if ($version == 0) {
         module::set_var("dynamic", "popular", serialize((object) array("enabled" => false, "limit" => null, "description" => "", "key_field" => "view_count", "title" => t("Most viewed"))));
         module::set_var("dynamic", "updates", serialize((object) array("enabled" => false, "limit" => null, "description" => "", "key_field" => "created", "title" => t("Recent changes"))));
         module::set_version("dynamic", 1);
     }
 }
開發者ID:Glooper,項目名稱:gallery3-contrib,代碼行數:9,代碼來源:dynamic_installer.php

示例13: install

 static function install()
 {
     $db = Database::instance();
     $version = module::get_version("server_add");
     if ($version == 0) {
         module::set_version("server_add", 1);
     }
     server_add::check_config();
 }
開發者ID:krgeek,項目名稱:gallery3,代碼行數:9,代碼來源:server_add_installer.php

示例14: install

 static function install()
 {
     $db = Database::instance();
     $version = module::get_version("tag");
     if ($version == 0) {
         $db->query("CREATE TABLE IF NOT EXISTS {tags} (\n                   `id` int(9) NOT NULL auto_increment,\n                   `name` varchar(64) NOT NULL,\n                   `count` int(10) unsigned NOT NULL DEFAULT 0,\n                   PRIMARY KEY (`id`),\n                   UNIQUE KEY(`name`))\n                 ENGINE=InnoDB DEFAULT CHARSET=utf8;");
         $db->query("CREATE TABLE IF NOT EXISTS {items_tags} (\n                   `id` int(9) NOT NULL auto_increment,\n                   `item_id` int(9) NOT NULL,\n                   `tag_id` int(9) NOT NULL,\n                   PRIMARY KEY (`id`),\n                   KEY(`tag_id`, `id`),\n                   KEY(`item_id`, `id`))\n                 ENGINE=InnoDB DEFAULT CHARSET=utf8;");
         module::set_version("tag", 1);
     }
 }
開發者ID:xafr,項目名稱:gallery3,代碼行數:10,代碼來源:tag_installer.php

示例15: install

 static function install()
 {
     $db = Database::instance();
     $version = module::get_version("server_add");
     if ($version == 0) {
         access::register_permission("server_add", t("Add files from server"));
         module::set_version("server_add", 1);
     }
     server_add::check_config();
 }
開發者ID:xafr,項目名稱:gallery3,代碼行數:10,代碼來源:server_add_installer.php


注:本文中的module::get_version方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。