package SB::Messages;

use strict;
use warnings;
require SB::Utils;

use subs qw(getMessage);

BEGIN {
	use Exporter;
	our (@ISA, $VERSION, @EXPORT, @EXPORT_OK);
	$VERSION        =  4.00;
	@ISA = qw(Exporter);
    @EXPORT    = qw(getMessage);
}

my %messages = (
    root_msg => "This script can be run only under ROOT\n",
    mysql_not_avail		=> "Could not connect to MySQL server on ",
    set_proper_mysql_settings => "Please define proper connection settings using the --db_host and --db_port keys.\n",
    httpd_owner_invalid => "The httpd_owner value is invalid.\n Please define proper parameter using the owner:group format.\n",
    cant_create_vhost   =>  "...could not create virtual host for SiteBuilder.\n",
    cant_start_httpd    =>  "...failed to start HTTPD.\n",
    vhost_created	=>  "Virtual host for SiteBuilder has been created.\n",
    vhost_creation	=>  "Virtual host creation",
    db_creation		=>  "Database creation",
    db_exist        =>  "Database already exists.\n",
    cant_chown		=>  "Could not change owner of the",
    try_chown		=>  "Try to set proper owner manually.\n",
    db_created 		=>  "Database has been created.\n",
    module_not_installed => "Module has NOT been installed properly.\n",
    httpd_will_restarted => "Apache service will be restarted and MySQL database will be modified during configuration.\n",
    do_you_want		 => "Do you want to continue? [Y/n]",
    ioncube_not_detected => "The PHP IonCube loader is not detected. \n",
    phpcli_not_detected => "Unable to determine the path to PHP-CLI(5.1). \n",
    phpcgi_not_detected => "Unable to determine the path to PHP-CGI(5.1). \n",
    install_finished    =>  "Reconfiguration has been finished.\n",
    is_available	=>  "SiteBuilder will be available on ",
    modules_installed   =>  "Modules have been updated.\n",
    modules_failed   =>  "Critical errors occured while updating MODULES!\n",
    locales_failed   =>  "Critical errors occured while updating LOCALES!\n",
    locales_installed   =>  "Locales have been updated.\n",
    templates_failed   =>  "Critical errors occured while updating TEMPLATES!\n",
    templates_installed   =>  "Templates have been updated.\n",
    cant_connect_db     => "Could not connect to SiteBuilder database ",
    config_log          => "Detailed log has been saved to ",
    try_help		=> "Try `--help' for more information. \n",
    memlimit_update_failed => "Cannot set proper memory limit in php.ini\n",
    memlimit_update_success => "Memory limit has been updated.\n",
    cant_parse_psa_config => "Cannot parse Plesk config file\n", 
    line	  	=> ("-" x 30)."\n"
);

sub getMessage($) {
	my $key = shift;
	return $messages{$key};
}
