如何获取对象的开始和结束日期DatePeriod?
$today = new \DateTime(date('Y-m-d')); // 2012-05-30
$period = new \DatePeriod($today, new \DateInterval('P1M'), 1);
$stats = new UsageStatistics($period);
class UsageStatistics
{
protected $period, $sentEmailCount, $autoSentEmailCount;
public function __construct(\DatePeriod $period)
{
$this->period = $period;
// Current logged in user and email repository
$user = $this->getUser();
$repo = $this->getEmailRepository();
// Get the start and end date for the given period
$startDate = ...
$endDate = ...
$result = $repo->getAllSentCount($user, $startDate, $endDate);
// Assigning object properties
}
public function getSentEmailCount() { …Run Code Online (Sandbox Code Playgroud) 在我的一个客户端生产服务器(Linux,Apache,PHP5)上,部分返回简单页面输出,仅返回给谷歌Chrome.
例如,我已经设置了简单的phpinfo页面,就像 <?php phpinfo(); ?>
当我http://192.168.1.1/phpinfo.php在IE或FireFox上调用该页面时,它很好地返回整个phpinfo页面.但是当我在最新的谷歌浏览器(第30页)中打开此页面时,它会在某些时候被切断.有时它是在1-2"屏幕"之后,当我点击F5时,它会重新加载更长的块 - 5-6"屏幕"长,但仍然不是全部.如果我再次按F5,它将返回2-3个"屏幕"长页,依此类推.
有什么想法这里的问题是什么?打开,关闭谷歌浏览器没有帮助.清理临时文件没有帮助.我没有更多的想法:(
编辑:添加了截图,以更清楚地演示此问题.
1)在Google Chrome中打开phpinfo页面:
你可以立即看到phpinfo的页面很短
2)滚动到底部,你可以看到它只是phpinfo页面的一部分

3)现在按F5重新加载第4页,你可以看到 - 页面现在要长得多

5)但仍然没有完整的PHP信息页面

6)此外,我在Google Chromes控制台中看到了这样的错误

7)这里是所有请求标题(发送/接收)

编辑2: 在FireFox页面中,几乎总是以整页加载,但并非总是如此.有时它也会被切断.与谷歌浏览器的区别仅在于FireFox页面的加载速度至少为90%.在Chrome中,我有时甚至会获得只有5%内容的页面.
我正在尝试安装 Wireshark。有一个 atk 包的依赖。我从网上下载了 atk-2.32.0。atk-2.32.0 只能由介子安装。
以下是我遵循的安装步骤。
../meson-0.50.0/meson.py _build .
>>However it is give this error:
>>"meson.build:97:0: ERROR: Subproject directory not found and glib.wrap
>>file not found."
Run Code Online (Sandbox Code Playgroud)
请帮助解决此问题。
我试过了:
SET @user = 'foo@localhost';
SET @pass = 'bar';
SET @sql = 'CREATE USER ? IDENTIFIED BY ?';
PREPARE stmt FROM $sql;
Run Code Online (Sandbox Code Playgroud)
我得到错误
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? IDENTIFIED BY ?'
Run Code Online (Sandbox Code Playgroud)
我还尝试了多种方法来定义变量,但还是没有运气。
SET @user = "'foo'@'localhost'";
SET @sql = 'CREATE USER ? IDENTIFIED BY ?';
Run Code Online (Sandbox Code Playgroud)
乃至
SET @user = 'foo';
SET @host = 'localhost';
SET @sql …Run Code Online (Sandbox Code Playgroud)