小编gse*_*ric的帖子

单个有界上下文的结构

有界上下文是否涵盖所有应用程序层(域,应用程序,演示文稿和基础架构)或仅域模型?例如,我应该使用以下结构:

<bc 1>
 |_ domain
 |_ application
 |_ presentation
 |_ infrastructure
<bc 2>
 |_ domain
 |_ application
 |_ presentation
 |_ infrastructure
Run Code Online (Sandbox Code Playgroud)

或以下:

domain
 |_ <bc 1>
 |_ <bc 2>
application
presentation
infrastructure
Run Code Online (Sandbox Code Playgroud)

domain-driven-design

16
推荐指数
1
解决办法
1461
查看次数

php://输入只能在PHP 5.6.16中读取一次

PHP手册指出使用php://输入支持查找操作打开的流,从PHP 5.6开始可以多次读取,但我无法使其工作.以下示例清楚地显示它不起作用:

<!DOCTYPE html>
<html>
<body>
<form method="post">
<input type="hidden" name="test_name" value="test_value">
<input type="submit">
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
    $input = fopen('php://input', 'r');
    echo 'First attempt: ' . fread($input, 1024) . '<br>';
    if (fseek($input, 0) != 0)
        exit('Seek failed');
    echo 'Second attempt: ' . fread($input, 1024) . '<br>';
}
?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

输出:

First attempt: test_name=test_value
Second attempt: 
Run Code Online (Sandbox Code Playgroud)

php://输入流是

  1. 成功阅读
  2. 成功回归(fseek成功)
  3. 阅读失败

难道我做错了什么?

php php-stream-wrappers

6
推荐指数
1
解决办法
2136
查看次数