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.