File "cDebug.php"

Full path: /www/arduino_gps/1/class/cDebug.php
File size: 1.94 KiB (1982 bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Back

<?php
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//	デバック関連
//	クラス名:	cDebug
//	備考	:	
//	更新	:	2012/10/19 KMK-Teraoka
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
class cDebug
{
	private static $mode;
	
	//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	//	呼び出し元のMODEを継承する
	//	関数名	:	setMode
	//	引数	:	$mode			呼び出し元のMODE
	//	戻り値	:	なし
	//	備考	:	
	//	更新	:	2012/10/18 KMK-Teraoka
	//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	public static function setMode($mode_)
	{
		self::$mode = $mode_;
	}
	
	//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	//	デバック出力 -変数-
	//	関数名	:	dPrint
	//	引数	:	*				可変長引数
	//	戻り値	:	なし
	//	備考	:	
	//	更新	:	2012/10/18 KMK-Teraoka
	//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	public static function dPrint()
	{
		if (self::$mode == 1)
		{
			print "<font color=\"#989898\">";
			$argNum = func_num_args();
			$argList = func_get_args();
			for($iCount = 0; $iCount < $argNum; $iCount++)
			{
				if ($iCount > 0)
				{
					print ", ";
				}
				print $argList[$iCount];
			}
			print "</font>";
			print "<br />";
		}
	}
	
	//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	//	デバック出力 -配列-
	//	関数名	:	dPrint_r
	//	引数	:	*				可変長引数
	//	戻り値	:	なし
	//	備考	:	
	//	更新	:	2012/10/18 KMK-Teraoka
	//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	public static function dPrint_r()
	{
		if (self::$mode == 1)
		{
			print "<font color=\"#989898\">";
			$argNum = func_num_args();
			$argList = func_get_args();
			for($iCount = 0; $iCount < $argNum; $iCount++)
			{
				if ($iCount > 0)
				{
					print "<br />";
				}
				print "<pre style=\"display:inline\">";
				print "[". ($iCount + 1). "]=>";
				print_r($argList[$iCount]);
				print "</pre>";
			}
			print "</font>";
			print "<br />";
		}
	}
}
?>

PHP File Manager