[pLog-svn] r3194 - in plog/trunk: . install

mark at devel.lifetype.net mark at devel.lifetype.net
Wed Apr 5 13:59:54 GMT 2006


Author: mark
Date: 2006-04-05 13:59:53 +0000 (Wed, 05 Apr 2006)
New Revision: 3194

Modified:
   plog/trunk/install/defaultconfig.properties.php
   plog/trunk/wizard.php
Log:
I think everyone will be happy. The config index become the config_key now.

And, the upgrade process will check the key is exist or not. If not, we will insert the new key for them...

So, no more range(), I think.

Modified: plog/trunk/install/defaultconfig.properties.php
===================================================================
--- plog/trunk/install/defaultconfig.properties.php	2006-04-05 12:30:21 UTC (rev 3193)
+++ plog/trunk/install/defaultconfig.properties.php	2006-04-05 13:59:53 UTC (rev 3194)
@@ -1,129 +1,125 @@
 <?php
 
-// Inserts Query Counter
-$i = 0;
+$Inserts['comments_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_enabled','1',1);";
+$Inserts['rdf_enabled'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rdf_enabled','1',1);";
+$Inserts['temp_folder'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('temp_folder','./tmp',3);";
+$Inserts['base_url'] 										= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('base_url','{plog_base_url}',3);";
+$Inserts['show_posts_max'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_posts_max','15',1);";
+$Inserts['recent_posts_max'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('recent_posts_max','10',1);";
+$Inserts['default_template'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_template','standard',3);";
+$Inserts['template_folder'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_folder','./templates',3);";
+$Inserts['default_blog_id'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_blog_id','1',1);";
+$Inserts['default_locale'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_locale','en_UK',3);";
+$Inserts['html_allowed_tags_in_comments'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('html_allowed_tags_in_comments','<a><i><br><br/><b>',3);";
+$Inserts['referer_tracker_enabled'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('referer_tracker_enabled','1',1);";
+$Inserts['rss_parser_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rss_parser_enabled','1',1);";
+$Inserts['show_more_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_enabled','1',1);";
+$Inserts['show_more_threshold'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_threshold','150',1);";
+$Inserts['update_article_reads'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_article_reads','1',1);";
+$Inserts['email_service_enabled'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_enabled','1',1);";
+$Inserts['post_notification_source_address'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_notification_source_address','noreply at your.host.com',3);";
+$Inserts['request_format_mode'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('request_format_mode','1',1);";
+$Inserts['xmlrpc_ping_hosts'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_hosts','a:2:{i:0;s:27:\"http://rpc.weblogs.com/RPC2\";i:1;s:0:\"\";}',5);";
+$Inserts['trackback_server_enabled'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('trackback_server_enabled','1',1);";
+$Inserts['htmlarea_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('htmlarea_enabled','1',1);";
+$Inserts['plugin_manager_enabled'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('plugin_manager_enabled','1',1);";
+$Inserts['check_email_address_validity'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('check_email_address_validity','0',1);";
+$Inserts['summary_page_show_max'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_page_show_max','15',1);";
+$Inserts['minimum_password_length'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('minimum_password_length','4',1);";
+$Inserts['templates'] 										= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('templates','a:3:{i:0;s:7:\"blueish\";i:1;s:4:\"grey\";i:2;s:8:\"standard\";}',5);";
+$Inserts['locales'] 										= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locales','a:0:{}',5)";
+$Inserts['email_service_type'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_type','php',3);";
+$Inserts['smtp_host'] 										= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_host','your.smtp.host.com',3);";
+$Inserts['smtp_port'] 										= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_port','25',1);";
+$Inserts['smtp_use_authentication'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_use_authentication','0',1);";
+$Inserts['smtp_username'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_username','',3);";
+$Inserts['smtp_password'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_password','',3);";
+$Inserts['locale_folder'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locale_folder','./locale',3);";
+$Inserts['xmlrpc_ping_enabled'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_enabled','0',1);";
+$Inserts['path_to_tar'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_tar','{path_to_tar}',3);";
+$Inserts['path_to_gzip'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_gzip','{path_to_gzip}',3);";
+$Inserts['path_to_bz2'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_bz2','{path_to_bz2}',3);";
+$Inserts['path_to_unzip'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_unzip','{path_to_unzip}',3);";
+$Inserts['users_can_add_templates'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('users_can_add_templates',1,1);";
+$Inserts['maximum_file_upload_size'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_file_upload_size', 2000000, 1);";
+$Inserts['upload_forbidden_files'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('upload_forbidden_files', '*.php *.php3 *.php4 *.phtml *.htm *.html *.exe *.com *.bat .htaccess *.sh', 3);";
+$Inserts['comments_order'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_order', 1, 1);";
+$Inserts['security_pipeline_enabled'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('security_pipeline_enabled', 1, 1);";
+$Inserts['maximum_comment_size'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_comment_size', 0, 1 );";
+$Inserts['resources_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_enabled', 1, 1 );";
+$Inserts['thumbnail_method'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_method', 'gd', 3);";
+$Inserts['path_to_convert'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_convert', '{path_to_convert}', 3);";
+$Inserts['thumbnail_height'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_height', 120, 1);";
+$Inserts['thumbnail_width'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_width', 120, 1);";
+$Inserts['thumbnails_keep_aspect_ratio'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnails_keep_aspect_ratio', 1, 1);";
+$Inserts['xmlrpc_api_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_api_enabled', 1, 1);";
+$Inserts['uploads_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('uploads_enabled', 1, 1);";
+$Inserts['default_rss_profile'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_rss_profile', 'rss090', 3);";
+$Inserts['bayesian_filter_enabled'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_enabled', 1, 2);";
+$Inserts['bayesian_filter_spam_probability_treshold'] 		= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_spam_probability_treshold', '0.9', 6);";
+$Inserts['bayesian_filter_nonspam_probability_treshold'] 	= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_nonspam_probability_treshold', '0.2', 6);";
+$Inserts['bayesian_filter_min_length_token'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_min_length_token', '3', 1);";
+$Inserts['bayesian_filter_max_length_token'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_max_length_token', '100', 1);";
+$Inserts['bayesian_filter_number_significant_tokens'] 		= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_number_significant_tokens', 15, 1);";
+$Inserts['bayesian_filter_spam_comments_action'] 			= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_spam_comments_action', 0, 1 );";
+$Inserts['ip_address_filter_enabled'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('ip_address_filter_enabled', 1, 1 );";
+$Inserts['content_filter_enabled'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('content_filter_enabled', 1, 1 );";
+$Inserts['thumbnail_format'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_format','same',3);";
+$Inserts['resources_folder'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_folder','./gallery/',3);";
+$Inserts['beautify_comments_text'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('beautify_comments_text', '1', 1);";
+$Inserts['disable_apache_error_handler'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('disable_apache_error_handler', '0', 1);";
+$Inserts['show_future_posts_in_calendar'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_future_posts_in_calendar', '0', 1);";
+$Inserts['xhtml_converter_enabled'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xhtml_converter_enabled', '1', 1);";
+$Inserts['xhtml_converter_aggresive_mode_enabled'] 			= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xhtml_converter_aggresive_mode_enabled', '0', 1);";
+$Inserts['search_engine_enabled'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('search_engine_enabled', '1', 1);";
+$Inserts['search_in_custom_fields'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('search_in_custom_fields', '1', 1);";
+$Inserts['search_in_comments'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('search_in_comments', '1', 1);";
+$Inserts['resources_quota'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_quota', '0', 1);";
+$Inserts['category_link_format'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('category_link_format', '/blog/{blogname}/{catname}$', 3);";
+$Inserts['blog_link_format'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('blog_link_format', '/blog/{blogname}$', 3);";
+$Inserts['archive_link_format'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('archive_link_format', '/blog/{blogname}/archives/{year}/?{month}/?{day}', 3);";
+$Inserts['user_posts_link_format'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('user_posts_link_format', '/blog/{blogname}/user/{username}$', 3);";
+$Inserts['post_trackbacks_link_format'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_trackbacks_link_format', '/blog/{blogname}/post/trackbacks/{postname}$', 3);";
+$Inserts['template_link_format'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_link_format', '/blog/{blogname}/content/{templatename}$', 3);";
+$Inserts['album_link_format'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('album_link_format', '/blog/{blogname}/album/{albumname}$', 3);";
+$Inserts['resource_link_format'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_link_format', '/blog/{blogname}/resource/{albumname}/{resourcename}$', 3);";
+$Inserts['resource_preview_link_format'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview/{resourcename}$', 3);";
+$Inserts['resource_medium_size_preview_link_format'] 		= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_medium_size_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$', 3);";
+$Inserts['resource_download_link_format'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_download_link_format', '/blog/{blogname}/resource/{albumname}/download/{resourcename}$', 3);";
+$Inserts['permalink_format'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('permalink_format', '/blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$', 3);";
+$Inserts['script_name'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('script_name', 'index.php', 3);";
+$Inserts['resource_server_use_http_caching'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_server_use_http_caching', '1', 1);";
+$Inserts['medium_size_thumbnail_width'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('medium_size_thumbnail_width', '640', 1);";
+$Inserts['medium_size_thumbnail_height'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('medium_size_thumbnail_height', '480', 1);";
+$Inserts['subdomains_enabled'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('subdomains_enabled', '0', 1);";
+$Inserts['include_blog_id_in_url'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('include_blog_id_in_url', '1', 1);";
+$Inserts['send_xmlrpc_pings_enabled_by_default'] 			= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('send_xmlrpc_pings_enabled_by_default', '1', 1);";
+$Inserts['forbidden_usernames'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('forbidden_usernames', 'admin www blog ftp wiki forums', 3);";
+$Inserts['force_registration_confirmation'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('force_registration_confirmation', '0', 1);";
+$Inserts['summary_blogs_per_page'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_blogs_per_page', '25', 3);";
+$Inserts['subdomains_base_url'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('subdomains_base_url', '', 3);";
+$Inserts['autosave_new_drafts_time_millis'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('autosave_new_drafts_time_millis', '300000', 3);";
+$Inserts['save_drafts_via_xmlhttprequest_enabled'] 			= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('save_drafts_via_xmlhttprequest_enabled', '1', 1);";
+$Inserts['need_email_confirm_registration'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('need_email_confirm_registration', '1', 1);";
+$Inserts['force_one_blog_per_email_account'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('force_one_blog_per_email_account', '0', 1);";
+$Inserts['summary_show_agreement'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_show_agreement', '1', 1);";
+$Inserts['default_time_offset'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_time_offset', '0', 3);";
+$Inserts['template_cache_enabled'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_cache_enabled', '1', 1);";
+$Inserts['template_http_cache_enabled'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_http_cache_enabled', '0', 1);";
+$Inserts['template_compile_check'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_compile_check', '1', 1);";
+$Inserts['update_cached_article_reads'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_cached_article_reads', '1', 1);";
+$Inserts['allow_php_code_in_templates'] 					= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('allow_php_code_in_templates', '0', 1);";
+$Inserts['thumbnail_generator_use_smoothing_algorithm'] 	= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_generator_use_smoothing_algorithm', '1', 1);";
+$Inserts['template_cache_lifetime'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_cache_lifetime', '-1', 3);";
+$Inserts['use_http_accept_language_detection'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('use_http_accept_language_detection', '0', 1);";
+$Inserts['session_save_path'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('session_save_path', '', 3);";
+$Inserts['skip_dashboard'] 									= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('skip_dashboard', '0', 1);";
+$Inserts['use_captcha_auth'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('use_captcha_auth', '0', 1);";
+$Inserts['page_suffix_format'] 								= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('page_suffix_format', '/page/{page}', 3);";
+$Inserts['urlize_word_separator'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('urlize_word_separator', '_', 3);";
+$Inserts['summary_template_cache_lifetime'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_template_cache_lifetime', '0', 1 );";
+$Inserts['http_cache_lifetime'] 							= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('http_cache_lifetime', '1800', 1 );";
+$Inserts['blog_does_not_exist_url'] 						= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('blog_does_not_exist_url','{plog_base_url}',3);";
+$Inserts['default_global_article_category_id'] 				= "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_global_article_category_id','1',1);";
 
-// Inserts Queries
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rdf_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('temp_folder','./tmp',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('base_url','{plog_base_url}',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_posts_max','15',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('recent_posts_max','10',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_template','standard',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_folder','./templates',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_blog_id','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_locale','en_UK',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('html_allowed_tags_in_comments','<a><i><br><br/><b>',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('referer_tracker_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rss_parser_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_threshold','150',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_article_reads','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_notification_source_address','noreply at your.host.com',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('request_format_mode','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_hosts','a:2:{i:0;s:27:\"http://rpc.weblogs.com/RPC2\";i:1;s:0:\"\";}',5);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('trackback_server_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('htmlarea_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('plugin_manager_enabled','1',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('check_email_address_validity','0',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_page_show_max','15',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('minimum_password_length','4',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('templates','a:3:{i:0;s:7:\"blueish\";i:1;s:4:\"grey\";i:2;s:8:\"standard\";}',5);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locales','a:0:{}',5)";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_type','php',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_host','your.smtp.host.com',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_port','25',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_use_authentication','0',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_username','',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_password','',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locale_folder','./locale',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_enabled','0',1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_tar','{path_to_tar}',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_gzip','{path_to_gzip}',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_bz2','{path_to_bz2}',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_unzip','{path_to_unzip}',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('users_can_add_templates',1,1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_file_upload_size', 2000000, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('upload_forbidden_files', '*.php *.php3 *.php4 *.phtml *.htm *.html *.exe *.com *.bat .htaccess *.sh', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_order', 1, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('security_pipeline_enabled', 1, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_comment_size', 0, 1 );";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_enabled', 1, 1 );";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_method', 'gd', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_convert', '{path_to_convert}', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_height', 120, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_width', 120, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnails_keep_aspect_ratio', 1, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_api_enabled', 1, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('uploads_enabled', 1, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_rss_profile', 'rss090', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_enabled', 1, 2);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_spam_probability_treshold', '0.9', 6);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_nonspam_probability_treshold', '0.2', 6);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_min_length_token', '3', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_max_length_token', '100', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_number_significant_tokens', 15, 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('bayesian_filter_spam_comments_action', 0, 1 );";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('ip_address_filter_enabled', 1, 1 );";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('content_filter_enabled', 1, 1 );";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_format','same',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_folder','./gallery/',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('beautify_comments_text', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('disable_apache_error_handler', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_future_posts_in_calendar', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xhtml_converter_enabled', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xhtml_converter_aggresive_mode_enabled', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('search_engine_enabled', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('search_in_custom_fields', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('search_in_comments', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_quota', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('category_link_format', '/blog/{blogname}/{catname}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('blog_link_format', '/blog/{blogname}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('archive_link_format', '/blog/{blogname}/archives/{year}/?{month}/?{day}', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('user_posts_link_format', '/blog/{blogname}/user/{username}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_trackbacks_link_format', '/blog/{blogname}/post/trackbacks/{postname}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_link_format', '/blog/{blogname}/content/{templatename}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('album_link_format', '/blog/{blogname}/album/{albumname}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_link_format', '/blog/{blogname}/resource/{albumname}/{resourcename}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview/{resourcename}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_medium_size_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_download_link_format', '/blog/{blogname}/resource/{albumname}/download/{resourcename}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('permalink_format', '/blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('script_name', 'index.php', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resource_server_use_http_caching', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('medium_size_thumbnail_width', '640', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('medium_size_thumbnail_height', '480', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('subdomains_enabled', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('include_blog_id_in_url', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('send_xmlrpc_pings_enabled_by_default', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('forbidden_usernames', 'admin www blog ftp wiki forums', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('force_registration_confirmation', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_blogs_per_page', '25', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('subdomains_base_url', '', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('autosave_new_drafts_time_millis', '300000', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('save_drafts_via_xmlhttprequest_enabled', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('need_email_confirm_registration', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('force_one_blog_per_email_account', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_show_agreement', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_time_offset', '0', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_cache_enabled', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_http_cache_enabled', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_compile_check', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_cached_article_reads', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('allow_php_code_in_templates', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_generator_use_smoothing_algorithm', '1', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_cache_lifetime', '-1', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('use_http_accept_language_detection', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('session_save_path', '', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('skip_dashboard', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('use_captcha_auth', '0', 1);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('page_suffix_format', '/page/{page}', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('urlize_word_separator', '_', 3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_template_cache_lifetime', '0', 1 );";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('http_cache_lifetime', '1800', 1 );";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('blog_does_not_exist_url','{plog_base_url}',3);";
-$Inserts[$i++] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_global_article_category_id','1',1);";
-
 ?>
\ No newline at end of file

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2006-04-05 12:30:21 UTC (rev 3193)
+++ plog/trunk/wizard.php	2006-04-05 13:59:53 UTC (rev 3194)
@@ -756,7 +756,6 @@
                 return false;
             }
 
-            // try to guess the url where plog is running
              // try to guess the url where plog is running
              $httpProtocol = (array_key_exists("HTTPS", $_SERVER) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
              $httpHost = $_SERVER["HTTP_HOST"];
@@ -1207,17 +1206,42 @@
                 $message .= "** Modifications to old tables carried out successfully **<br/><br/>";
             }
 
-            // ---
-            // add the new configuration settings that were added for 1.1
-            // ---
-            $newSettings = range( 114, 119 );
-            foreach( $newSettings as $settingId ) {
-                $setting = $Inserts[$settingId];
-                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $setting );
-                if( !$this->_db->Execute( $query )) {
-                    $message .= "There was an error executing: ".$this->_db->ErrorMsg()."<br/>";
-                    $errors = true;
-                }
+            // check the configuration and add the new configuration settings that were added for 1.1
+            foreach( $Inserts as $key => $insert ) {
+				$checkKeyQuery = "SELECT * FROM ".$this->_dbPrefix."config WHERE config_key ='".$key."';";
+				$result = $this->_db->Execute($checkKeyQuery);
+				if ($result->RecordCount() == 0)
+				{
+		            // try to guess the url where plog is running
+		            $httpProtocol = (array_key_exists("HTTPS", $_SERVER) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
+		            $httpHost = $_SERVER["HTTP_HOST"];
+		            $requestUrl = $_SERVER["REQUEST_URI"];
+		            $requestUrl = str_replace( "/wizard.php", "", $requestUrl );
+		            $plogUrl = $httpProtocol.$httpHost.$requestUrl;
+		            // Find some of the tools we are going to need (last one is for os x, with fink installed)
+		            // TBD: support for Windows specific directories
+		            $folders = Array( "/bin/", "/usr/bin/", "/usr/local/bin/", "/sw/bin/" );
+		            $finder = new FileFinder();
+		            $pathToUnzip = $finder->findBinary( "unzip", $folders );
+		            $pathToTar = $finder->findBinary( "tar", $folders);
+		            $pathToGzip = $finder->findBinary( "gzip", $folders);
+		            $pathToBzip2 = $finder->findBinary( "bzip2", $folders);
+		            $pathToConvert = $finder->findBinary( "convert", $folders);
+	                // replace the de prefix and base url
+	                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $insert );
+	                $query = str_replace( "{plog_base_url}", $plogUrl, $query );
+	                // replace also the placeholders for the paths to the tools
+	                $query = str_replace( "{path_to_tar}", $pathToTar, $query );
+	                $query = str_replace( "{path_to_unzip}", $pathToUnzip, $query );
+	                $query = str_replace( "{path_to_bz2}", $pathToBzip2, $query );
+	                $query = str_replace( "{path_to_gzip}", $pathToGzip, $query );
+	                $query = str_replace( "{path_to_convert}", $pathToConvert, $query );
+	                $query = str_replace( "{path_to_convert}", $pathToConvert, $query );
+	                if( !$this->_db->Execute( $query )) {
+	                    $message .= "Error executing code: ".$this->_db->ErrorMsg()."<br/>";
+	                    $errors = true;
+	                }
+	            }
             }
 
             //



More information about the pLog-svn mailing list