Thinkphp (3.2.1), a problem occurs when writing source code. About the absolute address.

Source: Internet
Author: User
Thinkphp (3.2.1), a problem occurs when writing source code. About the absolute address. I typed the source code according to the official code. I just started typing. A problem is found.
First, I wrote thinkphp. php, which is the public portal file.
 // + Logs // ---------------------------------- // ThinkPHP public portal file // ------------------------------------ // record start time $ GLOBALS ['_ inintime'] = microtime (TRUE ); // the 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 '; // The URL mode defines const URL_COMMON = 0; // the normal mode const URL_PATHINFO = 1; // The PATHINFO mode const URL_REWRITE = 2; // The REWRITE mode const URL_COMPAT = 3; // compatibility mode // class file suffix const EXT = '. class. php '; // The System constant defines 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 ',''); // load the corresponding configuration file defined ('app _ debug') or define ('app _ debug', false) in the application status ); // debug MODE if (function_exists ('saeautoloader ') {// automatically identifies the SAE environment defined ('app _ mode') or define ('app _ mode ', 'sae '); defined ('Storage _ type') or define ('Storage _ type', 'sares');} else {defined ('app _ mode ') or define ('app _ mode', 'common'); // The default application MODE is defined ('Storage _ type') or define ('Storage _ type ', 'file'); // The default storage type is File} defined ('runtime _ path') or define ('runtime _ path', APP_PATH. 'runtime/'); // The system Runtime directory defined ('Lib _ path') or define ('Lib _ path', realpath (THINK_PATH. 'library '). '/'); // System core class library directory

This is the line. Defines the constant LIB_PATH. A problem occurs. I first output THINK_PATH (defined in line 35th) and output "D: \ wamp \ www \ bbbb \ ThinkPHP/". However, when the Library is added to the constant and the realpath function is used for parsing, it cannot be parsed normally. only the "/" at the end can be displayed "/".
Then I found the thinkphp framework without moving the source code, and then echo it in the public entry file. No problem.
However, when I directly copy all the public entry files to a new file, the error is the same as mine. Why?
It may be a bit messy, so don't mind.


Reply to discussion (solution)

Do not modify the core code of the framework.
When using the framework, do not change any files that are not allowed to be modified.

Do not modify the core code of the framework.
When using the framework, do not modify any files that are not allowed to be modified. Just understand his process. Think about his theory. I did not use it for work.

I also encountered this problem.

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.