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

Source: Internet
Author: User
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 Public Entry File//----------------------------------//Record start run time $globals[' _begintime '] = Microtime (TRUE);// Record memory initial use 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 constants define defined (' Think_path ') or define (' Think_path ', __dir__. ') /'), Echo think_path;defined (' App_path ') or define (' App_path ', dirname ($_server[' script_filename ']). ' /');d efined (' app_status ') or define (' app_status ', '); Apply state to load the corresponding configuration file defined (' App_debug ') or define (' App_debug ', false); Whether 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 ');//Application 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 runtime 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.


Reply to discussion (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

Not sure enough, don't modify the core code of the framework
When using frames, do not change any files outside of the files that allow you to modify them. Just to understand his process. Think about his theory. I did it alone and didn't use him for work.

I have this problem, too.

  • 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.