All pastes #838820 Raw Edit

Unbenannt

public text v1 · immutable
#838820 ·published 2007-12-30 17:59 UTC
rendered paste body
<?PHP
abstract class JanitorModule {

	protected $content ="";
	protected $title = "";
	
	public function JanitorModule() {
		$this->content = gatherInformations();
	}
	public function getContent() {	
		return $this->content;
	}
	
	public function getTitle() {	
		return $this->content;
	}

	public function addContent($contenttoadd) {	
		$content = $content . $contenttoadd;
	}
	
	public function addTitle($contenttoadd) {	
		$title = $title." - ".$titletoadd;
	}
}
?>


--------------------------------

<?PHP
class Phpinfo extends JanitorModule {
	
	public function phpinfo() {
		addTitle("PHPInfo");
		gatherInformations();
	}
	private function gatherInformations () {
		ob_start();
		phpinfo();
		$info = ob_get_clean ();
		$matches = array ();
		$i = preg_match ('%(<style type="text/css">.*</style>).*<body>(.*)</body>%s', $info, $matches);
		addContent($matches[2]);
	}
}
?>