- remove the default domain setting from main config file.

This commit is contained in:
wangchunsheng
2010-01-26 03:13:55 +00:00
parent f52d673492
commit 27a182780f
4 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -44,7 +44,6 @@ $config->default->lang = 'zh-cn'; // Ĭ
$config->default->theme = 'default'; // 默认的主题。
$config->default->module = 'index'; // 默认的模块。当请求中没有指定模块时,加载该模块。
$config->default->method = 'index'; // 默认的方法。当请求中没有指定方法或者指定的方法不存在时,调用该方法。
$config->default->domain = 'pms.easysoft.com'; // 默认的域名,当请求中的域名没有对应的记录时,使用此默认域名对应的公司信息。
$config->file->dangers = 'php,jsp,py,rb,asp,'; // 不允许上传的文件类型列表。
$config->file->maxSize = 1024 * 1024; // 允许上传的文件大小,单位为字节。
@@ -57,6 +56,7 @@ $config->db->encoding = 'UTF8'; //
/* 包含自定义配置文件。*/
$myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php';
if(file_exists($myConfig)) include $myConfig;
if(!isset($config->db->prefix)) $config->db->prefix = 'zt_';
/* 数据表的定义。*/
define('TABLE_ACTION', $config->db->prefix . 'action');
+1 -1
View File
@@ -304,7 +304,7 @@ EOT;
else
{
$company = $this->company->getByDomain();
if(!$company) $company = $this->company->getByDomain($this->config->default->domain);
if(!$company and isset($this->config->default->domain)) $company = $this->company->getByDomain($this->config->default->domain);
if(!$company) $this->app->error(sprintf($this->lang->error->companyNotFound, $_SERVER['HTTP_HOST']), __FILE__, __LINE__, $exit = true);
$_SESSION['company'] = $company;
$this->app->company = $company;
+1
View File
@@ -74,6 +74,7 @@ class install extends control
$this->view = (object)$_POST;
$this->view->lang = $this->lang;
$this->view->config = $this->config;
$this->view->domain = $this->server->HTTP_HOST;
$this->view->header->title = $this->lang->install->saveConfig;
$this->display();
}
+11 -10
View File
@@ -27,16 +27,17 @@ if(!isset($error))
{
$configContent = <<<EOT
<?php
\$config->installed = true; //标志是否已经安装。
\$config->debug = true; //是否打开debug功能。
\$config->webRoot = '$webRoot'; //web网站的根目录。
\$config->requestType = '$requestType'; //如何获取当前请求的信息,可选值:PATH_INFO|GET
\$config->db->host = '$dbHost'; //mysql主机。
\$config->db->port = '$dbPort'; //mysql主机端口号。
\$config->db->name = '$dbName'; //数据库名称。
\$config->db->user = '$dbUser'; //数据库用户名。
\$config->db->password = '$dbPassword'; //密码。
\$config->db->prefix = '$dbPrefix'; //表前缀。
\$config->installed = true; //标志是否已经安装。
\$config->debug = true; //是否打开debug功能。运行没有问题之后,可以将其改为false。
\$config->requestType = '$requestType'; //如何获取当前请求的信息,可选值:PATH_INFO|GET。
\$config->db->host = '$dbHost'; //mysql主机。
\$config->db->port = '$dbPort'; //mysql主机端口号。
\$config->db->name = '$dbName'; //数据库名称。
\$config->db->user = '$dbUser'; //数据库用户名。
\$config->db->password = '$dbPassword'; //密码。
\$config->db->prefix = '$dbPrefix'; //表前缀。
\$config->webRoot = '{$this->post->webRoot}'; //web网站的根目录。如果后面pms的目录有变化,需要修改此选项。
\$config->default->domain = '$domain'; //默认域名。
EOT;
}
?>