本文整理汇总了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);
}
}
示例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);
}
}
示例3: install
static function install()
{
$version = module::get_version("recaptcha");
if ($version == 0) {
module::set_version("recaptcha", 1);
}
recaptcha::check_config();
}
示例4: install
static function install()
{
$db = Database::instance();
$version = module::get_version("polar_rose");
if ($version == 0) {
module::set_version("polar_rose", 1);
}
}
示例5: install
static function install()
{
$version = module::get_version("themeroller");
if ($version == 0) {
/* @todo Put database creation here */
module::set_version("themeroller", 1);
}
}
示例6: install
static function install()
{
$version = module::get_version("akismet");
if ($version == 0) {
module::set_version("akismet", 1);
}
akismet::check_config();
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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");
}
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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();
}