SCode的tmpdir路径

    SCode是一个非常有名的MT防垃圾留言插件, 在安装这个插件时, 需要对SCode.pm代码行修改, 指定一个临时路径的位置.

# tmp directory
# Notice the '/' at the end . You need to have that '/'
# ie, my $tmpdir = "/tmp' wont work. You need '/tmp/'
my $tmpdir = "/tmp/";

    这给安装造成了一定的麻烦, 其实我们只要在SCode.pm中加入如下几行代码.

sub init {
    my $app = shift;
    $tmpdir = $app->config('TempDir')."/";
    $app;
}

    再在mt-config.cgi中加入一行指定临时目录位置.

#Temp dir for MT and SCode
TempDir /home/username/temp

    这样就不需要去修改SCode.pm文件了.

发表留言: