尊龙凯时人生就是博

thinkphpÔõÑù¹Ø±Õtraceµ÷ÊÔģʽ

ΪʲôҪ¹Ø±Õ trace ģʽ£¿

Trace ģʽÊÇ ThinkPHP ×Ô´øµÄµ÷ÊÔģʽ £¬¿ÉÒÔÔÚÒ³Ãæµ×²¿Àû±ãµØÉó²éÄ¿½ñÇëÇóµÄÏà¹ØÐÅÏ¢ £¬ÈçÇëÇó²ÎÊý¡¢SQL Óï¾äµÈ £¬¶ÔÎÊÌⶨλºÜÊÇÓÐ×ÊÖú¡£However, in a production environment, we do not want these sensitive information to be leaked and thereby affect the system’s security.¡£±ðµÄ £¬µ÷ÊÔģʽ»¹»á´øÀ´Ò»¶¨µÄÐÔÄÜÏûºÄ £¬Òò´ËÎÒÃÇÓÐÐëÒª½«Æä¹Ø±Õ¡£

ÔõÑù¹Ø±Õ trace ģʽ£¿

ThinkPHP ĬÈÏÊÇ¿ªÆô trace ģʽµÄ £¬ÎÒÃÇ¿ÉÒÔͨ¹ýÉèÖà app_debug ²ÎÊýÀ´¹Ø±Õ trace ģʽ¡£

ÔÚ config Ŀ¼Ï嵀 app.php ÎļþÖÐ £¬ÎÒÃÇ¿ÉÒÔÕÒµ½ÒÔÏÂÉèÖãº

// ÊÇ·ñ¿ªÆôÓ¦Óõ÷ÊÔģʽ
'app_debug' => env('app_debug', true),

µÇ¼ºó¸´ÖÆ

½« app_debug µÄÖµÉèÖÃΪ false ¼´¿É¹Ø±Õ trace ģʽ £¬´úÂëÈçÏÂËùʾ£º

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

// ÊÇ·ñ¿ªÆôÓ¦Óõ÷ÊÔģʽ
'app_debug' => false,

µÇ¼ºó¸´ÖÆ

³ýÁËͨ¹ýÐÞ¸ÄÉèÖÃÎļþÀ´¹Ø±Õ trace ģʽ֮Íâ £¬ÎÒÃÇ»¹¿ÉÒÔÔÚÓ¦ÓóÌÐòµÄ¿ØÖÆÆ÷£¨Í¨³£ÊÇ»ù´¡¿ØÖÆÆ÷£©ÖÐÌí¼ÓÒÔÏÂÒªÁ죺

/**
 * ½á¹¹º¯Êý
 *
 * ¹Ø±Õµ÷ÊÔģʽ
 */
public function __construct()
{
    parent::__construct();

    // ¿ª·¢ÇéÐÎÏÂ£¬²»¹Ø±Õµ÷ÊÔ
    if (config('app_debug')) {
        return;
    }

    // ¹Ø±Õµ÷ÊÔ
    config('app_trace', false);
    config('app_debug', false);
}

µÇ¼ºó¸´ÖÆ

Õâ¸öÒªÌå»áÔÚ¿ØÖÆÆ÷³õʼ»¯Ê±±»Å²Óà £¬ÈôÊÇ app_debug ÉèÖÃΪ false £¬Ôò»á¹Ø±Õ trace ģʽ¡£

ÒÔÉϾÍÊÇthinkphpÔõÑù¹Ø±Õtraceµ÷ÊÔģʽµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

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

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

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