Location: PHPKode > projects > PHP Ajax Forms Framework > pajff/pajff_debuger.php
<?php
/**
* Internal debuger
* 
* <p>Debuger object definition. If global $pajffdebuginfo is set 
* last 5 messages are shown in the footer region of PAjFF</p>
* 
* {@link http://sourceforge.net/projects/pajff Project home}
* 
* @package PAjFF
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Atanas Markov hide@address.com
* @version 0.0.2
* @copyright 2006 by Atanas Markov
*
* @subpackage pajff_debuger
**/

/**
 * debuger class
 * 
 * @package PAjFF
 * @subpackage pajff_debuger
 */
class pajff_debuger{
    /**
     * Message queue
     *
     * @var array
     */
	protected $messagearr= array();

	/**
	 * Add a message to the queue
	 *
	 * @param string $message
	 */
	public function addMessage($message){
		array_push(&$this->messagearr,$message);
		if (count($this->messagearr) > 5) {
			for ($i=1;$i<count($this->messagearr);$i++){
				$this->messagearr[$i-1]= $this->messagearr[$i];
			}
			array_pop($this->messagearr);
		}
	}

	/**
	 * Return HTML to represent all messages in queue
	 *
	 * @return string
	 */
	function getMessage(){
		$result="";
		$i=0;
		foreach ($this->messagearr as $message){
			$result .= "<p>$i --> ".$message."</p>";
			$i++;
		}
		return $result;
	}
}

?>
Return current item: PHP Ajax Forms Framework