Passed
Push — dev ( e71b36...740957 )
by 世昌
02:18
created
suda/loader/main.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@
 block discarded – undo
7 7
 use suda\application\builder\ApplicationBuilder;
8 8
 use suda\framework\http\HTTPResponse as Response;
9 9
 
10
-require_once __DIR__ .'/loader.php';
10
+require_once __DIR__.'/loader.php';
11 11
 
12 12
 // 初始化系统加载器
13 13
 $loader = new Loader;
14 14
 $loader->register();
15
-$loader->addIncludePath(SUDA_SYSTEM .'/src', 'suda');
15
+$loader->addIncludePath(SUDA_SYSTEM.'/src', 'suda');
16 16
 // 初始化数据目录
17 17
 defined('SUDA_DATA') or define('SUDA_DATA', Path::toAbsolutePath('~/data'));
18 18
 defined('SUDA_APP_MANIFEST') or define('SUDA_APP_MANIFEST', SUDA_APP.'/manifest');
Please login to merge, or discard this patch.
server.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
2 2
 $host = $argv[1] ?? '127.0.0.1:9501';
3 3
 list($ip, $port) = explode(':', $host);
4 4
 
5
-define('SUDA_APP', __DIR__ . '/app');
6
-define('SUDA_DATA', __DIR__ . '/data');
7
-define('SUDA_SYSTEM', __DIR__ . '/suda');
5
+define('SUDA_APP', __DIR__.'/app');
6
+define('SUDA_DATA', __DIR__.'/data');
7
+define('SUDA_SYSTEM', __DIR__.'/suda');
8 8
 define('SUDA_PUBLIC', __DIR__);
9 9
 define('SUDA_DEBUG', true);
10 10
 define('SUDA_DEBUG_LEVEL', 'info');
11
-define('SUDA_APP_MANIFEST', SUDA_APP . '/manifest');
11
+define('SUDA_APP_MANIFEST', SUDA_APP.'/manifest');
12 12
 
13 13
 // 设置IP或者端口
14 14
 define('SUDA_SWOOLE_IP', $ip);
Please login to merge, or discard this patch.
suda/src/framework/debug/log/logger/FileLogger.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $msec = explode('.', microtime(true))[1];
93 93
         $save = $this->getConfig('save-path');
94
-        $this->tempName = $save . '/' . date('YmdHis') . '.' . $msec . '.log';
94
+        $this->tempName = $save.'/'.date('YmdHis').'.'.$msec.'.log';
95 95
         $temp = fopen($this->tempName, 'w+');
96 96
         if ($temp !== false) {
97 97
             $this->temp = $temp;
98 98
         } else {
99
-            throw new FileLoggerException(__METHOD__ . ':' . sprintf('cannot create log file'));
99
+            throw new FileLoggerException(__METHOD__.':'.sprintf('cannot create log file'));
100 100
         }
101
-        $this->latest = $save . '/' . $this->getConfig('file-name');
101
+        $this->latest = $save.'/'.$this->getConfig('file-name');
102 102
     }
103 103
 
104 104
     /**
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
         $path = preg_replace(
127 127
             '/[\\\\]+/',
128 128
             '/',
129
-            $this->getConfig('save-zip-path') . '/' . date('Y-m-d') . '.zip'
129
+            $this->getConfig('save-zip-path').'/'.date('Y-m-d').'.zip'
130 130
         );
131 131
         $zip = $this->getZipArchive($path);
132 132
         if ($zip !== null) {
133
-            if ($zip->addFile($logFile, date('Y-m-d') . '-' . $zip->numFiles . '.log')) {
133
+            if ($zip->addFile($logFile, date('Y-m-d').'-'.$zip->numFiles.'.log')) {
134 134
                 array_push($this->removeFiles, $logFile);
135 135
             }
136 136
             if (is_dir($this->getConfig('save-dump-path'))) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     RecursiveDirectoryIterator::SKIP_DOTS
140 140
                 ));
141 141
                 foreach ($it as $dumpLog) {
142
-                    if ($zip->addFile($dumpLog, 'dump/' . basename($dumpLog))) {
142
+                    if ($zip->addFile($dumpLog, 'dump/'.basename($dumpLog))) {
143 143
                         array_push($this->removeFiles, $dumpLog);
144 144
                     }
145 145
                 }
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
                 rename(
151 151
                     $logFile,
152 152
                     $this->getConfig('save-path')
153
-                    . '/' . date('Y-m-d')
154
-                    . '-' . substr(md5_file($logFile), 0, 8) . '.log'
153
+                    . '/'.date('Y-m-d')
154
+                    . '-'.substr(md5_file($logFile), 0, 8).'.log'
155 155
                 );
156 156
             }
157 157
         }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             $replace['%level%'] = $level;
208 208
             $replace['%message%'] = $message;
209 209
             $write = strtr($this->getConfig('log-format'), $replace);
210
-            fwrite($this->getAvailableWrite(), $write . PHP_EOL);
210
+            fwrite($this->getAvailableWrite(), $write.PHP_EOL);
211 211
         }
212 212
     }
213 213
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
             } elseif (null === $val) {
284 284
                 $val = 'null';
285 285
             }
286
-            $replace['{' . $key . '}'] = $val;
286
+            $replace['{'.$key.'}'] = $val;
287 287
         }
288 288
         return strtr($message, $replace);
289 289
     }
Please login to merge, or discard this patch.
suda/loader/swoole.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ . '/loader.php';
2
+require_once __DIR__.'/loader.php';
3 3
 
4 4
 use Swoole\Http\Server;
5 5
 use suda\swoole\Request;
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 // 初始化系统加载器
17 17
 $loader = new Loader;
18 18
 $loader->register();
19
-$loader->addIncludePath(SUDA_SYSTEM . '/src', 'suda');
19
+$loader->addIncludePath(SUDA_SYSTEM.'/src', 'suda');
20 20
 
21 21
 // 创建应用
22 22
 $application = ApplicationBuilder::build($loader, SUDA_APP, SUDA_APP_MANIFEST, SUDA_DATA);
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 $application->config()->set('copy-static-source', false);
29 29
 $http = new Server(SUDA_SWOOLE_IP, SUDA_SWOOLE_PORT);
30 30
 
31
-$http->on('request', function ($request, $response) use ($application) {
31
+$http->on('request', function($request, $response) use ($application) {
32 32
     // 拷贝副本
33 33
     $runApplication = clone $application;
34 34
     // 文件日志记录
35 35
     $logger = new FileLogger(
36 36
         [
37 37
             'log-level' => SUDA_DEBUG_LEVEL,
38
-            'save-path' => $application->getDataPath() . '/logs',
39
-            'save-zip-path' => $application->getDataPath() . '/logs/zip',
40
-            'save-dump-path' => $application->getDataPath() . '/logs/dump',
38
+            'save-path' => $application->getDataPath().'/logs',
39
+            'save-zip-path' => $application->getDataPath().'/logs/zip',
40
+            'save-dump-path' => $application->getDataPath().'/logs/dump',
41 41
             'log-format' => '%message%',
42 42
         ]
43 43
     );
Please login to merge, or discard this patch.