PDA

View Full Version : debug informations



reza.palang
شنبه 12 اردیبهشت 1388, 09:16 صبح
ارزش این اطلاعات که در حالت develop نشون میده چی هست؟ و چه معنی دارن؟
منظورم اطلاعاتی هست که با خط کد زیر کنتر میشه

Configure::write('debug', 0);
فقط Query های SQL رو نشون میده؟

realman
شنبه 12 اردیبهشت 1388, 13:42 عصر
debug در cakephp کلن چهار سطح داره(یکی Production سه تا Development) و شما می تونین حالت پیشفرض اون رو در فایل app/config/core.php تغییر بدین.در فایل ذکر شده بخشی بدین شکل پیدا می کنین:

/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
* 3: As in 2, but also with full controller dump.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 1);
همونطور که می بینید شما برحسب نیازتون می تونید حالت مورد نظر برای نمایش اطلاعات debug رو تعیین کنید.

حالا اینا به چه دردی می خورن:
بررسی علل بروز خطا در برنامه
سطرهایی که تحت تاثیر این بخش از برنامه قرار گرفتن.
بررسی Query های تشکیل شده و ....(شما در cake معمولا مستقیم Query نویسی نمی کنید!)
و.....