-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from amnuts/105-jit-disabled
Updated for better JIT handling
- Loading branch information
Showing
9 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* OPcache GUI - build script | ||
* | ||
* @author Andrew Collington, [email protected] | ||
* @version 3.5.3 | ||
* @version 3.5.4 | ||
* @link https://github.com/amnuts/opcache-gui | ||
* @license MIT, https://acollington.mit-license.org/ | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* A simple but effective single-file GUI for the OPcache PHP extension. | ||
* | ||
* @author Andrew Collington, [email protected] | ||
* @version 3.5.3 | ||
* @version 3.5.4 | ||
* @link https://github.com/amnuts/opcache-gui | ||
* @license MIT, https://acollington.mit-license.org/ | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* A simple but effective single-file GUI for the OPcache PHP extension. | ||
* | ||
* @author Andrew Collington, [email protected] | ||
* @version 3.5.3 | ||
* @version 3.5.4 | ||
* @link https://github.com/amnuts/opcache-gui | ||
* @license MIT, https://acollington.mit-license.org/ | ||
*/ | ||
|
@@ -59,7 +59,7 @@ | |
|
||
class Service | ||
{ | ||
public const VERSION = '3.5.3'; | ||
public const VERSION = '3.5.4'; | ||
|
||
protected $tz; | ||
protected $data; | ||
|
@@ -417,7 +417,7 @@ protected function compileState(): array | |
]; | ||
} | ||
|
||
if ($overview && !empty($status['jit'])) { | ||
if ($overview && !empty($status['jit']['enabled'])) { | ||
$overview['jit_buffer_used_percentage'] = ($status['jit']['buffer_size'] | ||
? round(100 * (($status['jit']['buffer_size'] - $status['jit']['buffer_free']) / $status['jit']['buffer_size'])) | ||
: 0 | ||
|
@@ -488,9 +488,30 @@ protected function compileState(): array | |
'preload' => $preload, | ||
'directives' => $directives, | ||
'blacklist' => $config['blacklist'], | ||
'functions' => get_extension_funcs('Zend OPcache') | ||
'functions' => get_extension_funcs('Zend OPcache'), | ||
'jitState' => $this->jitState($status, $config['directives']), | ||
]; | ||
} | ||
|
||
protected function jitState(array $status, array $directives): array | ||
{ | ||
$state = [ | ||
'enabled' => $status['jit']['enabled'], | ||
'reason' => '' | ||
]; | ||
|
||
if (!$state['enabled']) { | ||
if (empty($directives['opcache.jit']) || $directives['opcache.jit'] === 'disable') { | ||
$state['reason'] = $this->txt('disabled due to <i>opcache.jit</i> setting'); | ||
} elseif (!$directives['opcache.jit_buffer_size']) { | ||
$state['reason'] = $this->txt('the <i>opcache.jit_buffer_size</i> must be set to fully enable JIT'); | ||
} else { | ||
$state['reason'] = $this->txt('incompatible with extensions that override <i>zend_execute_ex()</i>, such as <i>xdebug</i>'); | ||
} | ||
} | ||
|
||
return $state; | ||
} | ||
} | ||
|
||
$opcache = (new Service($options))->handle(); | ||
|
@@ -659,6 +680,7 @@ className: "tab-content-overview-info" | |
start: props.opstate.overview && props.opstate.overview.readable.start_time || null, | ||
reset: props.opstate.overview && props.opstate.overview.readable.last_restart_time || null, | ||
version: props.opstate.version, | ||
jit: props.opstate.jitState, | ||
txt: props.txt | ||
}), /*#__PURE__*/React.createElement(Directives, { | ||
directives: props.opstate.directives, | ||
|
@@ -896,7 +918,11 @@ function GeneralInfo(props) { | |
className: "tables general-info-table" | ||
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", { | ||
colSpan: "2" | ||
}, props.txt('General info')))), /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "Zend OPcache"), /*#__PURE__*/React.createElement("td", null, props.version.version)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "PHP"), /*#__PURE__*/React.createElement("td", null, props.version.php)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Host')), /*#__PURE__*/React.createElement("td", null, props.version.host)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Server Software')), /*#__PURE__*/React.createElement("td", null, props.version.server)), props.start ? /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Start time')), /*#__PURE__*/React.createElement("td", null, props.start)) : null, props.reset ? /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Last reset')), /*#__PURE__*/React.createElement("td", null, props.reset)) : null)); | ||
}, props.txt('General info')))), /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "Zend OPcache"), /*#__PURE__*/React.createElement("td", null, props.version.version)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "PHP"), /*#__PURE__*/React.createElement("td", null, props.version.php)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Host')), /*#__PURE__*/React.createElement("td", null, props.version.host)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Server Software')), /*#__PURE__*/React.createElement("td", null, props.version.server)), props.start ? /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Start time')), /*#__PURE__*/React.createElement("td", null, props.start)) : null, props.reset ? /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('Last reset')), /*#__PURE__*/React.createElement("td", null, props.reset)) : null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, props.txt('JIT enabled')), /*#__PURE__*/React.createElement("td", null, props.txt(props.jit.enabled ? "Yes" : "No"), props.jit.reason && /*#__PURE__*/React.createElement("span", { | ||
dangerouslySetInnerHTML: { | ||
__html: ` (${props.jit.reason})` | ||
} | ||
}))))); | ||
} | ||
|
||
function Directives(props) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters