如何在源碼中找出sql語句的位置呢

來源:互聯網
上載者:User
下面這個圖中箭頭指的地方肯定是一個數組,而這個數組肯定在之前是sql出來的,我想找出這個sql句,不知如何查呢源碼呢?主要是關鍵字怎麼輸呢


回複討論(解決方案)

尋找 $output 變數。

在引入這個模版檔案的php頁面尋找$output

我查了一下,沒有,引入的頁面是index.php

尋找 $output 變數。


整個源碼中有幾百處引用$output,看的我頭婚眼又花啊,媽牙!這可咋整,還有別的招嗎?

查navigation這個model的類

我還是帖出index.php引入頁的源碼吧

 

查navigation這個model的類


不好意思,這個類有是有,但裡面是空的

它裡面有這麼一句話:
/**
* 擷取導航
*/
Tpl::output('nav_list',($nav = F('nav'))? $nav :H('nav',true,'file'));

不知從這句中查哪裡呢

用 debug_backtrace 看一下

用 debug_backtrace 看一下

試了一下,列印出這麼一大坨,這怎麼判斷呢

[code=php]
Array ( [0] => Array ( [file] => D:\WWW\cms\templates\default\layout\cms_layout.php [line] => 3 [function] => require ) [1] => Array ( [file] => D:\WWW\core\framework\libraries\tpl.php [line] => 118 [args] => Array ( [0] => D:\WWW\cms\templates\default\layout\cms_layout.php ) [function] => include_once ) [2] => Array ( [file] => D:\WWW\cms\control\index.php [line] => 20 [function] => showpage [class] => Tpl [type] => :: [args] => Array ( [0] => index ) ) [3] => Array ( [file] => D:\WWW\core\framework\core\base.php [line] => 97 [function] => indexOp [class] => indexControl [object] => indexControl Object ( [publisher_name:protected] => [publisher_id:protected] => 0 [publisher_type:protected] => 0 [attachment_path:protected] => [publish_state:protected] => 2 ) [type] => -> [args] => Array ( ) ) [4] => Array ( [file] => D:\WWW\core\framework\core\base.php [line] => 52 [function] => control [class] => Base [type] => :: [args] => Array ( ) ) [5] => Array ( [file] => D:\WWW\cms\index.php [line] => 35 [function] => run [class] => Base [type] => :: [args] => Array ( ) ) )
[/code]

我突然想到了,它會不會是一個表單,因為這個是後台輸入的,只要一輸入就進入這個數組裡面,結果一查還真是,不過還有一點疑問,那就是這個數組索引在td中啊,雖然這個td在form表單中,但是就是這樣,他也不會在表單值中啊,因為表單我理解必須在input中才行,這個怎麼解釋呢

還有一點就是:這個 $output到底在哪裡定義的,它不可能憑空就有的,肯定是在哪裡定義的
我搜了下源碼,到是有不少$output,但是都不象定義的初始模樣,很多一看就是引用的。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.