Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the -o arg to dot to write directly to disk, rather than reading …

…the contents into memory and using file_put_contents()

Conflicts:

	index.php
  • Loading branch information...
commit ffb7cadda73a811b39864e17c39849bfc408fcbd 1 parent 0ae82cf
@tabacco tabacco authored committed
Showing with 10 additions and 11 deletions.
  1. +10 −11 index.php
View
21 index.php
@@ -143,17 +143,16 @@ class Webgrind_MasterConfig
}
header("Content-Type: image/png");
$filename = Webgrind_Config::storageDir().$dataFile.'-'.$showFraction.Webgrind_Config::$preprocessedSuffix.'.png';
- if (!file_exists($filename)) {
- $imageData = shell_exec(Webgrind_Config::$pythonExecutable.' library/gprof2dot.py -n '.$showFraction.' -f callgrind '.Webgrind_Config::xdebugOutputDir().''.$dataFile.' | '.Webgrind_Config::$dotExecutable.' -Tpng');
- file_put_contents($filename, $imageData);
- }
- readfile($filename);
- break;
- case 'version_info':
- $response = @file_get_contents('http://jokke.dk/webgrindupdate.json?version='.Webgrind_Config::$webgrindVersion);
- echo $response;
- break;
- default:
+ if (!file_exists($filename)) {
+ shell_exec(Webgrind_Config::$pythonExecutable.' library/gprof2dot.py -n '.$showFraction.' -f callgrind '.Webgrind_Config::xdebugOutputDir().''.$dataFile.' | '.Webgrind_Config::$dotExecutable.' -Tpng -o ' . $filename);
+ }
+ readfile($filename);
+ break;
+ case 'version_info':
+ $response = @file_get_contents('http://jokke.dk/webgrindupdate.json?version='.Webgrind_Config::$webgrindVersion);
+ echo $response;
+ break;
+ default:
$welcome = '';
if (!file_exists(Webgrind_Config::storageDir()) || !is_writable(Webgrind_Config::storageDir())) {
$welcome .= 'Webgrind $storageDir does not exist or is not writeable: <code>'.Webgrind_Config::storageDir().'</code><br>';
Please sign in to comment.
Something went wrong with that request. Please try again.