shell stuff, preprocessor directive
This commit is contained in:
@@ -20,11 +20,13 @@ RENDER()
|
||||
<li><a href="uri.uce">URI</a></li>
|
||||
<li><a href="cookie.uce">Cookies</a></li>
|
||||
<li><a href="session.uce">Session</a></li>
|
||||
<li><a href="str_replace.uce">String replace</a></li>
|
||||
<li><a href="dtree.uce">DTree</a></li>
|
||||
<li><a href="json.uce">JSON</a></li>
|
||||
<li><a href="memcached.uce">Memcached</a></li>
|
||||
<li><a href="mysql.uce">MySQL Connector</a></li>
|
||||
<li><a href="fileio.uce">File I/O</a></li>
|
||||
<li><a href="shell.uce">Shell Stuff</a></li>
|
||||
<li><a href="file_append.uce">File Append</a></li>
|
||||
<li><a href="random.uce">RNG/Noise</a></li>
|
||||
<li><a href="task.uce">Task API</a></li>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
RENDER()
|
||||
{
|
||||
|
||||
<><html>
|
||||
<link rel="stylesheet" href='style.css?v=1'></link>
|
||||
<h1>
|
||||
<a href="index.uce">UCE Test</a>:
|
||||
Shell Stuff
|
||||
</h1>
|
||||
|
||||
<div>shell_exec()</div>
|
||||
|
||||
<pre><?
|
||||
|
||||
print(shell_exec("ls -l"));
|
||||
|
||||
?></pre>
|
||||
|
||||
<div>shell_escape()</div>
|
||||
|
||||
<pre><?
|
||||
|
||||
print(shell_exec("echo "+shell_escape("kasjdf 1ölkasj öflkjasdö\\lkfjsöa'ldkfj 23487692\"bla83746")));
|
||||
|
||||
?></pre>
|
||||
|
||||
<pre><?= var_dump(context->params) ?></pre>
|
||||
</html></>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
void str_replace_test(String s, String sr, String rp)
|
||||
{
|
||||
print("in '", s, "' replace all '", sr, "' with '", rp, "' => ");
|
||||
print(replace(s, sr, rp));
|
||||
}
|
||||
|
||||
RENDER()
|
||||
{
|
||||
|
||||
<><html>
|
||||
<link rel="stylesheet" href='style.css?v=1'></link>
|
||||
<h1>
|
||||
<a href="index.uce">UCE Test</a>:
|
||||
String Replace
|
||||
</h1>
|
||||
|
||||
<div>
|
||||
<? str_replace_test("abcdefgh", "c", "C"); ?>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<? str_replace_test("abcccdefgh", "c", "C"); ?>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<? str_replace_test("abcccdefgh", "ccc", "C"); ?>
|
||||
</div>
|
||||
|
||||
<pre><?= var_dump(context->params) ?></pre>
|
||||
</html></>
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user