-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcargo.lua
More file actions
40 lines (30 loc) · 858 Bytes
/
cargo.lua
File metadata and controls
40 lines (30 loc) · 858 Bytes
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
local cargo = {}
local php
function cargo.setupInterface( options )
-- Remove setup function
cargo.setupInterface = nil
-- Copy the PHP callbacks to a local variable, and remove the global
php = mw_interface
mw_interface = nil
-- Do any other setup here
-- Install into the mw global
mw = mw or {}
mw.ext = mw.ext or {}
mw.ext.cargo = cargo
-- Indicate that we're loaded
package.loaded['mw.ext.cargo'] = cargo
end
function cargo.query(tables, fields, args)
return php.query(tables, fields, args)
end
function cargo.formatTable(table, args)
local result = php.format(table or {}, args or {})
return result[0], result.noparse, result.isHtml
end
function cargo.store(table, args)
return php.store(table, args)
end
function cargo.declare(parser)
return php.declare(parser)
end
return cargo