1 개요[ | ]
- 미디어위키 Scribunto 설치
- 미디어위키 확장기능 Scribunto 설치
- 여기서는 Lua를 설치하는 방법으로 할 것이다.[2]
2 요구조건 확인[ | ]
2.1 미디어위키 1.20 이상[ | ]

- 자신의 미디어위키 웹사이트에서 Special:Version 가기
- 미디어위키 버전이 1.20 이상인 확인
2.2 PCRE 8.10 이상[ | ]

Console
Copy
[root@zetawiki ~]# php -i | grep PCRE
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.32 2012-11-30
- → PCRE의 버전이 8.32이므로 OK
2.3 Lua 버전 5.1 이상[ | ]

Console
Copy
[root@zetawiki ~]# lua -v
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
- → Lua 버전이 5.1.4이므로 OK
2.4 Lua 퍼미션 확인[ | ]
Console
Copy
[root@zetawiki ~]# which lua
/usr/bin/lua
[root@zetawiki ~]# ll /usr/bin/lua
-rwxr-xr-x 1 root root 12552 Oct 7 2010 /usr/bin/lua
- → 모든 리눅스계정에 대해 실행가능. OK
3 Scribunto 설치[ | ]
- 미디어위키 extensions 폴더로 이동하여 git으로 설치
Console
Copy
[root@zetawiki ~]# cd /var/www/html/w/extensions/
[root@zetawiki extensions]# git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
Initialized empty Git repository in /var/www/html/w/extensions/Scribunto/.git/
remote: Counting objects: 1468, done
remote: Finding sources: 100% (251/251)
remote: Getting sizes: 100% (44/44)
remote: Compressing objects: 100% (99219/99219)
remote: Total 5233 (delta 134), reused 5200 (delta 127)
Receiving objects: 100% (5233/5233), 2.83 MiB | 889 KiB/s, done.
Resolving deltas: 100% (2885/2885), done.
4 미디어위키 설정 변경[ | ]
- LocalSettings.php 하단에 아래 내용 추가
PHP
Copy
require_once "$IP/extensions/Scribunto/Scribunto.php";
$wgScribuntoDefaultEngine = 'luastandalone';
5 확인[ | ]
- 자신의 미디어위키 웹사이트에서 Special:Version 가기
- "설치된 확장 기능" 목록 중 Scribunto 있는지 확인
6 테스트[ | ]
- 모듈:Bananas를 아래 내용으로 생성
lua
Copy
-- 헬로 월드!
local p = {}
function p.hello()
return "Hello, world!"
end
return p
- 아무 문서에서 아래 내용 기입하고 미리보기
text
Copy
{{#invoke:bananas|hello}}
- → Bananas 모듈의 hello 함수를 호출
- 그러면 결과가 다음과 같이 나와야 한다.
text
Copy
Hello, world!
7 주석[ | ]
8 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- 미디어위키 확장기능 (12)
미디어위키 AbuseFilter 설치 ― 김가놈미디어위키 AbuseFilter 설치 ― Jmnote미디어위키 GoogleLogin 확장기능 설치 ― …미디어위키 GoogleLogin 확장기능 설치 ― Jmnote미디어위키 GoogleLogin 확장기능 설치 ― …미디어위키 GoogleLogin 확장기능 설치 ― Jmnote미디어위키 MobileFrontend 설치 (모바일웹) ― …미디어위키 MobileFrontend 설치 (모바일웹) ― Jmnote미디어위키 MobileFrontend 설치 (모바일웹) ― Asg88미디어위키 MobileFrontend 설치 (모바일웹) ― Jmnote미디어위키 MobileFrontend 설치 (모바일웹) ― Asg88미디어위키 MobileFrontend 설치 (모바일웹) ― Jmnote