local p = {} local php function p.setupInterface( options ) -- Copy the PHP callbacks to a local variable, and remove the global p.setupInterface = nil php = mw_interface mw_interface = nil -- Register this library in the "mw" global as mw.zeroportal.* mw = mw or {} mw.zeroportal = p -- Indicate that we're loaded package.loaded['mw.zeroportal'] = p end -- Each of the following functions should be documented in the corresponding LuaLibrary.php function function p.getAllowedAccountIds() return php.getAllowedAccountIds() end function p.getUsername() return php.getUsername() end function p.getRawParameter( name, default ) return php.getRawParameter( name, default ) end function p.isAllowedToSee( xcs ) return php.isAllowedToSee( xcs ) end function p.isSiteAdmin() return php.isSiteAdmin() end function p.jsonDecode( value ) return php.jsonDecode( value ) end function p.jsonEncode( value, escapeHtml ) return php.jsonEncode( value, escapeHtml ) end function p.setRawResult( result ) return php.setRawResult( result ) end function p.getEditData() return php.getEditData() end function p.setEditData( data ) return php.setEditData( data ) end function p.wasPosted() return php.wasPosted() end return p