Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Commit f93f1b8

Browse files
committed
Webgrind 1.7.0 (neard/neard#454)
1 parent 6ae51ea commit f93f1b8

File tree

5 files changed

+205
-5
lines changed

5 files changed

+205
-5
lines changed

CHANGELOG.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# Changelog
22

3+
## r5 (2020/04/19)
4+
5+
* Webgrind 1.7.0 (neard/neard#454)
6+
37
## r5 (2017/09/02)
48

5-
* New release : 1.5.0 (Issue neard/neard#316)
9+
* Webgrind 1.5.0 (neard/neard#316)
610

711
## r4 (2016/10/07)
812

9-
* New release : 1.4.0 (Issue neard/neard#120)
13+
* Webgrind 1.4.0 (neard/neard#120)
1014

1115
## r3 (2016/06/21)
1216

13-
* New release : 1.3.1 (Issue neard/neard#120)
17+
* Webgrind 1.3.1 (neard/neard#120)
1418

1519
## r2 (2016/04/07)
1620

17-
* New release : 1.1
21+
* Webgrind 1.1
1822

1923
## r1 (2016/04/07)
2024

bin/webgrind1.7.0/config.php

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
<?php
2+
3+
/**
4+
* Configuration for webgrind
5+
* @author Jacob Oettinger
6+
* @author Joakim Nygård
7+
*/
8+
class Webgrind_Config extends Webgrind_MasterConfig {
9+
/**
10+
* Automatically check if a newer version of webgrind is available for download
11+
*/
12+
static $checkVersion = true;
13+
static $hideWebgrindProfiles = true;
14+
15+
/**
16+
* Writable dir for information storage.
17+
* If empty, will use system tmp folder or xdebug tmp
18+
*/
19+
static $storageDir = '';
20+
static $profilerDir = '';
21+
22+
/**
23+
* Suffix for preprocessed files
24+
*/
25+
static $preprocessedSuffix = '.webgrind';
26+
27+
/**
28+
* Image type of graph to output
29+
* Can be png or svg
30+
*/
31+
static $graphImageType = 'svg';
32+
33+
static $defaultTimezone = 'UTC';
34+
static $dateFormat = 'Y-m-d H:i:s';
35+
static $defaultCostformat = 'percent'; // 'percent', 'usec' or 'msec'
36+
static $defaultFunctionPercentage = 90;
37+
static $defaultHideInternalFunctions = false;
38+
39+
/**
40+
* Path to python executable
41+
*/
42+
static $pythonExecutable = '/usr/bin/python';
43+
44+
/**
45+
* Path to graphviz dot executable
46+
*/
47+
static $dotExecutable = '/usr/bin/dot';
48+
49+
/**
50+
* sprintf compatible format for generating links to source files.
51+
* %1$s will be replaced by the full path name of the file
52+
* %2$d will be replaced by the linenumber
53+
*/
54+
static $fileUrlFormat = 'index.php?op=fileviewer&file=%1$s#line%2$d'; // Built in fileviewer
55+
//static $fileUrlFormat = 'txmt://open/?url=file://%1$s&line=%2$d'; // Textmate
56+
//static $fileUrlFormat = 'file://%1$s'; // ?
57+
58+
/**
59+
* format of the trace drop down list
60+
* default is: invokeurl (tracefile_name) [tracefile_size]
61+
* the following options will be replaced:
62+
* %i - invoked url
63+
* %f - trace file name
64+
* %s - size of trace file
65+
* %m - modified time of file name (in dateFormat specified above)
66+
*/
67+
static $traceFileListFormat = '%i (%f) [%s]';
68+
69+
/**
70+
* Proxy functions are stepped over transparently. Functions listed here
71+
* MUST make exactly one (though not necessarily the same one) function
72+
* call per execution.
73+
*/
74+
static $proxyFunctions = array( // resolve dynamic function calls in-place
75+
'php::call_user_func',
76+
'php::call_user_func_array',
77+
);
78+
//static $proxyFunctions = array(); // do not skip any functions
79+
80+
/**
81+
* Specify which fields display, and the order to display them. Uncomment
82+
* entries to enable, move entries to change order.
83+
*/
84+
static $tableFields = array(
85+
'Invocation Count',
86+
'Total Self Cost',
87+
//'Average Self Cost',
88+
'Total Inclusive Cost',
89+
//'Average Inclusive Cost',
90+
);
91+
92+
#########################
93+
# BELOW NOT FOR EDITING #
94+
#########################
95+
96+
/**
97+
* Regex that matches the trace files generated by xdebug
98+
*/
99+
static function xdebugOutputFormat() {
100+
$outputName = ini_get('xdebug.profiler_output_name');
101+
if ($outputName=='') // Ini value not defined
102+
$outputName = '/^cachegrind\.out\..+$/';
103+
else
104+
$outputName = '/^'.preg_replace('/(%[^%])+/', '.+', $outputName).'$/';
105+
return $outputName;
106+
}
107+
108+
/**
109+
* Directory to search for trace files
110+
*/
111+
static function xdebugOutputDir() {
112+
$dir = ini_get('xdebug.profiler_output_dir');
113+
if ($dir=='') // Ini value not defined
114+
return realpath(Webgrind_Config::$profilerDir).'/';
115+
return realpath($dir).'/';
116+
}
117+
118+
/**
119+
* Writable dir for information storage
120+
*/
121+
static function storageDir() {
122+
if (!empty(Webgrind_Config::$storageDir))
123+
return realpath(Webgrind_Config::$storageDir).'/';
124+
125+
if (!function_exists('sys_get_temp_dir') || !is_writable(sys_get_temp_dir())) {
126+
// use xdebug setting
127+
return Webgrind_Config::xdebugOutputDir();
128+
}
129+
return realpath(sys_get_temp_dir()).'/';
130+
}
131+
132+
/**
133+
* Binary version of the preprocessor (for faster preprocessing)
134+
*
135+
* If the proper tools are installed and the bin dir is writeable for php,
136+
* automatically compile it (when necessary).
137+
* Automatic compilation disabled if `bin/make-failed` exists.
138+
* Run `make` in the webgrind root directory to manually compile.
139+
*/
140+
static function getBinaryPreprocessor() {
141+
$localBin = __DIR__.'/bin/';
142+
$makeFailed = $localBin.'make-failed';
143+
if (PHP_OS == 'WINNT') {
144+
$binary = $localBin.'preprocessor.exe';
145+
} else {
146+
$binary = $localBin.'preprocessor';
147+
}
148+
149+
if (!file_exists($binary) && is_writable($localBin) && !file_exists($makeFailed)) {
150+
if (PHP_OS == 'WINNT') {
151+
$success = static::compileBinaryPreprocessorWindows();
152+
} else {
153+
$success = static::compileBinaryPreprocessor();
154+
}
155+
if (!$success || !file_exists($binary)) {
156+
touch($makeFailed);
157+
}
158+
}
159+
160+
return $binary;
161+
}
162+
163+
static function compileBinaryPreprocessor() {
164+
$make = '/usr/bin/make';
165+
if (is_executable($make)) {
166+
$cwd = getcwd();
167+
chdir(__DIR__);
168+
exec($make, $output, $retval);
169+
chdir($cwd);
170+
return $retval == 0;
171+
}
172+
return false;
173+
}
174+
175+
static function compileBinaryPreprocessorWindows() {
176+
if (getenv('VSAPPIDDIR')) {
177+
$cwd = getcwd();
178+
chdir(__DIR__);
179+
exec('call "%VSAPPIDDIR%\..\Tools\vsdevcmd\ext\vcvars.bat" && nmake -f nmakefile', $output, $retval);
180+
chdir($cwd);
181+
return $retval == 0;
182+
} elseif (getenv('VS140COMNTOOLS')) {
183+
$cwd = getcwd();
184+
chdir(__DIR__);
185+
exec('call "%VS140COMNTOOLS%\vsvars32.bat" && nmake -f nmakefile', $output, $retval);
186+
chdir($cwd);
187+
return $retval == 0;
188+
}
189+
return false;
190+
}
191+
}

bin/webgrind1.7.0/neard.conf

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
webgrindVersion = "1.7.0"
2+
webgrindConf = "config.php"
3+
4+
bundleRelease = "@RELEASE_VERSION@"

build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
bundle.name = webgrind
2-
bundle.release = r5
2+
bundle.release = r6
33
bundle.type = apps
44
bundle.format = 7z
55

releases.properties

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
1.3.1 = https://github.com/neard/module-webgrind/releases/download/r3/neard-webgrind-1.3.1-r3.7z
44
1.4.0 = https://github.com/neard/module-webgrind/releases/download/r4/neard-webgrind-1.4.0-r4.7z
55
1.5.0 = https://github.com/neard/module-webgrind/releases/download/r5/neard-webgrind-1.5.0-r5.7z
6+
1.7.0 = https://github.com/neard/module-webgrind/releases/download/r6/neard-webgrind-1.7.0-r6.7z

0 commit comments

Comments
 (0)