src/php/lib/class.Linfo.php
/*
	 * getInfo()
	 *
	 * Output data in a variety of methods depending on situation
	 */
getInfo()
Output data in a variety of methods depending on situation
getInfo () Output data in a variety of methods depending on situation
public function output() {
		$output = new LinfoOutput($this);
		if (defined('LINFO_CLI') && extension_loaded('ncurses') && isset($_SERVER['argv']) && !in_array('--nocurses', $_SERVER['argv'])) {
			$output->ncursesOut();
			return;
		}
		switch (array_key_exists('out', $_GET) ? $_GET['out'] : 'html') {
			case 'html':
			default:
				$output->htmlOut();
			break;
			case 'json':
			case 'jsonp': 
				$output->jsonOut();
			break;
			case 'php_array':
				$output->serializedOut();
			break;
			case 'xml':
				if (!extension_loaded('SimpleXML'))
					throw new LinfoFatalException('Cannot generate XML. Install php\'s SimpleXML extension.');
				$output->xmlOut();
			break;
		}
	}
public function output ( ) { $ output = new LinfoOutput ( $ this ) ; if ( defined ( 'LINFO_CLI' ) && extension_loaded ( 'ncurses' ) && isset ( $ _SERVER [ 'argv' ] ) && ! in_array ( '--nocurses' , $ _SERVER [ 'argv' ] ) ) { $ output -> ncursesOut ( ) ; return ; } switch ( array_key_exists ( 'out' , $ _GET ) ? $ _GET [ 'out' ] : 'html' ) { case 'html' : default : $ output -> htmlOut ( ) ; break ; case 'json' : case 'jsonp' : $ output -> jsonOut ( ) ; break ; case 'php_array' : $ output -> serializedOut ( ) ; break ; case 'xml' : if ( ! extension_loaded ( 'SimpleXML' ) ) throw new LinfoFatalException ( 'Cannot generate XML. Install php\'s SimpleXML extension.' ) ; $ output -> xmlOut ( ) ; break ; } }
getInfo()
 Output data in a variety of methods depending on situation
getInfo () Output data in a variety of methods depending on situation
// To use JSON-P, pass the GET arg - callback=function_name