thinkphp (3.2.1), write the source code a little bit about the problem. About absolute addresses.

Source: Internet
Author: User
Tags constant definition
thinkphp (3.2.1), write the source code a little bit of a problem. About the absolute address.
In accordance with the official source code, I knocked over the control. Just started knocking. I found a little problem.
First I wrote that thinkphp.php is the public entrance file.
 // +----------------------------------------------------------------------
// | thinkphp [WE CAN do it JUST THINK it]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2013 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed (http://www.apache.org/licenses/LICENSE-2.0)
// +----------------------------------------------------------------------
// | author:liu21st <[email protected]>
// +----------------------------------------------------------------------

//----------------------------------
thinkphp Public Entrance file
//----------------------------------

Record Start run time
$GLOBALS [' _begintime '] = Microtime (TRUE);
Recording Initial memory usage
Define (' memory_limit_on ', function_exists (' memory_get_usage '));
if (memory_limit_on) $GLOBALS [' _startusemems '] = Memory_get_usage ();

Version information
Const Think_version = ' 3.2.1 ';

URL Pattern Definition
Const Url_common = 0; Normal mode
Const URL_PATHINFO = 1; PathInfo mode
Const URL_REWRITE = 2; Rewrite mode
Const URL_COMPAT = 3; Compatibility mode

class file suffix
Const EXT = '. class.php ';

System constant Definition
Defined (' Think_path ') or define (' Think_path ', __dir__. ') /');
Echo Think_path;
Defined (' App_path ') or define (' App_path ', dirname ($_server[' script_filename ']). ' /');
Defined (' App_status ') or define (' app_status ', '); Apply state to load the corresponding configuration file
Defined (' App_debug ') or define (' App_debug ', false); Whether to debug mode

if (function_exists (' Saeautoloader ')) {//auto-Identify SAE environment
Defined (' App_mode ') or define (' App_mode ', ' SAE ');
Defined (' Storage_type ') or define (' Storage_type ', ' Sae ');
}else{
Defined (' App_mode ') or define (' App_mode ', ' common '); App mode defaults to normal mode
Defined (' Storage_type ') or define (' Storage_type ', ' File '); The storage type defaults to file
}

Defined (' Runtime_path ') or define (' Runtime_path ', App_path. ' runtime/'); System run-time directory
Defined (' Lib_path ') or define (' Lib_path ', Realpath (think_path. ' Library '). ' /'); System Core Class Library Directory

That's the line. Defines a constant lib_path. There was a problem. I first output think_path (35th line definition), output "d:\wamp\www\bbbb\thinkphp/" but when the constants are appended to the library, and then the Realpath function parsing, it will not be parsed, only the most back of the "/"。
Then I found the framework of the thinkphp, the source code, and then the public entrance file echo a bit, no problem.
However, when I directly copy this public access file to a new file, I get the same error. May I ask why this is?
There may be some confusion, I hope you don't mind.
------Solution--------------------
Not sure enough, don't modify the core code of the framework
When using frames, do not change any files outside of the file that allows you to modify
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.