Help:Extension/ScriptFunctions
From Metabolomics.JP
(Difference between revisions)
Line 19: | Line 19: | ||
<table border="1" cellpadding="3" cellspacing="1"> | <table border="1" cellpadding="3" cellspacing="1"> | ||
<tr><td>version</td><td>source</td><td>md5</td></tr> | <tr><td>version</td><td>source</td><td>md5</td></tr> | ||
− | <tr><td>0.1( | + | <tr><td>0.1(October 7,2008)</td><td>{{#ifexistfile:/data/src/ScriptFunctions/ScriptFunctions.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">394b55519d7449f06cbf34b4ed845570</pre></td></tr> |
</table> | </table> | ||
Line 25: | Line 25: | ||
<table border="1" cellpadding="3" cellspacing="1"> | <table border="1" cellpadding="3" cellspacing="1"> | ||
<tr><td>version</td><td>source</td><td>md5</td></tr> | <tr><td>version</td><td>source</td><td>md5</td></tr> | ||
− | <tr><td>0.1(September | + | <tr><td>0.1(September 30,2008)</td><td>{{#ifexistfile:/data/src/ScriptFunctions/script_monitoring.sh}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">eedd37d4618802a48fd5b26d8dbfedfb</pre></td></tr> |
</table> | </table> | ||
Line 33: | Line 33: | ||
<li>Place it in the extensions/ directory.</li> | <li>Place it in the extensions/ directory.</li> | ||
<li>Insert the follow lines to LocalSettings.php | <li>Insert the follow lines to LocalSettings.php | ||
− | <pre>require_once( "$IP/extensions/ | + | <pre>require_once( "$IP/extensions/ScriptFunctions.php" ); |
$egLuaPath = "path to directory which in lua binary"; | $egLuaPath = "path to directory which in lua binary"; | ||
$egTmpPath = "path to tmp directory"; ( default: "/tmp" )</pre> | $egTmpPath = "path to tmp directory"; ( default: "/tmp" )</pre> |
Revision as of 11:09, 14 October 2008
Extension Information | |
Implementation | |
Description | |
Author(s) | K, Suwa |
Version | 0.1 |
MediaWiki | 1.11.1 |
License | |
Hooks used | |
Token type | |
Contents |
Extension to use an external scripting language, Lua.
Since an infinite loop can be achieved by Lua, script_monitoring.sh run by crond will kill all Lua processes running longer than 10 seconds.
For security, Lua's io, debug, package, os library are nullified. Also, the program halts when it finds 'dofile'.
Requirements
Download
version | source | md5 |
0.1(October 7,2008) | ScriptFunctions.phps | 394b55519d7449f06cbf34b4ed845570 |
version | source | md5 |
0.1(September 30,2008) | script_monitoring.sh | eedd37d4618802a48fd5b26d8dbfedfb |
Installtion
- Download the source code and rename it to ScriptFunctions.php and script_monitoring.sh.
- Place it in the extensions/ directory.
- Insert the follow lines to LocalSettings.php
require_once( "$IP/extensions/ScriptFunctions.php" ); $egLuaPath = "path to directory which in lua binary"; $egTmpPath = "path to tmp directory"; ( default: "/tmp" )
$egLuaPath is required.
$egTmpPath is a temporary place to save Lua programs.
- Put in any direcotry.( ideal: /etc/cron.d/ )
- Insert follow line to /etc/crontab
* * * * * root /etc/cron.d/script_monitoring.sh