当前位置: 首页>>代码示例>>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;未经允许,请勿转载。