diff options
Diffstat (limited to 'installer')
-rw-r--r-- | installer/cli.php | 2 | ||||
-rw-r--r-- | installer/index.php | 6 | ||||
-rwxr-xr-x | installer/install.sql | 190 | ||||
-rw-r--r-- | installer/installer.php | 52 | ||||
-rw-r--r-- | installer/views/already_installed.html.php | 2 | ||||
-rw-r--r-- | installer/views/get_db_info.html.php | 41 | ||||
-rw-r--r-- | installer/views/install.html.php | 5 | ||||
-rw-r--r-- | installer/views/success.html.php | 2 | ||||
-rw-r--r-- | installer/views/var_dir_status.html.php | 30 | ||||
-rw-r--r-- | installer/web.php | 21 |
10 files changed, 199 insertions, 152 deletions
diff --git a/installer/cli.php b/installer/cli.php index e2fdffce..50845ea4 100644 --- a/installer/cli.php +++ b/installer/cli.php @@ -69,7 +69,7 @@ function oops($message) { print "==> " . $message; print "\n"; print "For help you can try:\n"; - print " * The Gallery3 FAQ - http://codex.gallery2.org/Gallery3:FAQ\n"; + print " * The Gallery 3 FAQ - http://codex.gallery2.org/Gallery3:FAQ\n"; print " * The Gallery Forums - http://gallery.menalto.com/forum\n"; print "\n\n** INSTALLATION FAILED **\n"; exit(1); diff --git a/installer/index.php b/installer/index.php index 317f27b8..a11c0b02 100644 --- a/installer/index.php +++ b/installer/index.php @@ -30,10 +30,6 @@ require(DOCROOT . "installer/installer.php"); if (PHP_SAPI == "cli") { include("cli.php"); } else { - if (@$_GET["page"] == "check") { - include("check.html.php"); - } else { - include("web.php"); - } + include("web.php"); } diff --git a/installer/install.sql b/installer/install.sql index d02d8d69..bda576d1 100755 --- a/installer/install.sql +++ b/installer/install.sql @@ -1,6 +1,6 @@ DROP TABLE IF EXISTS {access_caches}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {access_caches} ( `id` int(9) NOT NULL auto_increment, `item_id` int(9) default NULL, @@ -12,11 +12,11 @@ CREATE TABLE {access_caches} ( `add_2` smallint(6) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {access_caches} VALUES (1,1,1,0,0,1,0,0); DROP TABLE IF EXISTS {access_intents}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {access_intents} ( `id` int(9) NOT NULL auto_increment, `item_id` int(9) default NULL, @@ -30,11 +30,24 @@ CREATE TABLE {access_intents} ( `add_2` tinyint(1) default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {access_intents} VALUES (1,1,1,1,0,0,1,1,0,0); +DROP TABLE IF EXISTS {caches}; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE {caches} ( + `id` int(9) NOT NULL auto_increment, + `key` varchar(255) NOT NULL, + `tags` varchar(255) default NULL, + `expiration` int(9) NOT NULL, + `cache` longblob, + PRIMARY KEY (`id`), + KEY `tags` (`tags`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {comments}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {comments} ( `author_id` int(9) default NULL, `created` int(9) NOT NULL, @@ -60,10 +73,10 @@ CREATE TABLE {comments} ( `updated` int(9) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {graphics_rules}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {graphics_rules} ( `id` int(9) NOT NULL auto_increment, `active` tinyint(1) default '0', @@ -74,11 +87,12 @@ CREATE TABLE {graphics_rules} ( `target` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB 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'),(2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','resize',100,'resize'); +/*!40101 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'); DROP TABLE IF EXISTS {groups}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {groups} ( `id` int(9) NOT NULL auto_increment, `name` char(64) default NULL, @@ -86,22 +100,25 @@ CREATE TABLE {groups} ( PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; -INSERT INTO {groups} VALUES (1,'Everybody',1),(2,'Registered Users',1); +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO {groups} VALUES (1,'Everybody',1); +INSERT INTO {groups} VALUES (2,'Registered Users',1); DROP TABLE IF EXISTS {groups_users}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {groups_users} ( `group_id` int(9) NOT NULL, `user_id` int(9) NOT NULL, PRIMARY KEY (`group_id`,`user_id`), UNIQUE KEY `user_id` (`user_id`,`group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; -INSERT INTO {groups_users} VALUES (1,1),(1,2),(2,2); +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO {groups_users} VALUES (1,1); +INSERT INTO {groups_users} VALUES (1,2); +INSERT INTO {groups_users} VALUES (2,2); DROP TABLE IF EXISTS {incoming_translations}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {incoming_translations} ( `id` int(9) NOT NULL auto_increment, `key` char(32) NOT NULL, @@ -113,10 +130,10 @@ CREATE TABLE {incoming_translations} ( UNIQUE KEY `key` (`key`,`locale`), KEY `locale_key` (`locale`,`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {items}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {items} ( `id` int(9) NOT NULL auto_increment, `album_cover_item_id` int(9) default NULL, @@ -154,11 +171,11 @@ CREATE TABLE {items} ( KEY `type` (`type`), KEY `random` (`rand_key`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 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,'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; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {items_tags} ( `id` int(9) NOT NULL auto_increment, `item_id` int(9) NOT NULL, @@ -167,10 +184,10 @@ CREATE TABLE {items_tags} ( KEY `tag_id` (`tag_id`,`id`), KEY `item_id` (`item_id`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {logs}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {logs} ( `id` int(9) NOT NULL auto_increment, `category` varchar(64) default NULL, @@ -183,10 +200,10 @@ CREATE TABLE {logs} ( `user_id` int(9) default '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {messages}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {messages} ( `id` int(9) NOT NULL auto_increment, `key` varchar(255) default NULL, @@ -195,10 +212,10 @@ CREATE TABLE {messages} ( PRIMARY KEY (`id`), UNIQUE KEY `key` (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {modules}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {modules} ( `id` int(9) NOT NULL auto_increment, `active` tinyint(1) default '0', @@ -207,11 +224,19 @@ CREATE TABLE {modules} ( PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; -INSERT INTO {modules} VALUES (1,1,'gallery',2),(2,1,'user',1),(3,1,'comment',1),(4,1,'organize',1),(5,1,'info',1),(6,1,'rss',1),(7,1,'search',1),(8,1,'slideshow',1),(9,1,'tag',1); +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO {modules} VALUES (1,1,'gallery',6); +INSERT INTO {modules} VALUES (2,1,'user',1); +INSERT INTO {modules} VALUES (3,1,'comment',2); +INSERT INTO {modules} VALUES (4,1,'organize',1); +INSERT INTO {modules} VALUES (5,1,'info',1); +INSERT INTO {modules} VALUES (6,1,'rss',1); +INSERT INTO {modules} VALUES (7,1,'search',1); +INSERT INTO {modules} VALUES (8,1,'slideshow',1); +INSERT INTO {modules} VALUES (9,1,'tag',1); DROP TABLE IF EXISTS {outgoing_translations}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {outgoing_translations} ( `id` int(9) NOT NULL auto_increment, `base_revision` int(9) default NULL, @@ -223,10 +248,10 @@ CREATE TABLE {outgoing_translations} ( UNIQUE KEY `key` (`key`,`locale`), KEY `locale_key` (`locale`,`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {permissions}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {permissions} ( `id` int(9) NOT NULL auto_increment, `display_name` varchar(64) default NULL, @@ -234,11 +259,14 @@ CREATE TABLE {permissions} ( PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; -INSERT INTO {permissions} VALUES (1,'View','view'),(2,'View Full Size','view_full'),(3,'Edit','edit'),(4,'Add','add'); +/*!40101 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 (3,'Edit','edit'); +INSERT INTO {permissions} VALUES (4,'Add','add'); DROP TABLE IF EXISTS {search_records}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {search_records} ( `id` int(9) NOT NULL auto_increment, `item_id` int(9) default NULL, @@ -248,21 +276,21 @@ CREATE TABLE {search_records} ( KEY `item_id` (`item_id`), FULLTEXT KEY `data` (`data`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {search_records} VALUES (1,1,0,' Gallery'); DROP TABLE IF EXISTS {sessions}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {sessions} ( `session_id` varchar(127) NOT NULL, `data` text NOT NULL, `last_activity` int(10) unsigned NOT NULL, PRIMARY KEY (`session_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {tags}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {tags} ( `id` int(9) NOT NULL auto_increment, `name` varchar(64) NOT NULL, @@ -270,10 +298,10 @@ CREATE TABLE {tags} ( PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {tasks}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {tasks} ( `id` int(9) NOT NULL auto_increment, `callback` varchar(128) default NULL, @@ -288,10 +316,10 @@ CREATE TABLE {tasks} ( PRIMARY KEY (`id`), KEY `owner_id` (`owner_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {themes}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {themes} ( `id` int(9) NOT NULL auto_increment, `name` varchar(64) default NULL, @@ -299,11 +327,12 @@ CREATE TABLE {themes} ( PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; -INSERT INTO {themes} VALUES (1,'default',1),(2,'admin_default',1); +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO {themes} VALUES (1,'default',1); +INSERT INTO {themes} VALUES (2,'admin_default',1); DROP TABLE IF EXISTS {users}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {users} ( `id` int(9) NOT NULL auto_increment, `name` varchar(32) NOT NULL, @@ -321,11 +350,12 @@ CREATE TABLE {users} ( UNIQUE KEY `name` (`name`), UNIQUE KEY `hash` (`hash`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; -INSERT INTO {users} VALUES (1,'guest','Guest User','',0,0,NULL,0,1,NULL,NULL,NULL),(2,'admin','Gallery Administrator','',0,0,NULL,1,0,NULL,NULL,NULL); +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO {users} VALUES (1,'guest','Guest User','',0,0,NULL,0,1,NULL,NULL,NULL); +INSERT INTO {users} VALUES (2,'admin','Gallery Administrator','',0,0,NULL,1,0,NULL,NULL,NULL); DROP TABLE IF EXISTS {vars}; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE {vars} ( `id` int(9) NOT NULL auto_increment, `module_name` varchar(64) NOT NULL, @@ -333,6 +363,22 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; -SET character_set_client = @saved_cs_client; -INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','default'),(2,'gallery','active_admin_theme','admin_default'),(3,'gallery','page_size','9'),(4,'gallery','thumb_size','200'),(5,'gallery','resize_size','640'),(6,'gallery','default_locale','en_US'),(7,'gallery','image_quality','75'),(9,'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\";}}'),(14,'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\";}}'),(17,'gallery','version','3.0 pre beta 2 (git)'),(18,'gallery','choose_default_tookit','1'),(19,'gallery','date_format','Y-M-d'),(20,'gallery','date_time_format','Y-M-d H:i:s'),(21,'gallery','time_format','H:i:s'),(22,'gallery','credits','Powered by <a href=\"%url\">Gallery %version</a>'),(24,'comment','spam_caught','0'); +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; +/*!40101 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 (3,'gallery','page_size','9'); +INSERT INTO {vars} VALUES (4,'gallery','thumb_size','200'); +INSERT INTO {vars} VALUES (5,'gallery','resize_size','640'); +INSERT INTO {vars} VALUES (6,'gallery','default_locale','en_US'); +INSERT INTO {vars} VALUES (7,'gallery','image_quality','75'); +INSERT INTO {vars} VALUES (9,'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 (14,'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 (17,'gallery','version','3.0 pre beta 2 (git)'); +INSERT INTO {vars} VALUES (18,'gallery','choose_default_tookit','1'); +INSERT INTO {vars} VALUES (19,'gallery','date_format','Y-M-d'); +INSERT INTO {vars} VALUES (20,'gallery','date_time_format','Y-M-d H:i:s'); +INSERT INTO {vars} VALUES (21,'gallery','time_format','H:i:s'); +INSERT INTO {vars} VALUES (22,'gallery','show_credits','1'); +INSERT INTO {vars} VALUES (23,'gallery','credits','Powered by <a href=\"%url\">Gallery %version</a>'); +INSERT INTO {vars} VALUES (25,'comment','spam_caught','0'); diff --git a/installer/installer.php b/installer/installer.php index 9ba88bea..b0af561e 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -18,31 +18,6 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -// We know that we have either mysql or mysqli. By default we use mysql functions, so if they're -// not defined then do the simplest thing which will work: remap them to their mysqli -// counterparts. -if (!function_exists("mysql_query")) { - function mysql_connect($host, $user, $pass) { - installer::$mysqli = new mysqli($host, $user, $pass); - // 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(); - return empty($error); - } - function mysql_query($query) { - return installer::$mysqli->query($query); - } - function mysql_num_rows($result) { - return $result->num_rows; - } - function mysql_error() { - return installer::$mysqli->error; - } - function mysql_select_db($db) { - return installer::$mysqli->select_db($db); - } -} - class installer { static $mysqli; @@ -92,7 +67,32 @@ class installer { } static function connect($config) { - return @mysql_connect($config["host"], $config["user"], $config["password"]); + // We know that we have either mysql or mysqli. By default we use mysql functions, so if + // they're not defined then do the simplest thing which will work: remap them to their mysqli + // counterparts. + if (!function_exists("mysql_query")) { + function mysql_connect($host, $user, $pass) { + installer::$mysqli = new mysqli($host, $user, $pass); + // 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(); + return empty($error); + } + function mysql_query($query) { + return installer::$mysqli->query($query); + } + function mysql_num_rows($result) { + return $result->num_rows; + } + function mysql_error() { + return installer::$mysqli->error; + } + function mysql_select_db($db) { + return installer::$mysqli->select_db($db); + } + } + + return mysql_connect($config["host"], $config["user"], $config["password"]); } static function select_db($config) { diff --git a/installer/views/already_installed.html.php b/installer/views/already_installed.html.php index 0d7fc193..f6ac1bff 100644 --- a/installer/views/already_installed.html.php +++ b/installer/views/already_installed.html.php @@ -1,5 +1,5 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <p class="success"> - Your Gallery3 install is complete. + Your Gallery 3 install is complete. </p> diff --git a/installer/views/get_db_info.html.php b/installer/views/get_db_info.html.php index 7835f246..adc775a4 100644 --- a/installer/views/get_db_info.html.php +++ b/installer/views/get_db_info.html.php @@ -1,31 +1,4 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<h1> Welcome! </h1> -<p> - Installing Gallery is very easy. We just need to know how to talk - to your MySQL database, and we need a place to store your photos on - your web host. -</p> - - -<fieldset> - <legend>Photo Storage</legend> - <?php if (!installer::var_writable()): ?> - <p class="error"> - We're having trouble creating a place for your photos. Can you - help? Please create a directory called "var" using <code>mkdir var</code> in your - gallery3 directory, then run <code>chmod 777 var</code>. That - should fix it. - <br/><br/> - <a href="index.php">Check again</a> - </p> - <?php else: ?> - <p class="success"> - We've found a place to store your photos: - <code class="location"> <?= VARPATH ?> </code> - </p> - <?php endif ?> -</fieldset> - <form method="post" action="index.php?step=save_db_info"> <fieldset> <legend>Database</legend> @@ -40,7 +13,7 @@ Database Name </td> <td> - <input name="dbname" value="gallery3"/> + <input name="dbname" value="<?= $dbname ?>"/> </td> </tr> <tr> @@ -48,7 +21,7 @@ User </td> <td> - <input name="dbuser" value="root"/> + <input name="dbuser" value="<?= $user ?>"/> </td> </tr> <tr> @@ -56,7 +29,7 @@ Password </td> <td> - <input name="dbpass" value=""/> + <input name="dbpass" value="<?= $password ?>"/> </td> </tr> <tr> @@ -64,7 +37,7 @@ Host </td> <td> - <input name="dbhost" value="localhost"/> + <input name="dbhost" value="<?= $host ?>"/> </td> </tr> <tr> @@ -72,16 +45,12 @@ Table Prefix </td> <td> - <input name="prefix" value=""/> + <input name="prefix" value="<?= $prefix ?>"/> </td> </tr> <tr> <td colspan="2"> - <?php if (installer::var_writable()): ?> <input type="submit" value="Continue"/> - <?php else: ?> - <i class="error">(Please fix the photo storage problem before continuing)</i> - <?php endif ?> </td> </tr> </table> diff --git a/installer/views/install.html.php b/installer/views/install.html.php index 18060219..31112c28 100644 --- a/installer/views/install.html.php +++ b/installer/views/install.html.php @@ -1,14 +1,15 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <html> <head> - <title>Gallery3 Installer</title> + <title>Gallery 3 Installer</title> <link rel="stylesheet" type="text/css" href="install.css"/> </head> <body> <div id="outer"> <img src="../modules/gallery/images/gallery.png" /> <div id="inner"> - <?php print $content ?> + <?= $content ?> + <?= empty($database_form) ? "" : $database_form ?> </div> <div id="footer"> <p> diff --git a/installer/views/success.html.php b/installer/views/success.html.php index 4bca2fb1..e9ee9818 100644 --- a/installer/views/success.html.php +++ b/installer/views/success.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <h1> Success! </h1> <p class="success"> - Your Gallery3 install is complete! + Your Gallery 3 install is complete! </p> <?php if (!empty($user)): ?> diff --git a/installer/views/var_dir_status.html.php b/installer/views/var_dir_status.html.php new file mode 100644 index 00000000..8211e13c --- /dev/null +++ b/installer/views/var_dir_status.html.php @@ -0,0 +1,30 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<h1> Welcome! </h1> +<p> + Installing Gallery is very easy. We just need to know how to talk + to your MySQL database, and we need a place to store your photos on + your web host. +</p> + + +<fieldset> + <legend>Photo Storage</legend> + <?php if (empty($writable)): ?> + <p class="error"> + We're having trouble creating a place for your photos. Can you + help? Please create a directory called "var" using <code>mkdir var</code> in your + gallery3 directory, then run <code>chmod 777 var</code>. That + should fix it. + <br/><br/> + <a href="index.php">Check again</a> + <br /><br/> + <i>(Please fix the photo storage problem before continuing)</i> + </p> + <?php else: ?> + <p class="success"> + We've found a place to store your photos: + <code class="location"> <?= VARPATH ?> </code> + </p> + <?php endif ?> +</fieldset> + diff --git a/installer/web.php b/installer/web.php index 78784539..fd75d352 100644 --- a/installer/web.php +++ b/installer/web.php @@ -20,6 +20,12 @@ if (installer::already_installed()) { $content = render("success.html.php"); } else { + $config = array("host" => empty($_POST["dbhost"]) ? "localhost" : $_POST["dbhost"], + "user" => empty($_POST["dbuser"]) ? "root" : $_POST["dbuser"], + "password" => empty($_POST["dbpass"]) ? "" : $_POST["dbpass"], + "dbname" => empty($_POST["dbname"]) ? "gallery3" : $_POST["dbname"], + "prefix" => empty($_POST["prefix"]) ? "" : $_POST["prefix"], + "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql"); switch (@$_GET["step"]) { default: case "welcome": @@ -27,18 +33,13 @@ if (installer::already_installed()) { if ($errors) { $content = render("environment_errors.html.php", array("errors" => $errors)); } else { - $content = render("get_db_info.html.php"); + $request_db_info = $is_var_writable = installer::var_writable(); + $content = render("var_dir_status.html.php", array("writable" => $is_var_writable)); } break; case "save_db_info": - $config = array("host" => $_POST["dbhost"], - "user" => $_POST["dbuser"], - "password" => $_POST["dbpass"], - "dbname" => $_POST["dbname"], - "prefix" => $_POST["prefix"], - "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql"); - + $request_db_info = true; if (!installer::connect($config)) { $content = render("invalid_db_info.html.php"); } else if (!installer::select_db($config)) { @@ -58,6 +59,7 @@ if (installer::already_installed()) { $content = render("success.html.php", array("user" => $user, "password" => $password)); installer::create_private_key($config); + $request_db_info = false; } catch (Exception $e) { $content = oops($e->getMessage()); } @@ -66,6 +68,9 @@ if (installer::already_installed()) { } } +if (empty($errors) && !empty($request_db_info)) { + $database_form = render("get_db_info.html.php", $config); +} include("views/install.html.php"); function render($view, $args=array()) { |