Skip to content

Commit 1a9b471

Browse files
committed
add swow server
1 parent 9d6316e commit 1a9b471

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/Ubiquity

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Ubiquity {
4949

5050
use CmdTrait;
5151

52-
private static $version = '1.4.8';
52+
private static $version = '1.4.9';
5353

5454
private static $appName = 'Ubiquity devtools';
5555

@@ -126,6 +126,15 @@ class Ubiquity {
126126
'require' => 'phpmv/ubiquity-workerman',
127127
'start' => '_workerman.php start'
128128
],
129+
'swow' => [
130+
'files' => [
131+
'/devtools/server/_swow.php' => '.ubiquity/_swow.php'
132+
],
133+
'config' => 'swow-config.php',
134+
'checkClass' => '\\Ubiquity\\servers\\swow\\SwowServer',
135+
'require' => 'phpmv/ubiquity-swow',
136+
'start' => '_swow.php start'
137+
],
129138
'roadrunner' => [
130139
'files' => [],
131140
'config' => 'config.php',

src/devtools/server/_swow.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env php
2+
<?php
3+
// swow.php
4+
5+
if (! defined ( 'DS' )) {
6+
define ( 'DS', DIRECTORY_SEPARATOR );
7+
define ( 'ROOT', __DIR__ . \DS .'..'.\DS. 'app' . \DS );
8+
}
9+
$config=include ROOT.'cache/config/config.cache.php';
10+
$sConfig= include __DIR__.\DS.'swow-config.php';
11+
$config["sessionName"]=$sConfig["sessionName"];
12+
$address=$sConfig['host'].':'.$sConfig['port'];
13+
$config ["siteUrl"] = 'http://'.$address;
14+
require ROOT . './../vendor/autoload.php';
15+
$swowServer=new \Ubiquity\servers\swow\SwowServer();
16+
$swowServer->init($config, realpath(__DIR__.\DS.'..'.\DS.'public'.\DS));
17+
require ROOT.'config/services.php';
18+
$swowServer->run($sConfig['host'],$sConfig['port'],$sConfig['socket']??[]);

0 commit comments

Comments
 (0)