Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /var/www/czpenviwiki/public_html/w/vendor/composer/semver/src/VersionParser.php on line 117
Modul:No globals – Enviwiki

Modul:No globals

Verze z 19. 5. 2016, 14:35, kterou vytvořil Admin (diskuse | příspěvky) (naimportována 1 revize)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)

Věci přenesené přes šablony z cs:wiki


local mt = getmetatable(_G) or {}
function mt.__index (t, k)
	if k ~= 'arg' then
		error('Tried to read nil global ' .. tostring(k), 2)
	end
	return nil
end
function mt.__newindex(t, k, v)
	if k ~= 'arg' then
		error('Tried to write global ' .. tostring(k), 2)
	end
	rawset(t, k, v)
end
setmetatable(_G, mt)