|
@@ -64,27 +64,29 @@ class Service
|
|
{
|
|
{
|
|
public const VERSION = '3.4.0';
|
|
public const VERSION = '3.4.0';
|
|
|
|
|
|
|
|
+ protected $tz;
|
|
protected $data;
|
|
protected $data;
|
|
protected $options;
|
|
protected $options;
|
|
protected $optimizationLevels;
|
|
protected $optimizationLevels;
|
|
protected $defaults = [
|
|
protected $defaults = [
|
|
- 'allow_filelist' => true, // show/hide the files tab
|
|
|
|
- 'allow_invalidate' => true, // give a link to invalidate files
|
|
|
|
- 'allow_reset' => true, // give option to reset the whole cache
|
|
|
|
- 'allow_realtime' => true, // give option to enable/disable real-time updates
|
|
|
|
- 'refresh_time' => 5, // how often the data will refresh, in seconds
|
|
|
|
- 'size_precision' => 2, // Digits after decimal point
|
|
|
|
- 'size_space' => false, // have '1MB' or '1 MB' when showing sizes
|
|
|
|
- 'charts' => true, // show gauge chart or just big numbers
|
|
|
|
- 'debounce_rate' => 250, // milliseconds after key press to send keyup event when filtering
|
|
|
|
- 'per_page' => 200, // How many results per page to show in the file list, false for no pagination
|
|
|
|
- 'cookie_name' => 'opcachegui', // name of cookie
|
|
|
|
- 'cookie_ttl' => 365, // days to store cookie
|
|
|
|
|
|
+ 'allow_filelist' => true, // show/hide the files tab
|
|
|
|
+ 'allow_invalidate' => true, // give a link to invalidate files
|
|
|
|
+ 'allow_reset' => true, // give option to reset the whole cache
|
|
|
|
+ 'allow_realtime' => true, // give option to enable/disable real-time updates
|
|
|
|
+ 'refresh_time' => 5, // how often the data will refresh, in seconds
|
|
|
|
+ 'size_precision' => 2, // Digits after decimal point
|
|
|
|
+ 'size_space' => false, // have '1MB' or '1 MB' when showing sizes
|
|
|
|
+ 'charts' => true, // show gauge chart or just big numbers
|
|
|
|
+ 'debounce_rate' => 250, // milliseconds after key press to send keyup event when filtering
|
|
|
|
+ 'per_page' => 200, // How many results per page to show in the file list, false for no pagination
|
|
|
|
+ 'cookie_name' => 'opcachegui', // name of cookie
|
|
|
|
+ 'cookie_ttl' => 365, // days to store cookie
|
|
|
|
+ 'datetime_format' => 'D, d M Y H:i:s O', // Show datetime in this format
|
|
'highlight' => [
|
|
'highlight' => [
|
|
- 'memory' => true, // show the memory chart/big number
|
|
|
|
- 'hits' => true, // show the hit rate chart/big number
|
|
|
|
- 'keys' => true, // show the keys used chart/big number
|
|
|
|
- 'jit' => true // show the jit buffer chart/big number
|
|
|
|
|
|
+ 'memory' => true, // show the memory chart/big number
|
|
|
|
+ 'hits' => true, // show the hit rate chart/big number
|
|
|
|
+ 'keys' => true, // show the keys used chart/big number
|
|
|
|
+ 'jit' => true // show the jit buffer chart/big number
|
|
]
|
|
]
|
|
];
|
|
];
|
|
protected $jitModes = [
|
|
protected $jitModes = [
|
|
@@ -158,6 +160,7 @@ class Service
|
|
1 << 15 => 'Inline functions'
|
|
1 << 15 => 'Inline functions'
|
|
];
|
|
];
|
|
$this->options = array_merge($this->defaults, $options);
|
|
$this->options = array_merge($this->defaults, $options);
|
|
|
|
+ $this->tz = new DateTimeZone(date_default_timezone_get());
|
|
$this->data = $this->compileState();
|
|
$this->data = $this->compileState();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -321,6 +324,15 @@ class Service
|
|
'hits' => number_format($file['hits']),
|
|
'hits' => number_format($file['hits']),
|
|
'memory_consumption' => $this->size($file['memory_consumption'])
|
|
'memory_consumption' => $this->size($file['memory_consumption'])
|
|
];
|
|
];
|
|
|
|
+ $file['last_used'] = (new DateTimeImmutable("@{$file['last_used_timestamp']}"))
|
|
|
|
+ ->setTimezone($this->tz)
|
|
|
|
+ ->format($this->getOption('datetime_format'));
|
|
|
|
+ $file['last_modified'] = "";
|
|
|
|
+ if (!empty($file['timestamp'])) {
|
|
|
|
+ $file['last_modified'] = (new DateTimeImmutable("@{$file['timestamp']}"))
|
|
|
|
+ ->setTimezone($this->tz)
|
|
|
|
+ ->format($this->getOption('datetime_format'));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
$files = array_values($status['scripts']);
|
|
$files = array_values($status['scripts']);
|
|
}
|
|
}
|
|
@@ -353,13 +365,13 @@ class Service
|
|
'max_cached_keys' => number_format($status['opcache_statistics']['max_cached_keys']),
|
|
'max_cached_keys' => number_format($status['opcache_statistics']['max_cached_keys']),
|
|
'interned' => null,
|
|
'interned' => null,
|
|
'start_time' => (new DateTimeImmutable("@{$status['opcache_statistics']['start_time']}"))
|
|
'start_time' => (new DateTimeImmutable("@{$status['opcache_statistics']['start_time']}"))
|
|
- ->setTimezone(new DateTimeZone(date_default_timezone_get()))
|
|
|
|
- ->format('Y-m-d H:i:s'),
|
|
|
|
|
|
+ ->setTimezone($this->tz)
|
|
|
|
+ ->format($this->getOption('datetime_format')),
|
|
'last_restart_time' => ($status['opcache_statistics']['last_restart_time'] === 0
|
|
'last_restart_time' => ($status['opcache_statistics']['last_restart_time'] === 0
|
|
? 'never'
|
|
? 'never'
|
|
: (new DateTimeImmutable("@{$status['opcache_statistics']['last_restart_time']}"))
|
|
: (new DateTimeImmutable("@{$status['opcache_statistics']['last_restart_time']}"))
|
|
- ->setTimezone(new DateTimeZone(date_default_timezone_get()))
|
|
|
|
- ->format('Y-m-d H:i:s')
|
|
|
|
|
|
+ ->setTimezone($this->tz)
|
|
|
|
+ ->format($this->getOption('datetime_format'))
|
|
)
|
|
)
|
|
]
|
|
]
|
|
]
|
|
]
|
|
@@ -434,7 +446,7 @@ class Service
|
|
$version = array_merge(
|
|
$version = array_merge(
|
|
$config['version'],
|
|
$config['version'],
|
|
[
|
|
[
|
|
- 'php' => phpversion(),
|
|
|
|
|
|
+ 'php' => PHP_VERSION,
|
|
'server' => $_SERVER['SERVER_SOFTWARE'] ?: '',
|
|
'server' => $_SERVER['SERVER_SOFTWARE'] ?: '',
|
|
'host' => (function_exists('gethostname')
|
|
'host' => (function_exists('gethostname')
|
|
? gethostname()
|
|
? gethostname()
|
|
@@ -1283,6 +1295,8 @@ class CachedFiles extends React.Component {
|
|
}, /*#__PURE__*/React.createElement("option", {
|
|
}, /*#__PURE__*/React.createElement("option", {
|
|
value: "last_used_timestamp"
|
|
value: "last_used_timestamp"
|
|
}, "Last used"), /*#__PURE__*/React.createElement("option", {
|
|
}, "Last used"), /*#__PURE__*/React.createElement("option", {
|
|
|
|
+ value: "last_modified"
|
|
|
|
+ }, "Last modified"), /*#__PURE__*/React.createElement("option", {
|
|
value: "full_path"
|
|
value: "full_path"
|
|
}, "Path"), /*#__PURE__*/React.createElement("option", {
|
|
}, "Path"), /*#__PURE__*/React.createElement("option", {
|
|
value: "hits"
|
|
value: "hits"
|
|
@@ -1337,7 +1351,7 @@ class CachedFile extends React.Component {
|
|
className: "file-pathname"
|
|
className: "file-pathname"
|
|
}, this.props.full_path), /*#__PURE__*/React.createElement("span", {
|
|
}, this.props.full_path), /*#__PURE__*/React.createElement("span", {
|
|
className: "file-metainfo"
|
|
className: "file-metainfo"
|
|
- }, /*#__PURE__*/React.createElement("b", null, "hits: "), /*#__PURE__*/React.createElement("span", null, this.props.readable.hits, ", "), /*#__PURE__*/React.createElement("b", null, "memory: "), /*#__PURE__*/React.createElement("span", null, this.props.readable.memory_consumption, ", "), /*#__PURE__*/React.createElement("b", null, "last used: "), /*#__PURE__*/React.createElement("span", null, this.props.last_used)), !this.props.timestamp && /*#__PURE__*/React.createElement("span", {
|
|
|
|
|
|
+ }, /*#__PURE__*/React.createElement("b", null, "hits: "), /*#__PURE__*/React.createElement("span", null, this.props.readable.hits, ", "), /*#__PURE__*/React.createElement("b", null, "memory: "), /*#__PURE__*/React.createElement("span", null, this.props.readable.memory_consumption, ", "), this.props.last_modified && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", null, "last modified: "), /*#__PURE__*/React.createElement("span", null, this.props.last_modified, ", ")), /*#__PURE__*/React.createElement("b", null, "last used: "), /*#__PURE__*/React.createElement("span", null, this.props.last_used)), !this.props.timestamp && /*#__PURE__*/React.createElement("span", {
|
|
className: "invalid file-metainfo"
|
|
className: "invalid file-metainfo"
|
|
}, " - has been invalidated"), this.props.canInvalidate && /*#__PURE__*/React.createElement("span", null, ",\xA0", /*#__PURE__*/React.createElement("a", {
|
|
}, " - has been invalidated"), this.props.canInvalidate && /*#__PURE__*/React.createElement("span", null, ",\xA0", /*#__PURE__*/React.createElement("a", {
|
|
className: "file-metainfo",
|
|
className: "file-metainfo",
|