wp-load.php

<?php
/**
* Bootstrap file for setting the ABSPATH constant
* and loading the wp-config.php file. The wp-config.php
* file will then load the wp-settings.php file, which
* will then set up the WordPress environment.
*
* If the wp-config.php file is not found then an error
* will be displayed asking the visitor to set up the
* wp-config.php file.
*
* Will also search for wp-config.php in WordPress' parent
* directory to allow the WordPress directory to remain
* untouched.
*
* @internal This file must be parsable by PHP4.
*
* @package WordPress
*/ /** Define ABSPATH as this file's directory */
define( 'ABSPATH', dirname(__FILE__) . '/' ); error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); /*
* If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
* doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
* of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
* and /blog/ is WordPress(b).
*
* If neither set of conditions is true, initiate loading the setup process.
*/
if ( file_exists( ABSPATH . 'wp-config.php') ) {//第一次运行之前是没有wp-config.php这个文件的 /** The config file resides in ABSPATH */
require_once( ABSPATH . 'wp-config.php' ); } elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {//第一次运行之前也没有wp-settings.php这个文件 /** The config file resides one level above ABSPATH but is not part of another install */
require_once( dirname( ABSPATH ) . '/wp-config.php' ); } else { // A config file doesn't exist
// 所以第一次就是进来这里
define( 'WPINC', 'wp-includes' );
require_once( ABSPATH . WPINC . '/load.php' );// 加载load.php // Standardize $_SERVER variables across setups.
wp_fix_server_vars();// Fix `$_SERVER` variables for various setups.为了处理`$_SERVER`的一些启动变量 require_once( ABSPATH . WPINC . '/functions.php' );// Main WordPress API,wordpress 的主要api $path = wp_guess_url() . '/wp-admin/setup-config.php'; /*
* We're going to redirect to setup-config.php. While this shouldn't result
* in an infinite loop, that's a silly thing to assume, don't you think? If
* we're traveling in circles, our last-ditch effort is "Need more help?"
*/
if ( false === strpos( $_SERVER['REQUEST_URI'], 'setup-config' ) ) {
header( 'Location: ' . $path );// 跳转到setup-config.php 进入用户配置模式,作者说想避免死循环;
exit;
}
// 已经跳走的话,还要做什么?有可能存在一种情况,执行setup-config.php 的时候执行到这里?其实接下来已经是在打印错误信息了
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
require_once( ABSPATH . WPINC . '/version.php' );// 源码里面都没有这个文件啊 wp_check_php_mysql_versions();
wp_load_translations_early();// 大概是和国际化语言有关,具体不知道干嘛,但名字好搞笑,early 你妹啊 // Die with an error message
$die = sprintf(
/* translators: %s: wp-config.php */
__( "There doesn't seem to be a %s file. I need this before we can get started." ),
'<code>wp-config.php</code>'
) . '</p>';
$die .= '<p>' . sprintf(
/* translators: %s: Codex URL */
__( "Need more help? <a href='%s'>We got it</a>." ),
__( 'https://codex.wordpress.org/Editing_wp-config.php' )
) . '</p>';
$die .= '<p>' . sprintf(
/* translators: %s: wp-config.php */
__( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ),
'<code>wp-config.php</code>'
) . '</p>';
$die .= '<p><a href="' . $path . '" class="button button-large">' . __( "Create a Configuration File" ) . '</a>'; wp_die( $die, __( 'WordPress &rsaquo; Error' ) );// 打印错误信息
}

学php之翻译wordpress(2)的更多相关文章

  1. 学php之翻译wordpress(1)

    单看文件结构,wordpress分了3个文件夹 wp-admin,wp-content,wp-includes 和零散的一堆php,暂时不清楚各自的分工 入口文件是index.php <?php ...

  2. wordpress 插件 汉化

    http://blog.wpjam.com/article/localizing-a-wordpress-plugin-using-poedit/ 翻译或者说本地化 WordPress 插件和主题可以 ...

  3. php里ezpdo orm框架初探

    http://jackyrong.iteye.com/blog/238930 http://www.oschina.net/project/tag/126/orm?sort=view&lang ...

  4. 架构设计:系统间通信(34)——被神化的ESB(上)

    1.概述 从本篇文章开始,我们将花一到两篇的篇幅介绍ESB(企业服务总线)技术的基本概念,为读者们理清多个和ESB技术有关名词.我们还将在其中为读者阐述什么情况下应该使用ESB技术.接下来,为了加深读 ...

  5. 黄聪:《跟黄聪学WordPress插件开发》

    续<跟黄聪学WordPress主题开发>之后,又一个作品完成!<跟黄聪学Wordpress插件开发>,国内最好的Wordpress插件开发视频教程!! 目录预览: WordPr ...

  6. WordPress翻译中 __()、_e()、_x、_ex 和 _n 的用法及区别

    编译函数 WordPress使用了下面几个函数来方便语言本地化. __() _e() _x() _ex() _n() 以上所列的函数是用来包含所需翻译的字符串的,根据字符串的不同参数和输出类型,需要使 ...

  7. 黄聪:《跟黄聪学WordPress主题开发》

    又一个作品完成!<跟黄聪学Wordpress主题开发>,国内最好的Wordpress主题模版开发视频教程!! 目录预览: WordPress官方源文件层式结构讲解 WordPress数据库 ...

  8. 黄聪:让WordPress主题支持语言本地化(使用poedit软件实现中文翻译功能)

    如果你的WordPress主题要提交到WordPress官方主题库,使用者来自世界各地的多种语言,那么,你就要让你的WordPress主题支持语言本地化,方便使用者进行语言翻译和制作语言包. 让Wor ...

  9. 翻译学python---《Learn Python the hard Way》---第一章 绪论

    打算学习python,但是又不想单纯地看书或是写个小项目,干脆引入很流行的翻译学习法来学习吧-         在论坛上看到了国外的一本<Learn Python the hard Way> ...

随机推荐

  1. [ofbiz]解决load-demo花费过长时间的问题

    一直以来使用公司配置的hp-cq45笔记本,在初始化ofbiz的时候load-demo需要花费很长一段时间,比如90分钟,或者129分钟. 解决办法:安装官方驱动--intel快速存储驱动 ok,lo ...

  2. C++之------运算符重载

    ①  什么是运算符重载? 何为C++的运算符重载呢? 其实就是运算符给它重新赋予新的含义或者多重含义.让它有另外一种新的功能. 为什么需要运算符重载? 面向对象中为了实现类的多态性,我们就引用了运算符 ...

  3. Eclipse Clojure 开发插件

    参考:http://doc.ccw-ide.org/documentation.html#install-as-plugin 安装Eclipse Clojure插件 这里安装的插件是Countercl ...

  4. js 创建对象

    1.工厂模式 function createPerson(name, age, job) { var o = new Object(); o.name = name; o.age = age; o.j ...

  5. 【关于微软的上一代模板引擎 T4引擎】

    导语:国内有名的动软代码生成器用的就是T4引擎......可以自己下载下来用用,批量生成固定模式的代码文件,十分有用........... 示例代码:示例代码__你必须懂的T4模板:浅入深出.rar ...

  6. WPF制作的一个小功能,智能提示(IntelliSense)

    原文http://www.cnblogs.com/scheshan/archive/2012/06/30/2570867.html 最近WPF项目中遇到一个需求,需要给一个RichTextBox添加智 ...

  7. Google map v3 using simple tool file google.map.util.js v 1.0

    /** * GOOGLE地图开发使用工具 * @author BOONYACHENGDU@GMAIL.COM * @date 2013-08-23 * @notice 地图容器的(div)z-inde ...

  8. POJ 3997 Stock Chase

    Stock Chase Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 455   Accepted: 131 Descrip ...

  9. oracle数据库时间转换

    select * from TAB where 时间 BETWEEN to_date('2011-02-01 22:03:40','yyyy-mm-dd hh24:mi:ss') and to_dat ...

  10. PHP MySQL Insert Into 之 Insert

    向数据库表插入数据 INSERT INTO 语句用于向数据库表添加新记录. 语法 INSERT INTO table_name VALUES (value1, value2,....) 您还可以规定希 ...