@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | private function packLogFile() |
107 | 107 | { |
108 | 108 | $logFile = $this->latest; |
109 | - $path = preg_replace('/[\\\\]+/', '/', $this->getConfig('save-zip-path') .'/'.date('Y-m-d').'.zip'); |
|
109 | + $path = preg_replace('/[\\\\]+/', '/', $this->getConfig('save-zip-path').'/'.date('Y-m-d').'.zip'); |
|
110 | 110 | $zip = $this->getZipArchive($path); |
111 | 111 | if ($zip !== null) { |
112 | - if ($zip->addFile($logFile, date('Y-m-d'). '-'. $zip->numFiles .'.log')) { |
|
112 | + if ($zip->addFile($logFile, date('Y-m-d').'-'.$zip->numFiles.'.log')) { |
|
113 | 113 | array_push($this->removeFiles, $logFile); |
114 | 114 | } |
115 | 115 | if (is_dir($this->getConfig('save-dump-path'))) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if (is_file($logFile) && file_exists($logFile)) { |
129 | 129 | rename( |
130 | 130 | $logFile, |
131 | - $this->getConfig('save-path') . '/' . date('Y-m-d'). '-'. substr(md5_file($logFile), 0, 8).'.log' |
|
131 | + $this->getConfig('save-path').'/'.date('Y-m-d').'-'.substr(md5_file($logFile), 0, 8).'.log' |
|
132 | 132 | ); |
133 | 133 | } |
134 | 134 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } elseif (null === $val) { |
242 | 242 | $val = 'null'; |
243 | 243 | } |
244 | - $replace['{' . $key . '}'] = $val; |
|
244 | + $replace['{'.$key.'}'] = $val; |
|
245 | 245 | } |
246 | 246 | return strtr($message, $replace); |
247 | 247 | } |
@@ -164,7 +164,7 @@ |
||
164 | 164 | private function sendWarningIfy(string $name) |
165 | 165 | { |
166 | 166 | if ($this->isSend()) { |
167 | - trigger_error($name .': response has been send', E_USER_WARNING); |
|
167 | + trigger_error($name.': response has been send', E_USER_WARNING); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function status(int $statusCode) |
48 | 48 | { |
49 | 49 | $this->response->status($statusCode); |
50 | - $this->status = $statusCode; |
|
50 | + $this->status = $statusCode; |
|
51 | 51 | return $this; |
52 | 52 | } |
53 | 53 |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -define('SUDA_APP', __DIR__ . '/../app'); |
|
4 | -define('SUDA_DATA', __DIR__ . '/../app/data'); |
|
5 | -define('SUDA_SYSTEM', __DIR__ . '/../suda'); |
|
3 | +define('SUDA_APP', __DIR__.'/../app'); |
|
4 | +define('SUDA_DATA', __DIR__.'/../app/data'); |
|
5 | +define('SUDA_SYSTEM', __DIR__.'/../suda'); |
|
6 | 6 | define('SUDA_PUBLIC', __DIR__); |
7 | 7 | define('SUDA_DEBUG', true); |
8 | 8 | define('SUDA_DEBUG_LEVEL', 'info'); |
9 | -define('SUDA_APP_MANIFEST', SUDA_APP . '/manifest'); |
|
9 | +define('SUDA_APP_MANIFEST', SUDA_APP.'/manifest'); |
|
10 | 10 | |
11 | -require_once SUDA_SYSTEM . '/loader/loader.php'; |
|
11 | +require_once SUDA_SYSTEM.'/loader/loader.php'; |
|
12 | 12 | |
13 | 13 | |
14 | 14 | use suda\framework\debug\log\logger\FileLogger; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | // 初始化系统加载器 |
23 | 23 | $loader = new Loader; |
24 | 24 | $loader->register(); |
25 | -$loader->addIncludePath(SUDA_SYSTEM . '/src', 'suda'); |
|
25 | +$loader->addIncludePath(SUDA_SYSTEM.'/src', 'suda'); |
|
26 | 26 | |
27 | 27 | $application = ApplicationBuilder::build($loader, SUDA_APP, SUDA_APP_MANIFEST, SUDA_DATA); |
28 | 28 | |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | $logger = new FileLogger( |
34 | 34 | [ |
35 | 35 | 'log-level' => SUDA_DEBUG_LEVEL, |
36 | - 'save-path' => $application->getDataPath() . '/logs', |
|
37 | - 'save-zip-path' => $application->getDataPath() . '/logs/zip', |
|
36 | + 'save-path' => $application->getDataPath().'/logs', |
|
37 | + 'save-zip-path' => $application->getDataPath().'/logs/zip', |
|
38 | 38 | 'log-format' => '%message%', |
39 | - 'save-pack-path' => $application->getDataPath() . '/logs/dump', |
|
39 | + 'save-pack-path' => $application->getDataPath().'/logs/dump', |
|
40 | 40 | ] |
41 | 41 | ); |
42 | 42 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $http = new Server('127.0.0.1', 9501); |
47 | 47 | |
48 | -$http->on('request', function ($request, $response) use ($application, $logger) { |
|
48 | +$http->on('request', function($request, $response) use ($application, $logger) { |
|
49 | 49 | $application->getDebug()->applyConfig([ |
50 | 50 | 'start-time' => microtime(true), |
51 | 51 | 'start-memory' => memory_get_usage(), |