星期五, 九月 29, 2006

wp的config分析 learn wordpress (9)

定义常量的方式
define('DB_NAME', 'wordpress_test');
定义变量的方式
$table_prefix = 'wp_';

数据库设置
DB_NAME DB_USER DB_PASSWORD DB_HOST
table_prefix

多语言设置
WPLANG

当前文件的绝对路径
define('ABSPATH', dirname(__FILE__).'/');
#PS:这个强烈建议去做,在一个预定的位置来记录路径,在以这个路径为基本进行路径组合。
省得当前文件在哪自己都不知道了,特别是在包含来包含去的时候。

从外部导入设置
require_once(ABSPATH.'wp-settings.php');
在wp-setting中对环境进行了一些设置 可以参看前面的几篇文章

wp-setting中进行不需要人为干预的环境初始化

3 条评论:

匿名 说...

It's every webmasters dream to have large amounts of traffic isn't it? I want to share with you a brand new program that came out Dec 28 2010 that is make people a HUGE amount of money. Go to this website and take a quick look. [url=http://www.massmoney-makers.net]Mass Money Makers[/url]

匿名 说...

rosubbmpj http://crush-the-castle.com Crush The Castle

匿名 说...

Hi, Merely came back here to advise you about Mobile Monopoly. This is a superb technique and WILL make you money, especially seeing as you own a web site. Take a quick look at the video, the system is about using Mobile Advertising which is brand new and an unexposed market where you can make thousands by doing hardly any work. I promise you that after you watch their short video it will change you and it will start making you think. http://mobile-mastermind.com