<commit_before># --
# Kernel/Modules/Installer.pm - provides the DB installer
# Copyright (C) 2001-2003 <NAME> <<EMAIL>>
# --
# $Id: Installer.pm,v 1.25 2003-07-01 18:26:26 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --

# Note: this is the first version to support mysql. More databases 
# later.

package Kernel::Modules::Installer;

use strict;
use DBI;

use vars qw($VERSION);
$VERSION = '$Revision: 1.25 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;

# --
sub new {
    my $Type = shift;
    my %Param = @_;

    # allocate new hash for object
    my $Self = {}; 
    bless ($Self, $Type);

    foreach (keys %Param) {
        $Self->{$_} = $Param{$_};
    }

    # check needed Opjects
    foreach (qw(ParamObject LayoutObject LogObject ConfigObject)) {
        die "Got no $_!" if (!$Self->{$_});
    }

    # find fs dir (because of mod_perl2)
    $Self->{Path} = $ENV{SCRIPT_FILENAME};
    $Self->{Path} =~ s/^(.*\/).+?$/$1/;

    return $Self;
}
# --
sub Run {
    my $Self = shift;
    my %Param = @_;
    my $Output = '';
    # --
    # get sql source
    # --
    my $DirOfSQLFiles = $Self->{Path}.'../../scripts/database';
    if (! -d $DirOfSQLFiles) {
        $Output .= $Self->{LayoutObject}->Header(Title => 'Error');
        $Output .= $Self->{LayoutObject}->Error(
               Message => "Directory '$DirOfSQLFiles' not found!",
               Comment => 'Contact your Admin!',
        );
        $Output .= $Self->{LayoutObject}->Footer();
        return $Output;
    } 
    elsif (! -f "$DirOfSQLFiles/otrs-schema.xml") {
        $Output .= $Self->{LayoutObject}->Header(Title => 'Error');
        $Output .= $Self->{LayoutObject}->Error(
               Message => "File '$DirOfSQLFiles/otrs-schema.xml' not found!",
               Comment => 'Contact your Admin!',
        );
        $Output .= $Self->{LayoutObject}->Footer();
        return $Output;
    }
    if (! -f "$Self->{Path}../../Kernel/Config.pm") {
        $Output .= $Self->{LayoutObject}->Header(Title => 'Error');
        $Output .= $Self->{LayoutObject}->Error(
               Message => "File '$Self->{Path}../../Kernel/Config.pm' not found!",
               Comment => 'Contact your Admin!',
        );
        $Output .= $Self->{LayoutObject}->Footer();
        return $Output;
    }
    # --
    # check dist
    # --
    my %Dist = ();
    $Dist{Vendor} = "Unix/Linux";
    $Dist{Webserver} = "no webserver detected, restart your webserver";<commit_msg>fixed typo<commit_after># --
# Kernel/Modules/Installer.pm - provides the DB installer
# Copyright (C) 2001-2003 <NAME> <<EMAIL>>
# --
# $Id: Installer.pm,v 1.26 2003-09-28 20:32:07 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --

# Note: this is the first version to support mysql. More databases 
# later.

package Kernel::Modules::Installer;

use strict;
use DBI;

use vars qw($VERSION);
$VERSION = '$Revision: 1.26 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;

# --
sub new {
    my $Type = shift;
    my %Param = @_;

    # allocate new hash for object
    my $Self = {}; 
    bless ($Self, $Type);

    foreach (keys %Param) {
        $Self->{$_} = $Param{$_};
    }

    # check needed Opjects
    foreach (qw(ParamObject LayoutObject LogObject ConfigObject)) {
        die "Got no $_!" if (!$Self->{$_});
    }

    # find fs dir (because of mod_perl2)
    $Self->{Path} = $ENV{SCRIPT_FILENAME};
    $Self->{Path} =~ s/^(.*\/).+?$/$1/;

    return $Self;
}
# --
sub Run {
    my $Self = shift;
    my %Param = @_;
    my $Output = '';
    # --
    # get sql source
    # --
    my $DirOfSQLFiles = $Self->{Path}.'../../scripts/database';
    if (! -d $DirOfSQLFiles) {
        $Output .= $Self->{LayoutObject}->Header(Title => 'Error');
        $Output .= $Self->{LayoutObject}->Error(
               Message => "Directory '$DirOfSQLFiles' not found!",
               Comment => 'Contact your Admin!',
        );
        $Output .= $Self->{LayoutObject}->Footer();
        return $Output;
    } 
    elsif (! -f "$DirOfSQLFiles/otrs-schema.xml") {
        $Output .= $Self->{LayoutObject}->Header(Title => 'Error');
        $Output .= $Self->{LayoutObject}->Error(
               Message => "File '$DirOfSQLFiles/otrs-schema.xml' not found!",
               Comment => 'Contact your Admin!',
        );
        $Output .= $Self->{LayoutObject}->Footer();
        return $Output;
    }
    if (! -f "$Self->{Path}../../Kernel/Config.pm") {
        $Output .= $Self->{LayoutObject}->Header(Title => 'Error');
        $Output .= $Self->{LayoutObject}->Error(
               Message => "File '$Self->{Path}../../Kernel/Config.pm' not found!",
               Comment => 'Contact your Admin!',
        );
        $Output .= $Self->{LayoutObject}->Footer();
        return $Output;
    }
    # --
    # check dist
    # --
    my %Dist = ();
    $Dist{Vendor} = "Unix/Linux";
    $Dist{Webserver} = "restart your webserver";
{'fraction_non_alphanumeric': 0.1956771231828615, 'fraction_numerical': 0.011859219586840091, 'mean_word_length': 2.278369905956113, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1523638', 'n_tokens_mistral': 1795, 'n_tokens_neox': 1718, 'n_words': 415}