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. Tomcat学习笔记 - 错误日志 - NetBeans配置tomcat出错情况总结 -- 尚未授予访问 Tomcat 服务器的权限。请在服务器管理器的 Tomcat 定制器中设置 "manager-script" 角色的正确用户名和口令。 有关详细信息, 请查看服务器日志。

    错误描述: 发布时控制台出现: 部署错误: 尚未授予访问 Tomcat 服务器的权限.请在服务器管理器的 Tomcat 定制器中设置 "manager-script" 角色的正确用 ...

  2. https://github.com/aptana/studio3/releases aptana

    https://github.com/aptana/studio3/releases  aptana

  3. CentOS 6.4 LNMP 环境编译安装

    1.关闭 SELinux 编辑 /etc/selinux/config SELINUX="disabled" 2.安装编译器 yum install gcc gcc-c++ -y ...

  4. 清空DNS缓存

    昨天写了个Python的脚本,功能就是爬取一个网页上的Google ip地址再写入到本机的hosts里面去. 但是写完并且运行完成之后发现上不了Google.于是想到了是不是要清空一下DNS的缓存.不 ...

  5. 【Xamarin挖墙脚系列:打造独特的Xamarin.IOS开发环境】

    苹果的产品,依赖特定的开发环境. Mac  +  Xcode  不可缺少.所以,必须有Mac系统. 1-虚拟机搭建 2-土豪有Mac电脑设备 但是我觉得还是顺带上Visual Studio才是完美.. ...

  6. 转:使用C#的HttpWebRequest模拟登陆网站

    这篇文章是有关模拟登录网站方面的. 实现步骤: 启用一个web会话 发送模拟数据请求(POST或者GET) 获取会话的CooKie 并根据该CooKie继续访问登录后的页面,获取后续访问的页面数据. ...

  7. 剑指offer-面试题10:二进制中1的个数

    题目:请实现一个函数,输入一个函数,输出该数二进制表示中1的个数.例如把9 表示成二进制是1001,有2位是1.因此如果输入9,该函数输出2. 这道题最典型的方法就是用移位统计,就比如统计9的二进制1 ...

  8. 【转】C++实现RTMP协议发送H.264编码及AAC编码的音视频

    RTMP(Real Time Messaging Protocol)是专门用来传输音视频数据的流媒体协议,最初由Macromedia 公司创建,后来归Adobe公司所有,是一种私有协议,主要用来联系F ...

  9. Android学习总结——文件储存

    Android中文件存储的操作: 1.Activity的openFileOutput()方法可以把数据输出到文件中2.创建的文件保存在/data/data/<package name>/f ...

  10. 布局文件提示错误“No orientation specified, and the default is horizontal. This is a common so...”

    完整的错误提示信息为:No orientation specified, and the default is horizontal. This is a common source of bugs ...