From f22838c84d19b23ee1da192d93c6bfd0bfef025c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 7 Mar 2011 16:13:17 +0100 Subject: [PATCH] smaller changes, typos & tests --- lib/Util/JSON.php | 4 ++-- lib/View/CSV.php | 1 - lib/View/View.php | 5 ++++- misc/tests/debug.php | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 misc/tests/debug.php diff --git a/lib/Util/JSON.php b/lib/Util/JSON.php index 58bc6e0..429233f 100644 --- a/lib/Util/JSON.php +++ b/lib/Util/JSON.php @@ -41,7 +41,7 @@ class JSON extends \ArrayObject { * @param string $json * @return Util\JSON */ - static public function decode($json, $assoc = false, $depth = 512) { + static public function decode($json, $assoc = FALSE, $depth = 512) { $data = json_decode(self::strip($json), $assoc, $depth); if (is_null($data)) { @@ -173,4 +173,4 @@ class JSONException extends \Exception { } } -?> \ No newline at end of file +?> diff --git a/lib/View/CSV.php b/lib/View/CSV.php index db97b34..47cd865 100644 --- a/lib/View/CSV.php +++ b/lib/View/CSV.php @@ -154,5 +154,4 @@ class CSV extends View { } } - ?> diff --git a/lib/View/View.php b/lib/View/View.php index 9bbb599..e5e6585 100644 --- a/lib/View/View.php +++ b/lib/View/View.php @@ -35,10 +35,13 @@ use Volkszaehler\Util; * @author Steffen Vogel */ abstract class View { + /** + * Round all values to save bandwidth + * * @var integer round all values to x decimals */ - const PRECISSION = 5; + const PRECISSION = 3; /** * @var HTTP\Request diff --git a/misc/tests/debug.php b/misc/tests/debug.php new file mode 100644 index 0000000..3fc7416 --- /dev/null +++ b/misc/tests/debug.php @@ -0,0 +1,38 @@ + + */ +/* + * This file is part of volkzaehler.org + * + * volkzaehler.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * volkzaehler.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with volkszaehler.org. If not, see . + */ + +define('VZ_DIR', realpath(__DIR__ . '/../..')); + +use Volkszaehler\Util; +include VZ_DIR . '/lib/Util/Debug.php'; +echo '
';
+
+echo print_r(Util\Debug::getLoadAvg(), TRUE);
+echo Util\Debug::getUptime() . "\n";
+echo Util\Debug::getCurrentCommit();
+
+echo '
'; +