Location: PHPKode > projects > Admbook > admin/config-default.php
<?php
	class Timer {
		var $startTime;
		var $endTime;
		function start() {
			$this->startTime = gettimeofday();
		}
		function stop() {
			$this->endTime = gettimeofday();
		}
		function elapsed() {
			return (($this->endTime["sec"] - $this->startTime["sec"]) * 1000000 + ($this->endTime["usec"] - $this->startTime["usec"])) / 1000000;
		}
	}
	$timer = new Timer();
	$timer->start();
	session_start();
	include("../config-data.php");
	include("../lib.php");
	checkPermissions($login, $password);
	$updateConstant = "<?php\n";
	foreach ($config['default'] as $key => $value) {
		if (gettype($value) == "boolean")
			if ($value)
				$value = "true";
			else
				$value = "false";
		else
			$value = "\"".$value."\"";
		$updateConstant .= "\t\$constant['".$key."'] = ".$value.";\n";
	}
	$updateConstant .= "?>";
	reWriteDataInFile ($updateConstant,"../settings-data.php");
	$timer->stop();
	Header("Location: config.php?page=".$page."&".$timer->elapsed());exit;
?>
Return current item: Admbook