smaller changes, typos & tests

This commit is contained in:
Steffen Vogel 2011-03-07 16:13:17 +01:00
parent a0d3f0d29a
commit f22838c84d
4 changed files with 44 additions and 4 deletions

View file

@ -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 {
}
}
?>
?>

View file

@ -154,5 +154,4 @@ class CSV extends View {
}
}
?>

View file

@ -35,10 +35,13 @@ use Volkszaehler\Util;
* @author Steffen Vogel <info@steffenvogel.de>
*/
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

38
misc/tests/debug.php Normal file
View file

@ -0,0 +1,38 @@
<?php
/**
* A test for our JSON utility class
*
* @package tests
* @copyright Copyright (c) 2010, The volkszaehler.org project
* @license http://www.gnu.org/licenses/gpl.txt GNU Public License
* @author Steffen Vogel <info@steffenvogel.de>
*/
/*
* 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 <http://www.gnu.org/licenses/>.
*/
define('VZ_DIR', realpath(__DIR__ . '/../..'));
use Volkszaehler\Util;
include VZ_DIR . '/lib/Util/Debug.php';
echo '<pre>';
echo print_r(Util\Debug::getLoadAvg(), TRUE);
echo Util\Debug::getUptime() . "\n";
echo Util\Debug::getCurrentCommit();
echo '</pre>';