📄 config.pm
字号:
#!/usr/bin/perl -w## Copyright (C) 2005 Luke Reeves## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307# USA#package Insipid::Config;use CGI qw/:standard/;use vars qw(@ISA @EXPORT $pagepath $site_url $logged_in @errors);require Exporter;@ISA = qw(Exporter);@EXPORT = qw(getconfig $pagepath $site_url $logged_in @errors);use strict;use AppConfig qw(:argcount);my $config_file;if(-e "insipid-config.cgi") { $config_file = "insipid-config.cgi"; }# Read basic database and user configurationmy $config = AppConfig->new({ CREATE => 1, GLOBAL => {ARGCOUNT => ARGCOUNT_ONE} });$config->file($config_file);$logged_in = 0;$pagepath = getconfig("pagepath");my $hostname = "http://" . virtual_host();$site_url = sprintf("%s%s", $hostname, $pagepath);sub getconfig { my ($key) = (@_); return $config->get($key);}1;__END__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -