From 824087416a2469cf044b4a9193a0047c6c889333 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Sun, 14 Feb 2010 17:07:31 -0800 Subject: Avoid PHP warnings when the DB host string has no port. --- installer/installer.php | 2 +- installer/web.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'installer') diff --git a/installer/installer.php b/installer/installer.php index 57be6cc0..705f1725 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -77,7 +77,7 @@ class installer { // counterparts. if (!function_exists("mysql_query")) { function mysql_connect($host, $user, $pass) { - list ($host, $port) = explode(":", $host); + list ($host, $port) = explode(":", $host . ":"); installer::$mysqli = new mysqli($host, $user, $pass, $port); // http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of // $mysqli->connect_error because of bugs before PHP 5.2.9 diff --git a/installer/web.php b/installer/web.php index 90143afb..0a3cdb6e 100644 --- a/installer/web.php +++ b/installer/web.php @@ -38,7 +38,7 @@ if (installer::already_installed()) { "dbname" => $_POST["dbname"], "prefix" => $_POST["prefix"], "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql"); - list ($config["host"], $config["port"]) = explode(":", $config["host"]); + list ($config["host"], $config["port"]) = explode(":", $config["host"] . ":"); if (!installer::connect($config)) { $content = render("invalid_db_info.html.php"); -- cgit v1.2.3 From 667d65aea460ea601858c54976495d294d93f017 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Sun, 14 Feb 2010 18:33:38 -0800 Subject: Fix for ticket 901: Wrap Gallery version string into bdo tag to override the BiDi algorithm. Also, properly marking the "Powere by" string for translation. See: http://www.w3.org/International/tutorials/bidi-xhtml/#Slide0420 --- installer/install.sql | 4 ++-- modules/gallery/helpers/gallery_installer.php | 13 ++++++++++--- modules/gallery/helpers/gallery_theme.php | 7 +++++-- modules/gallery/module.info | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) (limited to 'installer') diff --git a/installer/install.sql b/installer/install.sql index dea324eb..28a9caa5 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -239,7 +239,7 @@ CREATE TABLE {modules} ( UNIQUE KEY `name` (`name`) ) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -INSERT INTO {modules} VALUES (1,1,'gallery',28); +INSERT INTO {modules} VALUES (1,1,'gallery',29); INSERT INTO {modules} VALUES (2,1,'user',3); INSERT INTO {modules} VALUES (3,1,'comment',2); INSERT INTO {modules} VALUES (4,1,'organize',1); @@ -389,7 +389,7 @@ INSERT INTO {vars} VALUES (NULL,'gallery','image_quality','75'); INSERT INTO {vars} VALUES (NULL,'gallery','image_sharpen','15'); INSERT INTO {vars} VALUES (NULL,'gallery','time_format','H:i:s'); INSERT INTO {vars} VALUES (NULL,'gallery','show_credits','1'); -INSERT INTO {vars} VALUES (NULL,'gallery','credits','Powered by Gallery %version'); +INSERT INTO {vars} VALUES (NULL,'gallery','credits','Powered by %gallery_version'); INSERT INTO {vars} VALUES (NULL,'gallery','simultaneous_upload_limit','5'); INSERT INTO {vars} VALUES (NULL,'gallery','admin_area_timeout','5400'); INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}'); diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index dd53cf43..45d991af 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -284,11 +284,13 @@ class gallery_installer { module::set_var("gallery", "date_time_format", "Y-M-d H:i:s"); module::set_var("gallery", "time_format", "H:i:s"); module::set_var("gallery", "show_credits", 1); - // @todo this string needs to be picked up by l10n_scanner - module::set_var("gallery", "credits", "Powered by Gallery %version"); + // Mark string for translation + $powered_by_string = t("Powered by %gallery_version", + array("locale" => "root")); + module::set_var("gallery", "credits", $powered_by_string); module::set_var("gallery", "simultaneous_upload_limit", 5); module::set_var("gallery", "admin_area_timeout", 90 * 60); - module::set_version("gallery", 28); + module::set_version("gallery", 29); } static function upgrade($version) { @@ -538,6 +540,11 @@ class gallery_installer { module::set_var("gallery", "admin_area_timeout", 90 * 60); module::set_version("gallery", $version = 28); } + + if ($version == 28) { + module::set_var("gallery", "credits", "Powered by %gallery_version"); + module::set_version("gallery", $version = 29); + } } static function uninstall() { diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index ec650e1c..d6944323 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -112,9 +112,12 @@ class gallery_theme_Core { } static function credits() { - return "
  • " . + $version_string = SafeString::of_safe_html( + 'Gallery ' . gallery::VERSION . ''); + return "
  • " . t(module::get_var("gallery", "credits"), - array("url" => "http://gallery.menalto.com", "version" => gallery::VERSION)) . + array("url" => "http://gallery.menalto.com", + "gallery_version" => $version_string)) . "
  • "; } diff --git a/modules/gallery/module.info b/modules/gallery/module.info index ae300399..39615e1c 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 28 +version = 29 -- cgit v1.2.3 From 6ce01328422cc587dedf555d0ba3eb8a0ee05a9f Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Mon, 22 Feb 2010 00:30:54 -0800 Subject: Fix for ticket #1027: Add index on cache key column. (and fix the packager to truncate the cache table before packaging) --- installer/install.sql | 3 ++- modules/gallery/controllers/packager.php | 1 + modules/gallery/helpers/gallery_installer.php | 12 +++++++++++- modules/gallery/module.info | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) (limited to 'installer') diff --git a/installer/install.sql b/installer/install.sql index 28a9caa5..ebe3651d 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -42,6 +42,7 @@ CREATE TABLE {caches} ( `expiration` int(9) NOT NULL, `cache` longblob, PRIMARY KEY (`id`), + KEY `key` (`key`), KEY `tags` (`tags`) ) DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; @@ -239,7 +240,7 @@ CREATE TABLE {modules} ( UNIQUE KEY `name` (`name`) ) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -INSERT INTO {modules} VALUES (1,1,'gallery',29); +INSERT INTO {modules} VALUES (1,1,'gallery',30); INSERT INTO {modules} VALUES (2,1,'user',3); INSERT INTO {modules} VALUES (3,1,'comment',2); INSERT INTO {modules} VALUES (4,1,'organize',1); diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php index 66626483..aef032a0 100644 --- a/modules/gallery/controllers/packager.php +++ b/modules/gallery/controllers/packager.php @@ -82,6 +82,7 @@ class Packager_Controller extends Controller { module::set_var("gallery", "blocks_{$key}", serialize($blocks)); } + Database::instance()->query("TRUNCATE {caches}"); Database::instance()->query("TRUNCATE {sessions}"); Database::instance()->query("TRUNCATE {logs}"); db::build() diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index b594ddcf..6f8a6688 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -32,6 +32,10 @@ class gallery_installer { PRIMARY KEY (`id`)) DEFAULT CHARSET=utf8;"); + // Using a simple index instead of a unique key for the + // key column to avoid handling of concurrency issues + // on insert. Thus allowing concurrent inserts on the + // same cache key, as does Memcache / xcache. $db->query("CREATE TABLE {caches} ( `id` int(9) NOT NULL auto_increment, `key` varchar(255) NOT NULL, @@ -39,6 +43,7 @@ class gallery_installer { `expiration` int(9) NOT NULL, `cache` longblob, PRIMARY KEY (`id`), + KEY (`key`), KEY (`tags`)) DEFAULT CHARSET=utf8;"); @@ -290,7 +295,7 @@ class gallery_installer { module::set_var("gallery", "credits", (string) $powered_by_string); module::set_var("gallery", "simultaneous_upload_limit", 5); module::set_var("gallery", "admin_area_timeout", 90 * 60); - module::set_version("gallery", 29); + module::set_version("gallery", 30); } static function upgrade($version) { @@ -545,6 +550,11 @@ class gallery_installer { module::set_var("gallery", "credits", "Powered by %gallery_version"); module::set_version("gallery", $version = 29); } + + if ($version == 29) { + $db->query("ALTER TABLE {caches} ADD KEY (`key`);"); + module::set_version("gallery", $version = 30); + } } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index 39615e1c..df2be978 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 29 +version = 30 -- cgit v1.2.3 From b4922f4d176662976c9d2b249edf0e50a0cdfdf1 Mon Sep 17 00:00:00 2001 From: fpaterno Date: Fri, 26 Feb 2010 16:59:37 +0800 Subject: Password value on installer must be hidden --- installer/views/get_db_info.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'installer') diff --git a/installer/views/get_db_info.html.php b/installer/views/get_db_info.html.php index ada0793c..1eeecd91 100644 --- a/installer/views/get_db_info.html.php +++ b/installer/views/get_db_info.html.php @@ -57,7 +57,7 @@ Password - + -- cgit v1.2.3 From 7d2885fe94d8b343af3f8ce1619be13a03056c5e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 26 Feb 2010 09:59:49 -0800 Subject: Revert "Password value on installer must be hidden" This reverts commit b4922f4d176662976c9d2b249edf0e50a0cdfdf1. --- installer/views/get_db_info.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'installer') diff --git a/installer/views/get_db_info.html.php b/installer/views/get_db_info.html.php index 1eeecd91..ada0793c 100644 --- a/installer/views/get_db_info.html.php +++ b/installer/views/get_db_info.html.php @@ -57,7 +57,7 @@ Password - + -- cgit v1.2.3