-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto.p
More file actions
45 lines (37 loc) · 1.21 KB
/
auto.p
File metadata and controls
45 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
###############################################################################
@USE
vendor/autoload.p
###############################################################################
@auto[]
# Use Als/Sql/MySqlComp if you use in your code old name convention style
# (last_insert_id) instead of new ones (lastInsertId).
$oSql[^Als/Sql/MySql::create[$SQL.connect-string;
$.bDebug(1)
$.sCacheDir[/../data/sql_cache]
$.dCacheInterval(1/24)
]]
#end @auto[]
###############################################################################
@postprocess[sBody]
^self.getSQLStat[$oSql]
#end @postprocess[]
###############################################################################
@getSQLStat[oSql][locals]
^if(def $oSql){
$oSqlLog[^Als/Sql/Log::create[$oSql]]
^oSqlLog.log[
$.iQueryTimeLimit(500)
$.iQueriesLimit(25)
$.iQueryRowsLimit(3000)
$.bExpandExceededQueriesToLog(1)
^if(def $form:mode && ^form:tables.mode.locate[field;debug]){
^rem{ *** for ?mode=debug collect all queries info and store it to separate file *** }
$.sFile[/../data/sql.txt]
$.bAll(1)
}{
^rem{ *** by default we log only pages with potential problems in sql queries *** }
$.sFile[/../data/sql.log]
}
]
}
#end @getSQLStat[]