summaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
Diffstat (limited to 'installer')
-rw-r--r--installer/cli.php2
-rw-r--r--installer/database_config.php2
-rw-r--r--[-rwxr-xr-x]installer/install.sql29
-rw-r--r--installer/installer.php6
-rw-r--r--installer/web.php1
5 files changed, 23 insertions, 17 deletions
diff --git a/installer/cli.php b/installer/cli.php
index 182c3d26..f736ffcb 100644
--- a/installer/cli.php
+++ b/installer/cli.php
@@ -95,7 +95,7 @@ function parse_cli_params() {
$config["dbname"] = $argv[++$i];
break;
case "-h":
- $config["host"] = $argv[++$i];
+ list ($config["host"], $config["port"]) = explode(":", $argv[++$i]);
break;
case "-u":
$config["user"] = $argv[++$i];
diff --git a/installer/database_config.php b/installer/database_config.php
index 0f04b95c..8abf35e7 100644
--- a/installer/database_config.php
+++ b/installer/database_config.php
@@ -33,7 +33,7 @@ $config['default'] = array(
'user' => '<?php print $user ?>',
'pass' => '<?php print str_replace("'", "\\'", $password) ?>',
'host' => '<?php print $host ?>',
- 'port' => false,
+ 'port' => <?php if (!empty($port)): ?>'<?php print $port ?>' <?php else: ?>false<?php endif ?>,
'socket' => false,
'database' => '<?php print $dbname ?>'
),
diff --git a/installer/install.sql b/installer/install.sql
index e8aaa681..38851eff 100755..100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -88,8 +88,8 @@ CREATE TABLE {graphics_rules} (
PRIMARY KEY (`id`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','resize',100,'thumb');
-INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','resize',100,'resize');
+INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'thumb');
+INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'resize');
DROP TABLE IF EXISTS {groups};
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
@@ -175,7 +175,7 @@ CREATE TABLE {items} (
KEY `weight` (`weight`)
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,NULL,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1');
+INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,2,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1');
DROP TABLE IF EXISTS {items_tags};
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
@@ -228,8 +228,8 @@ 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',12);
-INSERT INTO {modules} VALUES (2,1,'user',1);
+INSERT INTO {modules} VALUES (1,1,'gallery',19);
+INSERT INTO {modules} VALUES (2,1,'user',2);
INSERT INTO {modules} VALUES (3,1,'comment',2);
INSERT INTO {modules} VALUES (4,1,'organize',1);
INSERT INTO {modules} VALUES (5,1,'info',1);
@@ -264,7 +264,7 @@ CREATE TABLE {permissions} (
) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {permissions} VALUES (1,'View','view');
-INSERT INTO {permissions} VALUES (2,'View Full Size','view_full');
+INSERT INTO {permissions} VALUES (2,'View full size','view_full');
INSERT INTO {permissions} VALUES (3,'Edit','edit');
INSERT INTO {permissions} VALUES (4,'Add','add');
DROP TABLE IF EXISTS {search_records};
@@ -331,8 +331,8 @@ CREATE TABLE {themes} (
UNIQUE KEY `name` (`name`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {themes} VALUES (1,'default',1);
-INSERT INTO {themes} VALUES (2,'admin_default',1);
+INSERT INTO {themes} VALUES (1,'wind',1);
+INSERT INTO {themes} VALUES (2,'admin_wind',1);
DROP TABLE IF EXISTS {users};
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
@@ -366,10 +366,10 @@ CREATE TABLE {vars} (
`value` text,
PRIMARY KEY (`id`),
UNIQUE KEY `module_name` (`module_name`,`name`)
-) AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
+) AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
-INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','default');
-INSERT INTO {vars} VALUES (2,'gallery','active_admin_theme','admin_default');
+INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','wind');
+INSERT INTO {vars} VALUES (2,'gallery','active_admin_theme','admin_wind');
INSERT INTO {vars} VALUES (3,'gallery','page_size','9');
INSERT INTO {vars} VALUES (4,'gallery','thumb_size','200');
INSERT INTO {vars} VALUES (5,'gallery','resize_size','640');
@@ -382,6 +382,9 @@ INSERT INTO {vars} VALUES (23,'gallery','credits','Powered by <a href=\"%url\">G
INSERT INTO {vars} VALUES (10,'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\";}}');
INSERT INTO {vars} VALUES (20,'gallery','date_time_format','Y-M-d H:i:s');
INSERT INTO {vars} VALUES (19,'gallery','date_format','Y-M-d');
-INSERT INTO {vars} VALUES (15,'gallery','blocks_dashboard_center','a:4:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}i:9;a:2:{i:0;s:7:\"comment\";i:1;s:15:\"recent_comments\";}}');
+INSERT INTO {vars} VALUES (15,'gallery','blocks_dashboard_center','a:3:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}}');
INSERT INTO {vars} VALUES (18,'gallery','choose_default_tookit','1');
-INSERT INTO {vars} VALUES (25,'comment','spam_caught','0');
+INSERT INTO {vars} VALUES (26,'user','mininum_password_length','5');
+INSERT INTO {vars} VALUES (27,'comment','spam_caught','0');
+INSERT INTO {vars} VALUES (25,'gallery','identity_provider','user');
+INSERT INTO {vars} VALUES (29,'gallery','blocks_site_sidebar','a:3:{i:9;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:10;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:11;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}');
diff --git a/installer/installer.php b/installer/installer.php
index 70afc440..3b1716e2 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -77,7 +77,8 @@ class installer {
// counterparts.
if (!function_exists("mysql_query")) {
function mysql_connect($host, $user, $pass) {
- installer::$mysqli = new mysqli($host, $user, $pass);
+ 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
$error = mysqli_connect_error();
@@ -97,7 +98,8 @@ class installer {
}
}
- return @mysql_connect($config["host"], $config["user"], $config["password"]);
+ $host = empty($config["port"]) ? $config['host'] : "{$config['host']}:{$config['port']}";
+ return @mysql_connect($host, $config["user"], $config["password"]);
}
static function select_db($config) {
diff --git a/installer/web.php b/installer/web.php
index c46f072a..65233b31 100644
--- a/installer/web.php
+++ b/installer/web.php
@@ -38,6 +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"]);
if (!installer::connect($config)) {
$content = render("invalid_db_info.html.php");