-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 更新 swoole-ide 助手,使用完整命名协程函数替代短命名 * 更新 .gitignore * 添加 php-cs-fixer * 修复代码样式 * 修正返回值注释 * 使用 tmp 目录,避免各种权限问题 * 修正 demo 代码样式
- Loading branch information
Showing
30 changed files
with
518 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.idea | ||
/vendor | ||
*.lock | ||
*.log | ||
.gitignore | ||
.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'php_unit_dedicate_assert' => ['target' => '5.6'], | ||
'array_syntax' => ['syntax' => 'short'], | ||
'array_indentation' => true, | ||
'binary_operator_spaces' => [ | ||
'operators' => [ | ||
'=>' => 'align_single_space', | ||
], | ||
], | ||
'concat_space' => [ | ||
'spacing' => 'one', | ||
], | ||
'fopen_flags' => false, | ||
'protected_to_private' => false, | ||
'native_constant_invocation' => true, | ||
'combine_nested_dirname' => true, | ||
'single_quote' => true, | ||
'single_space_after_construct' => [ | ||
'constructs' => ['abstract', 'as', 'attribute', 'break', 'case', 'catch', 'class', 'clone', 'comment', 'const', 'const_import', 'continue', 'do', 'echo', 'else', 'elseif', 'extends', 'final', 'finally', 'for', 'foreach', 'function', 'function_import', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'match', 'named_argument', 'new', 'open_tag_with_echo', 'php_doc', 'php_open', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'throw', 'trait', 'try', 'use', 'use_lambda', 'use_trait', 'var', 'while', 'yield', 'yield_from'], | ||
], | ||
'braces' => [ | ||
'position_after_control_structures' => 'next', | ||
], | ||
'single_line_comment_style' => false, | ||
'phpdoc_to_comment' => false, | ||
'declare_strict_types' => true, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/src') | ||
->in(__DIR__ . '/demo') | ||
->append([__FILE__]) | ||
) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
require dirname(__DIR__) . '/vendor/autoload.php'; | ||
|
||
use Yurun\Swoole\SharedMemory\Server; | ||
|
||
$options = [ | ||
// 这个文件必须,而且不能是samba共享文件 | ||
'socketFile' => '/swoole-shared-memory.sock', | ||
'storeTypes' => [ | ||
'socketFile' => '/tmp/swoole-shared-memory.sock', | ||
'storeTypes' => [ | ||
\Yurun\Swoole\SharedMemory\Store\KV::class, | ||
\Yurun\Swoole\SharedMemory\Store\Stack::class, | ||
\Yurun\Swoole\SharedMemory\Store\Queue::class, | ||
\Yurun\Swoole\SharedMemory\Store\PriorityQueue::class, | ||
], | ||
]; | ||
$server = new Server($options); | ||
$server->run(); | ||
$server->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.