- added "LibEvent" PHP extension to /setup page (optional requirement)

- minor fixes to /setup page
This commit is contained in:
Exodus4D
2017-07-24 20:20:38 +02:00
parent 8e52da6df2
commit 08330b4e4d
5 changed files with 37 additions and 13 deletions

View File

@@ -359,11 +359,11 @@ class Setup extends Controller {
],
'os' => [
'label' => 'OS',
'value' => function_exists('php_uname') ? php_uname('s') : 'unknown'
'value' => function_exists('php_uname') ? php_uname('s') : $_SERVER['OS']
],
'name' => [
'label' => 'Host name',
'value' => function_exists('php_uname') ? php_uname('n') : 'unknown'
'value' => function_exists('php_uname') ? php_uname('n') : $_SERVER['SERVER_NAME']
],
'release' => [
'label' => 'Release name',
@@ -375,7 +375,7 @@ class Setup extends Controller {
],
'machine' => [
'label' => 'Machine type',
'value' => function_exists('php_uname') ? php_uname('m') : 'unknown'
'value' => function_exists('php_uname') ? php_uname('m') : $_SERVER['PROCESSOR_ARCHITECTURE']
],
'root' => [
'label' => 'Document root',
@@ -402,11 +402,9 @@ class Setup extends Controller {
*/
protected function checkRequirements(\Base $f3){
// server type ------------------------------------------------------------------
$serverData = self::getServerData(0);
$checkRequirements = [
'serverType' => [
'label' => 'Server type',
@@ -519,6 +517,16 @@ class Setup extends Controller {
'version' => (class_exists('ZMQ') && defined('ZMQ::LIBZMQ_VER')) ? \ZMQ::LIBZMQ_VER : 'unknown',
'check' => version_compare( (class_exists('ZMQ') && defined('ZMQ::LIBZMQ_VER')) ? \ZMQ::LIBZMQ_VER : 0, $f3->get('REQUIREMENTS.LIBS.ZMQ'), '>='),
'tooltip' => 'ØMQ version. Required for WebSocket configuration.'
],
[
'label' => 'LibEvent library [optional]'
],
'ext_event' => [
'label' => 'Event extension',
'required' => $f3->get('REQUIREMENTS.PHP.EVENT'),
'version' => extension_loaded('event') ? phpversion('event') : 'missing',
'check' => version_compare( phpversion('event'), $f3->get('REQUIREMENTS.PHP.EVENT'), '>='),
'tooltip' => 'LibEvent PHP extension. Optional performance boost for WebSocket configuration.'
]
];

View File

@@ -26,6 +26,10 @@ REDIS = 3.0.0
; ZeroMQ (ØMQ) extension (optional) required for WebSocket Server extension (recommended)
ZMQ = 1.1.3
; Event extension (optional) for WebSocket configuration. Better performance
; https://pecl.php.net/package/event
EVENT = 2.3.0
; max execution time for requests
MAX_EXECUTION_TIME = 10

View File

@@ -46,7 +46,10 @@ define([
let testWebSocket = () => {
let tcpSocketPanel = $('#pf-setup-tcpSocket');
let webSocketPanel = $('#pf-setup-webSocket');
let WebSocketURI = MapWorker.getWebSocketURL();
let webSocketURI = MapWorker.getWebSocketURL();
let sslIcon = webSocketURI.startsWith('wss:') ?
'<i class="fa fa-fw fa-lock txt-color txt-color-success"></i>' :
'<i class="fa fa-fw fa-unlock txt-color txt-color-warning"></i>';
webSocketPanel.showLoadingAnimation();
@@ -63,7 +66,7 @@ define([
let updateWebSocketPanel = (data) => {
if(data.uri){
let uriRow = webSocketPanel.find('.panel-body table tr');
uriRow.find('td:nth-child(2) kbd').text(data.uri.value);
uriRow.find('td:nth-child(2) kbd').html(data.uri.value);
if(data.uri.status){
let statusIcon = uriRow.find('td:nth-child(3) i');
removeColorClasses(statusIcon);
@@ -82,7 +85,7 @@ define([
// update initial
updateWebSocketPanel({
uri: {
value: WebSocketURI,
value: sslIcon + '&nbsp;' + webSocketURI,
status: true
},
status: {
@@ -92,7 +95,7 @@ define([
});
// try to connect to WebSocket server
let socket = new WebSocket(WebSocketURI);
let socket = new WebSocket(webSocketURI);
socket.onopen = (e) => {
updateWebSocketPanel({

View File

@@ -46,7 +46,10 @@ define([
let testWebSocket = () => {
let tcpSocketPanel = $('#pf-setup-tcpSocket');
let webSocketPanel = $('#pf-setup-webSocket');
let WebSocketURI = MapWorker.getWebSocketURL();
let webSocketURI = MapWorker.getWebSocketURL();
let sslIcon = webSocketURI.startsWith('wss:') ?
'<i class="fa fa-fw fa-lock txt-color txt-color-success"></i>' :
'<i class="fa fa-fw fa-unlock txt-color txt-color-warning"></i>';
webSocketPanel.showLoadingAnimation();
@@ -63,7 +66,7 @@ define([
let updateWebSocketPanel = (data) => {
if(data.uri){
let uriRow = webSocketPanel.find('.panel-body table tr');
uriRow.find('td:nth-child(2) kbd').text(data.uri.value);
uriRow.find('td:nth-child(2) kbd').html(data.uri.value);
if(data.uri.status){
let statusIcon = uriRow.find('td:nth-child(3) i');
removeColorClasses(statusIcon);
@@ -82,7 +85,7 @@ define([
// update initial
updateWebSocketPanel({
uri: {
value: WebSocketURI,
value: sslIcon + '&nbsp;' + webSocketURI,
status: true
},
status: {
@@ -92,7 +95,7 @@ define([
});
// try to connect to WebSocket server
let socket = new WebSocket(WebSocketURI);
let socket = new WebSocket(webSocketURI);
socket.onopen = (e) => {
updateWebSocketPanel({

View File

@@ -237,6 +237,12 @@
<kbd>{{ @FAVICON }}</kbd>
</td>
</tr>
<tr>
<td>CONFIG PATH</td>
<td class="text-right">
<kbd>{{ implode(' ', @CONF ) }}</kbd>
</td>
</tr>
</tbody>
</table>