Location: PHPKode > scripts > SecureLab > securelab/securelab-dumpapi.php
<?php

 class SecureLabDumpAPI {
 
	private $SecureLabDump;
		
	public function __construct() {
	
		return true;
		
	}
	
	
	public function CreateDumpEvent ( $DetailedInformation ) {
	  
		try {
	  
			if( ! $DetailedInformation["ErrorReporterFile"] ) {
			
				throw new Exception("File which requested a CreateDumpEvent function is not defined");
				
				return false;
			
			}
			
			if( ! $DetailedInformation["ErrorReporterMessage"] ) {
			
				throw new Exception("Error details are not defined");
			
			}
			
			if( ! $DetailedInformation["ErrorOccuredObject"] ) {
				
				throw new Exception("Object where error occurred is not defined");
				
				return false;
			
			}
			
			
			if( ! $DetailedInformation["ErrorFileLine"] ) {
			
				throw new Exception("Line of file where error occurred is not defined");
				
				return false;
			
			}
			
			
			$this->SecureLabDump[] = array(
			
				"ErrorReporterFile" => $DetailedInformation["ErrorReporterFile"],
				
				"ErrorReporterMessage" => $DetailedInformation["ErrorReporterMessage"],
				
				"ErrorOccuredObject" => $DetailedInformation["ErrorOccuredObject"],
				
				"ErrorIncomingEvent" => $DetailedInformation["ErrorIncomingEvent"],
				
				"ErrorFileLine" => $DetailedInformation["ErrorFileLine"]
			
			);
			
		
		}  catch( Exception $ErrorMsg )  {
		
			@ $this->CreateDumpEvent( array(
			
				"ErrorReporterFile" => __FILE__,
				
				"ErrorReporterMessage" => $ErrorMsg->getMessage(),
				
				"ErrorOccuredObject" => __METHOD__,
				
				"ErrorIncomingEvent" => null,
				
				"ErrorFileLine" => __LINE__
			
			) );
		
		}
		
	}
	
	public function AccessGlobalDump( $ReturnPlainArray = false ) {
		
		if( $ReturnPlainArray == false ) {
		
			$HTMLOutput["Stylesheet"] = "<style type=\"text/css\"> \r\n .SLErrorBlock {\r\n padding: 10px; \r\n margin: 10px; \r\n margin-bottom: -15px; \r\n background: #F9F9F9; \r\n border: solid 1px #EEEEEE; \r\n border-radius: 5px; \r\n line-height: 40px; \r\n font: 10px Georgia; \r\n } \r\n</style>";
			
			$HTMLText = null;
			
			foreach( $this->SecureLabDump as $ErrorID => $ErrorArrayDesc ) {
					
				$ErrorID = (int) $ErrorID;
					
				$HTMLText .= "<div class=\"SLErrorBlock\"><table style=\"line-height: 26px;\"><tr><td><b>ID:</b></td><td> " . 
					$ErrorID                                . "</td></tr><tr><td> <b>File:</b></td> <td><span style=\"color: orange;\">" . 
					$ErrorArrayDesc["ErrorReporterFile"]    . "</span></td></tr><tr><td> <b>Line:</b></td> <td><span style=\"color: darkred;\">" . 
					$ErrorArrayDesc["ErrorFileLine"]        . "</span></td></tr><tr><td> <b>Object:</b></td> <td><span style=\"color: green;\">" . 
					$ErrorArrayDesc["ErrorOccuredObject"]   . "</span></td></tr><tr><td> <b>Incoming:&nbsp;&nbsp;&nbsp;</b></td> <td><span style=\"color: blue;\">" .
					$ErrorArrayDesc["ErrorIncomingEvent"]   . "</span></td></tr><tr><td> <b>Desc:</b></td> <td><span style=\"color: darkviolet;\">" .
					$ErrorArrayDesc["ErrorReporterMessage"] . "</span>.</td></tr></table></div>\r\n";

			}
				
			return $HTMLOutput["Stylesheet"] . $HTMLText;
		
		}  else  {
		
			return $this->SecureLabDump;
		
		}
	
	}
	  
 }
	  
	 ?>
Return current item: SecureLab