aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--App.php12
-rw-r--r--Db.php2
2 files changed, 9 insertions, 5 deletions
diff --git a/App.php b/App.php
index 141e333..442ca8c 100644
--- a/App.php
+++ b/App.php
@@ -90,15 +90,19 @@ class App
static function ok($msg)
{
$ok = array('result' => 'ok', 'msg' => $msg);
- header("Content-type application/json");
- return json_encode($ok);
+ $json = json_encode($ok);
+ header("Content-Type: application/json");
+ header("Content-Length: " . strlen($json));
+ print $json;
}
static function error($msg)
{
$err = array('result' => 'error', 'msg' => $msg);
- header("Content-type application/json");
- return json_encode($err);
+ $json = json_encode($err);
+ header("Content-Type: application/json");
+ header("Content-Length: " . strlen($json));
+ print $json;
}
/**
diff --git a/Db.php b/Db.php
index 2b7b532..7d85d0d 100644
--- a/Db.php
+++ b/Db.php
@@ -1,7 +1,7 @@
<?php
/**
- * boeuf/Db.php
+ * main/Db.php
* @author Filipp Lepalaan <filipp@mekanisti.fi>
* http://www.php.net/manual/en/language.oop5.patterns.php
*/