forked from github/kensanata.oddmuse
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d94d571881 | ||
|
|
d663c2b61d |
@@ -76,8 +76,8 @@ sub LoadLanguage {
|
||||
next unless $file; # file is not listed, eg. there is no file for "de-ch"
|
||||
$file = "$LoadLanguageDir/$file" if defined $LoadLanguageDir;
|
||||
if (IsFile($file)) {
|
||||
do "./$file";
|
||||
do "./$ConfigFile-$Lang{$_}" if IsFile("$ConfigFile-$Lang{$_}");
|
||||
do $file;
|
||||
do "$ConfigFile-$Lang{$_}" if IsFile("$ConfigFile-$Lang{$_}");
|
||||
$CurrentLanguage = $Lang{$_};
|
||||
last;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
my $wiki = $ARGV[0] || 'wiki.pl';
|
||||
my $wiki = $ARGV[0] || './wiki.pl';
|
||||
my $port = $ARGV[1] || 8080;
|
||||
my $dir = $ARGV[2];
|
||||
$ENV{WikiDataDir} = $dir if $dir;
|
||||
@@ -25,7 +25,7 @@ $ENV{WikiDataDir} = $dir if $dir;
|
||||
use base qw(HTTP::Server::Simple::CGI);
|
||||
|
||||
$OddMuse::RunCGI = 0;
|
||||
do "./$wiki"; # load just once
|
||||
do $wiki; # load just once
|
||||
|
||||
sub handle_request {
|
||||
my $self = shift;
|
||||
|
||||
@@ -384,7 +384,7 @@ sub start_server {
|
||||
} elsif ($pid == 0) {
|
||||
use Config;
|
||||
my $secure_perl_path = $Config{perlpath};
|
||||
exec($secure_perl_path, "stuff/server.pl", "wiki.pl", $port) or die "Cannot exec: $!";
|
||||
exec($secure_perl_path, "stuff/server.pl", "./wiki.pl", $port) or die "Cannot exec: $!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
5
wiki.pl
5
wiki.pl
@@ -69,6 +69,7 @@ our $UseConfig //= 1;
|
||||
our $DataDir;
|
||||
$DataDir ||= decode_utf8($ENV{WikiDataDir}) if $UseConfig;
|
||||
$DataDir ||= '/tmp/oddmuse'; # FIXME: /var/opt/oddmuse/wiki ?
|
||||
$DataDir = "./$DataDir" unless $DataDir =~ m!^(/|\./)!;
|
||||
|
||||
our $ConfigFile;
|
||||
$ConfigFile ||= $ENV{WikiConfigFile} if $UseConfig;
|
||||
@@ -233,7 +234,7 @@ sub InitModules {
|
||||
if (not $MyInc{$lib}) {
|
||||
$MyInc{$lib} = 1; # Cannot use %INC in mod_perl settings
|
||||
my $file = encode_utf8($lib);
|
||||
do "./$file";
|
||||
do $file;
|
||||
$Message .= CGI::p("$lib: $@") if $@; # no $q exists, yet
|
||||
}
|
||||
}
|
||||
@@ -242,7 +243,7 @@ sub InitModules {
|
||||
|
||||
sub InitConfig {
|
||||
if ($UseConfig and $ConfigFile and not $INC{$ConfigFile} and IsFile($ConfigFile)) {
|
||||
do "./$ConfigFile"; # these options must be set in a wrapper script or via the environment
|
||||
do $ConfigFile; # these options must be set in a wrapper script or via the environment
|
||||
$Message .= CGI::p("$ConfigFile: $@") if $@; # remember, no $q exists, yet
|
||||
}
|
||||
if ($ConfigPage) { # $FS and $MaxPost must be set in config file!
|
||||
|
||||
Reference in New Issue
Block a user