output buffers

This commit is contained in:
udo
2021-12-09 03:01:10 +00:00
parent 8195154e4c
commit af29d51536
19 changed files with 169 additions and 62 deletions
+2 -2
View File
@@ -14,13 +14,13 @@ RENDER()
set_cookie("test-cookie-1", "test-value-1", time() + 30*60);
set_cookie("test-cookie-2", "test-value-2", time() + 30*60*24);
echo(var_dump(context->set_cookies));
print(var_dump(context->set_cookies));
?></pre>
Get
<pre><?
echo(var_dump(context->cookies));
print(var_dump(context->cookies));
?></pre>
Params
+5 -5
View File
@@ -16,16 +16,16 @@ RENDER()
<pre><?
t.set("String test");
echo(String("String test: ") + t.to_string()+"\n");
print(String("String test: ") + t.to_string()+"\n");
t.set(true);
echo(String("bool test: ") + t.to_string()+"\n");
print(String("bool test: ") + t.to_string()+"\n");
t.set(1234.5678);
echo(String("float test: ") + t.to_string()+"\n");
print(String("float test: ") + t.to_string()+"\n");
t.set(&t);
echo(String("pointer test: ") + t.to_string()+"\n");
print(String("pointer test: ") + t.to_string()+"\n");
?></pre>
@@ -43,7 +43,7 @@ RENDER()
t["g"]["x"]["y2"] = &t;
t["g"]["x"]["y3"] = time();
t["g"]["x"]["y4"] = "Ünicödä";
echo(var_dump(t));
print(var_dump(t));
?></pre>
+1 -1
View File
@@ -1,4 +1,4 @@
void test_output()
{
echo("hello from include!");
print("hello from include!");
}
+2 -2
View File
@@ -26,8 +26,8 @@ RENDER()
<li><a href="fileio.uce">File I/O</a></li>
</ul>
<pre><?
echo("Worker PID: "+std::to_string(my_pid)+"\n");
echo("Parent PID: "+std::to_string(parent_pid)+" \n");
print("Worker PID: ", my_pid, "\n");
print("Parent PID: ", parent_pid, " \n");
?></pre>
<pre><?= (var_dump(p)) ?></pre>
</>
+3 -3
View File
@@ -29,14 +29,14 @@ RENDER()
t["l"] = context->params;
String j;
echo(j = json_encode(t));
print(j = json_encode(t));
?></pre>
Parsed:
<pre><?
echo(var_dump(
print(var_dump(
json_decode(j)
));
?></pre>
@@ -44,7 +44,7 @@ RENDER()
Compare:
<pre><?
echo(var_dump(
print(var_dump(
t
));
?></pre>
+4 -4
View File
@@ -17,7 +17,7 @@ RENDER()
auto sfd = memcache_connect();
echo(memcache_command(sfd, "stats"));
print(memcache_command(sfd, "stats"));
?></pre>
@@ -27,9 +27,9 @@ RENDER()
memcache_set(sfd, "test_key", "test_value");
memcache_set(sfd, "test_key2", "test_value2");
echo("raw:: "+memcache_command(sfd, "get test_key")+"\n");
echo("get:: "+memcache_get(sfd, "test_key")+"\n");
echo("multiple::\n"+var_dump(memcache_get_multiple(sfd, {"test_key", "test_key2"}))+"\n");
print("raw:: "+memcache_command(sfd, "get test_key")+"\n");
print("get:: "+memcache_get(sfd, "test_key")+"\n");
print("multiple::\n"+var_dump(memcache_get_multiple(sfd, {"test_key", "test_key2"}))+"\n");
?></pre>
+6 -6
View File
@@ -21,11 +21,11 @@ RENDER()
MySQL con;
if(con.connect("localhost", "root", ""))
{
echo("connection established\n");
echo("error: "+con.error()+"\n");
echo("quotation test: "+con.escape("\"' or 1=1;.")+"\n");
echo("query parse: "+con.parse_query_parameters(query, params)+"\n");
echo(var_dump(con.query("SHOW DATABASES")));
print("connection established\n");
print("error: "+con.error()+"\n");
print("quotation test: "+con.escape("\"' or 1=1;.")+"\n");
print("query parse: "+con.parse_query_parameters(query, params)+"\n");
print(var_dump(con.query("SHOW DATABASES")));
con.query("USE mysql");
?></pre>
@@ -34,7 +34,7 @@ RENDER()
<pre><?
echo(var_dump(con.query("SELECT * FROM user")));
print(var_dump(con.query("SELECT * FROM user")));
}
+6 -6
View File
@@ -18,17 +18,17 @@ RENDER()
if(action == "start")
{
session_start();
echo("action: starting session");
print("action: starting session");
}
else if(action == "store")
{
context->session["stored-value"] = make_session_id();
echo("action: storing value "+context->session["stored-value"]);
print("action: storing value "+context->session["stored-value"]);
}
else if(action == "destroy")
{
session_destroy();
echo("action: destroying session");
print("action: destroying session");
}
<>
@@ -40,9 +40,9 @@ RENDER()
Info
<pre><?
echo(var_dump(context->cookies));
echo("SESSION:\n");
echo(var_dump(context->session));
print(var_dump(context->cookies));
print("SESSION:\n");
print(var_dump(context->session));
?></pre>
Params
+27
View File
@@ -0,0 +1,27 @@
RENDER()
{
DTree t;
<>
<link rel="stylesheet" href='style.css'></link>
<h1>
<a href="index.uce">UCE Test</a>:
Strings
</h1>
<pre style="white-space: pre-wrap"><?
print(String("!") + 60*60*24);
?></pre>
Params
<pre><?= var_dump(context->params) ?></pre>
</>
}
+1 -1
View File
@@ -10,7 +10,7 @@ RENDER()
Working Directory
</h1>
<pre><?
echo("Base WD: " + get_cwd() + "\n");
print("Base WD: " + get_cwd() + "\n");
context->invoke("test2/working-dir-test.uce");
?></pre>
<pre><?= var_dump(context->params) ?></pre>