×ðÁú¿­Ê±

thinkphp5ÔõÑù¹Ø±ÕinfoÐÅÏ¢Êä³ö

Ò»¡¢info µÄ×÷ÓÃ

ÔÚ×îÏÈ¹Ø±Õ info ֮ǰ £¬ÎÒÃÇÐèÒªÏàʶһÏÂËüµÄ×÷Óá£ÔÚ ThinkPHP5 ¿ò¼ÜÖÐ £¬info ÐÅÏ¢Êä³öÖ÷ÒªÓÐÈýÖÖÐÎʽ£º

չʾĿ½ñ»á¼ûµÄ URL ºÍÇëÇó²ÎÊý

ÔÚÒ³Ãæµ×²¿Õ¹Ê¾Ä¿½ñÒ³ÃæµÄ SQL Óï¾äÖ´ÐÐÇéÐκÍÔËÐÐʱ¼äµÈµ÷ÊÔÐÅÏ¢

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»

ÔÚÖ´Ðйýʧʱ £¬Êä³öÏêϸµÄ¹ýʧÐÅÏ¢ £¬Àû±ãµ÷ÊÔ

Ö»¹Ü¿´ÆðÀ´ºÜÓÐ×ÊÖú £¬µ«¹ØÓÚÕæÕýµÄ¿ª·¢ÕßÀ´Ëµ £¬´ó²¿·Ö info ÐÅÏ¢²¢²»ÊǺÜÊÇÊÊÓõÄ¡£Í¨³£ £¬ÎÒÃÇÐèÒªµÄÊÇһЩ¸ü¾«Á·µÄÊä³ö £¬ÒÔ±ã¸üºÃµØרעÓÚ¿ª·¢¡£

¶þ¡¢¹Ø±Õ info

¹Ø±Õ info ºÜ¼òÆÓ £¬Ö»ÐèÒªÔÚÉèÖÃÎļþÖÐµÄ app.php ÖÐ £¬½« app_debug ÉèÖÃÏîÉèÖÃΪ false ¼´¿É¹Ø±Õ info ÐÅÏ¢Êä³ö¡£Ê¾Àý´úÂëÈçÏ£º

return [
    'app_debug' => false
];

µÇ¼ºó¸´ÖÆ

ÕâÑùÉèÖÃÖ®ºó £¬Ä¬ÈÏÇéÐÎÏ £¬Ò³Ã潫²»ÔÙչʾĿ½ñµÄ URL ºÍÇëÇó²ÎÊý £¬Ò²²»»áÊä³ö SQL Óï¾äÖ´ÐÐÇéÐκ͹ýʧÐÅÏ¢¡£ËäÈ» £¬ÈôÊÇÄúÐèÒª £¬Äú¿ÉÒÔÔÚ¿ò¼ÜµÄµ÷ÊÔģʽÏÂÖØпªÆô info¡£

ÁíÍâ £¬ÈôÊÇÄúÐèÒªÔÚ¿ª·¢Àú³ÌÖÐÊä³ö SQL Ö´ÐÐÇéÐÎÒÔ±ãµ÷ÊÔ £¬¿ÉÒÔͨ¹ýÈçÏ·½·¨¿ªÆô SQL ÈÕÖ¾£º

Db::listen(function($sql, $time, $explain){
    // ¼Í¼SQL
    trace($sql . ' [' . $time . 's]', 'sql');
    // Éó²éÐÔÄÜÆÊÎöЧ¹û
    trace($explain, 'explain');
});

µÇ¼ºó¸´ÖÆ

ÕâÑù £¬¾Í¿ÉÒÔÔÚ³ÌÐòµÄ trace Îļþ¼ÐÖÐÊä³ö SQL ÈÕÖ¾ÐÅÏ¢ÁË¡£

ÒÔÉϾÍÊÇthinkphp5ÔõÑù¹Ø±ÕinfoÐÅÏ¢Êä³öµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±ÊµÊ±ÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿