<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.basic.other.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'book.luasandbox.php',
    1 => 'LuaSandbox',
    2 => 'LuaSandbox',
  ),
  'up' => 
  array (
    0 => 'refs.basic.other.php',
    1 => 'Sonstige Grunderweiterungen',
  ),
  'prev' => 
  array (
    0 => 'luaclosure.invoke.php',
    1 => 'LuaClosure::__invoke',
  ),
  'next' => 
  array (
    0 => 'luasandbox.setup.php',
    1 => 'Installation/Konfiguration',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/luasandbox/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.luasandbox.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.luasandbox" class="book">
 
 <h1 class="title">LuaSandbox</h1>
 

 <div id="intro.luasandbox" class="preface">
  <h1 class="title">Einführung</h1>
  <p class="simpara">
   LuaSandbox is an extension for PHP 7 and PHP 8 to allow safely
   running untrusted Lua 5.1 code from within PHP.
  </p>
  <p class="para">
   Differences compared to the <a href="book.lua.php" class="link">Lua</a> extension:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      LuaSandbox has support for time and memory limits.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      LuaSandbox provides a default-safe environment for running untrusted code.
      Stock Lua functions were reviewed for security, and several were patched
      accordingly.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      LuaSandbox has a PHP interface which is more complex, precise and powerful,
      but it is less convenient for developers.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      LuaSandbox supports only Lua 5.1. It is difficult to change this, because
      LuaSandbox uses heavily modified Lua standard libraries, and
      due to the lack of backwards compatibility between major Lua versions.
      LuaSandbox aims to maximise backwards compatibility with user-supplied
      scripts.
     </span>
    </li>
   </ul>
  </p>
 </div>

 




 




 





 

 




 




 




 




 




 




 




 




 





<ul class="chunklist chunklist_book"><li><a href="luasandbox.setup.php">Installation/Konfiguration</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="luasandbox.requirements.php">Anforderungen</a></li><li><a href="luasandbox.installation.php">Installation</a></li></ul></li><li><a href="reference.luasandbox.differences.php">Differences from Standard Lua</a></li><li><a href="luasandbox.examples.php">Beispiele</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="luasandbox.examples-basic.php">Basic usage for LuaSandbox</a></li></ul></li><li><a href="class.luasandbox.php">LuaSandbox</a> — The LuaSandbox class<ul class="chunklist chunklist_book chunklist_children"><li><a href="luasandbox.callfunction.php">LuaSandbox::callFunction</a> — Call a function in a Lua global variable</li><li><a href="luasandbox.disableprofiler.php">LuaSandbox::disableProfiler</a> — Disable the profiler</li><li><a href="luasandbox.enableprofiler.php">LuaSandbox::enableProfiler</a> — Enable the profiler.</li><li><a href="luasandbox.getcpuusage.php">LuaSandbox::getCPUUsage</a> — Fetch the current CPU time usage of the Lua environment</li><li><a href="luasandbox.getmemoryusage.php">LuaSandbox::getMemoryUsage</a> — Fetch the current memory usage of the Lua environment</li><li><a href="luasandbox.getpeakmemoryusage.php">LuaSandbox::getPeakMemoryUsage</a> — Fetch the peak memory usage of the Lua environment</li><li><a href="luasandbox.getprofilerfunctionreport.php">LuaSandbox::getProfilerFunctionReport</a> — Fetch profiler data</li><li><a href="luasandbox.getversioninfo.php">LuaSandbox::getVersionInfo</a> — Return the versions of LuaSandbox and Lua</li><li><a href="luasandbox.loadbinary.php">LuaSandbox::loadBinary</a> — Load a precompiled binary chunk into the Lua environment</li><li><a href="luasandbox.loadstring.php">LuaSandbox::loadString</a> — Load Lua code into the Lua environment</li><li><a href="luasandbox.pauseusagetimer.php">LuaSandbox::pauseUsageTimer</a> — Pause the CPU usage timer</li><li><a href="luasandbox.registerlibrary.php">LuaSandbox::registerLibrary</a> — Register a set of PHP functions as a Lua library</li><li><a href="luasandbox.setcpulimit.php">LuaSandbox::setCPULimit</a> — Set the CPU time limit for the Lua environment</li><li><a href="luasandbox.setmemorylimit.php">LuaSandbox::setMemoryLimit</a> — Set the memory limit for the Lua environment</li><li><a href="luasandbox.unpauseusagetimer.php">LuaSandbox::unpauseUsageTimer</a> — Unpause the timer paused by LuaSandbox::pauseUsageTimer</li><li><a href="luasandbox.wrapphpfunction.php">LuaSandbox::wrapPhpFunction</a> — Wrap a PHP callable in a LuaSandboxFunction</li></ul></li><li><a href="class.luasandboxfunction.php">LuaSandboxFunction</a> — The LuaSandboxFunction class<ul class="chunklist chunklist_book chunklist_children"><li><a href="luasandboxfunction.call.php">LuaSandboxFunction::call</a> — Call a Lua function</li><li><a href="luasandboxfunction.construct.php">LuaSandboxFunction::__construct</a> — Unused</li><li><a href="luasandboxfunction.dump.php">LuaSandboxFunction::dump</a> — Dump the function as a binary blob</li></ul></li><li><a href="class.luasandboxerror.php">LuaSandboxError</a> — The LuaSandboxError class</li><li><a href="class.luasandboxerrorerror.php">LuaSandboxErrorError</a> — The LuaSandboxErrorError class</li><li><a href="class.luasandboxfatalerror.php">LuaSandboxFatalError</a> — The LuaSandboxFatalError class</li><li><a href="class.luasandboxmemoryerror.php">LuaSandboxMemoryError</a> — The LuaSandboxMemoryError class</li><li><a href="class.luasandboxruntimeerror.php">LuaSandboxRuntimeError</a> — The LuaSandboxRuntimeError class</li><li><a href="class.luasandboxsyntaxerror.php">LuaSandboxSyntaxError</a> — The LuaSandboxSyntaxError class</li><li><a href="class.luasandboxtimeouterror.php">LuaSandboxTimeoutError</a> — The LuaSandboxTimeoutError class</li></ul></div><?php manual_footer($setup); ?>