@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $fields = $reads; |
| 28 | 28 | } else { |
| 29 | 29 | $field = []; |
| 30 | - $prefix = strlen($table) ?"`{$table}`." :''; |
|
| 30 | + $prefix = strlen($table) ? "`{$table}`." : ''; |
|
| 31 | 31 | foreach ($reads as $want) { |
| 32 | 32 | $field[] = $prefix."`$want`"; |
| 33 | 33 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | protected function mergeBinder(array $binderArray, array $parameter) |
| 66 | 66 | { |
| 67 | 67 | foreach ($parameter as $key => $value) { |
| 68 | - if (! ($value instanceof Binder)) { |
|
| 68 | + if (!($value instanceof Binder)) { |
|
| 69 | 69 | $value = new Binder($key, $value); |
| 70 | 70 | } |
| 71 | 71 | if (!in_array($value, $binderArray)) { |
@@ -210,10 +210,10 @@ |
||
| 210 | 210 | list($updateSet, $upBinder) = $this->prepareUpdateSet($this->data); |
| 211 | 211 | $this->binder = array_merge($this->binder, $upBinder); |
| 212 | 212 | } |
| 213 | - $string = "UPDATE " . $this->table . " SET " . $updateSet . " WHERE " . $this->whereCondition; |
|
| 213 | + $string = "UPDATE ".$this->table." SET ".$updateSet." WHERE ".$this->whereCondition; |
|
| 214 | 214 | return new Query($string, $this->binder); |
| 215 | 215 | } else { |
| 216 | - $string = "DELETE FROM " . $this->table . " WHERE " . $this->whereCondition; |
|
| 216 | + $string = "DELETE FROM ".$this->table." WHERE ".$this->whereCondition; |
|
| 217 | 217 | return new Query($string, $this->binder); |
| 218 | 218 | } |
| 219 | 219 | } |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | protected function sendMultipleFileByRange(Response $response, array $ranges) |
| 90 | 90 | { |
| 91 | - $separates = 'multiple_range_' . base64_encode(md5(uniqid(), true)); |
|
| 92 | - $response->setHeader('content-type', 'multipart/byteranges; boundary=' . $separates); |
|
| 91 | + $separates = 'multiple_range_'.base64_encode(md5(uniqid(), true)); |
|
| 92 | + $response->setHeader('content-type', 'multipart/byteranges; boundary='.$separates); |
|
| 93 | 93 | foreach ($ranges as $range) { |
| 94 | - $response->write('--' . $separates . "\r\n"); |
|
| 94 | + $response->write('--'.$separates."\r\n"); |
|
| 95 | 95 | $this->sendMultipleRangePart($response, $range); |
| 96 | 96 | $this->sendFileByRange($response, $range); |
| 97 | 97 | $response->write("\r\n"); |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | protected function sendMultipleRangePart(Response $response, array $range) |
| 140 | 140 | { |
| 141 | - $response->write('Content-Type: ' . $this->mime . "\r\n"); |
|
| 142 | - $response->write('Content-Range: ' . $this->getRangeHeader($range) . "\r\n\r\n"); |
|
| 141 | + $response->write('Content-Type: '.$this->mime."\r\n"); |
|
| 142 | + $response->write('Content-Range: '.$this->getRangeHeader($range)."\r\n\r\n"); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | $class = [$class]; |
| 102 | 102 | } |
| 103 | 103 | foreach ($class as $index => $className) { |
| 104 | - $class[$index] = $this->className($className) . '->onRequest'; |
|
| 104 | + $class[$index] = $this->className($className).'->onRequest'; |
|
| 105 | 105 | } |
| 106 | 106 | return $class; |
| 107 | 107 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | public function __construct(string $tableName, string $connection = 'default', bool $raw = false) |
| 27 | 27 | { |
| 28 | 28 | parent::__construct( |
| 29 | - $this->initStruct($tableName,$raw), |
|
| 29 | + $this->initStruct($tableName, $raw), |
|
| 30 | 30 | Database::getDataSource($connection), |
| 31 | 31 | $this); |
| 32 | 32 | } |
@@ -72,8 +72,8 @@ |
||
| 72 | 72 | 'context' => $this->context, |
| 73 | 73 | 'backtrace' => $throwable->getTrace(), |
| 74 | 74 | ]; |
| 75 | - $exceptionHash = md5($throwable->getFile() . $throwable->getLine() . $throwable->getCode()); |
|
| 76 | - $path = $dumpPath . '/' . microtime(true) . '.' . substr($exceptionHash, 0, 8) . '.json'; |
|
| 75 | + $exceptionHash = md5($throwable->getFile().$throwable->getLine().$throwable->getCode()); |
|
| 76 | + $path = $dumpPath.'/'.microtime(true).'.'.substr($exceptionHash, 0, 8).'.json'; |
|
| 77 | 77 | FileSystem::make($dumpPath); |
| 78 | 78 | FileSystem::put($path, json_encode( |
| 79 | 79 | new DebugObject($dumper), |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function loadVendorIfExist() |
| 28 | 28 | { |
| 29 | - $vendorAutoload = $this->application->getPath() . '/vendor/autoload.php'; |
|
| 29 | + $vendorAutoload = $this->application->getPath().'/vendor/autoload.php'; |
|
| 30 | 30 | if (FileSystem::exist($vendorAutoload)) { |
| 31 | 31 | Loader::requireOnce($vendorAutoload); |
| 32 | 32 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $group = $group ?? $request->getAttribute('group'); |
| 58 | 58 | $default = $default ?? $request->getAttribute('module'); |
| 59 | 59 | $url = $this->route->create($this->getRouteName($name, $default, $group), $parameter, $allowQuery); |
| 60 | - return $this->getUrlIndex($request) . ltrim($url, '/'); |
|
| 60 | + return $this->getUrlIndex($request).ltrim($url, '/'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | public function getUriBase(Request $request, bool $beautify = true): string |
| 90 | 90 | { |
| 91 | 91 | $index = $beautify ? $this->getUrlIndex($request) : $request->getIndex(); |
| 92 | - return $request->getUriBase() . $index; |
|
| 92 | + return $request->getUriBase().$index; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | protected function getRouteGroupPrefix(?string $group): string |
| 102 | 102 | { |
| 103 | - return $group === null || $group === 'default' ? '' : '@' . $group; |
|
| 103 | + return $group === null || $group === 'default' ? '' : '@'.$group; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | $prefixGroup = $this->getRouteGroupPrefix($group); |
| 140 | 140 | if ($module !== null && ($moduleObj = $this->find($module))) { |
| 141 | - return $moduleObj->getFullName() . $prefixGroup . ':' . $name; |
|
| 141 | + return $moduleObj->getFullName().$prefixGroup.':'.$name; |
|
| 142 | 142 | } |
| 143 | 143 | return $name; |
| 144 | 144 | } |
@@ -2,17 +2,17 @@ |
||
| 2 | 2 | $host = $argv[1] ?? '127.0.0.1:9501'; |
| 3 | 3 | list($ip, $port) = explode(':', $host); |
| 4 | 4 | |
| 5 | -defined('SUDA_APP') or define('SUDA_APP', __DIR__ . '/app'); |
|
| 6 | -defined('SUDA_DATA') or define('SUDA_DATA', __DIR__ . '/data'); |
|
| 7 | -defined('SUDA_SYSTEM') or define('SUDA_SYSTEM', __DIR__ . '/suda'); |
|
| 5 | +defined('SUDA_APP') or define('SUDA_APP', __DIR__.'/app'); |
|
| 6 | +defined('SUDA_DATA') or define('SUDA_DATA', __DIR__.'/data'); |
|
| 7 | +defined('SUDA_SYSTEM') or define('SUDA_SYSTEM', __DIR__.'/suda'); |
|
| 8 | 8 | defined('SUDA_PUBLIC') or define('SUDA_PUBLIC', __DIR__); |
| 9 | 9 | defined('SUDA_DEBUG') or define('SUDA_DEBUG', true); |
| 10 | 10 | defined('SUDA_DEBUG_LEVEL') or define('SUDA_DEBUG_LEVEL', 'debug'); |
| 11 | -defined('SUDA_APP_MANIFEST') or define('SUDA_APP_MANIFEST', SUDA_APP . '/manifest'); |
|
| 12 | -defined('SUDA_DEBUG_LOG_PATH') or define('SUDA_DEBUG_LOG_PATH', SUDA_DATA . '/logs'); |
|
| 11 | +defined('SUDA_APP_MANIFEST') or define('SUDA_APP_MANIFEST', SUDA_APP.'/manifest'); |
|
| 12 | +defined('SUDA_DEBUG_LOG_PATH') or define('SUDA_DEBUG_LOG_PATH', SUDA_DATA.'/logs'); |
|
| 13 | 13 | // 设置IP或者端口 |
| 14 | 14 | defined('SUDA_SWOOLE_IP') or define('SUDA_SWOOLE_IP', $ip); |
| 15 | 15 | defined('SUDA_SWOOLE_PORT') or define('SUDA_SWOOLE_PORT', $port); |
| 16 | 16 | |
| 17 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
| 18 | -require_once SUDA_SYSTEM . '/loader/swoole.php'; |
|
| 19 | 17 | \ No newline at end of file |
| 18 | +require_once __DIR__.'/vendor/autoload.php'; |
|
| 19 | +require_once SUDA_SYSTEM.'/loader/swoole.php'; |
|
| 20 | 20 | \ No newline at end of file |