Permalink
Browse files

added bootstrap for examples

  • Loading branch information...
1 parent 810317b commit 45d4d48d85ce4e5d9c8d3b45f840a127f7a0427f @tidal committed Jun 30, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 examples/misc/bootstrap.php
@@ -0,0 +1,16 @@
+<?php
+
+require_once(__DIR__.'/../../misc/bootstrap.php');
+
+$eol = php_sapi_name() == 'cli' ? "\n" : "<br>";
+define('EOL', $eol);
+
+function convert($size)
+ {
+ $unit=array('b','kb','mb','gb','tb','pb');
+ return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
+ }
+
+ function memory_usage($realUsage = false){
+ return convert(memory_get_usage($realUsage));
+ }

0 comments on commit 45d4d48

Please sign in to comment.