Add debug option
[gitphp.git] / index.php
blob:a/index.php -> blob:b/index.php
--- a/index.php
+++ b/index.php
@@ -22,6 +22,14 @@
   * Configuration
   */
  require_once('config/gitphp.conf.php');
+
+ /*
+  * Debug
+  */
+ if ($gitphp_conf['debug']) {
+ 	define('GITPHP_START_TIME', microtime(true));
+	error_reporting(E_ALL|E_STRICT);
+ }
 
  /*
   * Instantiate Smarty
@@ -204,6 +212,9 @@
 	 $tpl->display("footer.tpl");
  }
 
+ if ($gitphp_conf['debug'])
+ 	echo "Execution time: " . round(microtime(true) - GITPHP_START_TIME, 8) . " sec";
+
  ob_end_flush();
 
 ?>

comments