我有一个网页,上面有一个按钮,单击该按钮时会执行一个 php 函数。
当用户点击它时,返回一个页面需要51081ms。其中 51376 毫秒被我的 Firefox 开发人员工具中的“网络”选项卡归类为“等待”。
在我的 php.ini 文件中声明的 max_execution_time 是 30。我也可以在我的 phpinfo 文件中看到这一点。
我的问题是,为什么我的脚本在 30 秒后没有超时?max_execution_time 实际测量的是什么?
编辑以包含代码;
public function getSlotsByUser (Request $request) {
$event_id = $request->event_id;
$user_id = substr($request->user, 4);
$event = Event::find($event_id);
$user = User::find($user_id);
$slots = TimeSlot::where('event_id',$event_id)->get();
$userSlots = $user->slots;
foreach($userSlots as $userSlot) {
$guest = Guest::where('slot_id',$userSlot->id)->where('user_id',$user->id)->first();
if($guest) {
$userSlot->guest_id = $guest->id;
$userSlot->guest_name = $guest->name . ' ' . $guest->surname;
}
else {
$userSlot->guest_id = NULL;
$userSlot->guest_name = NULL;
}
$userSlotIds[] = $userSlot->id;
}
$days = new DatePeriod(
new DateTime($event->start_time),
new DateInterval('P1D'),
(new DateTime($event->end_time))->modify('+1 day')
);
return view('admin.calendar',compact('event','slots','user','userSlots','userSlotIds','days'));
}
我了解哪些部分代表使用 Eloquent 的查询。我的代码也是如此;
php执行
php执行
数据库查询
数据库查询
数据库查询
php执行...等等?
有人可以向我解释“引擎盖下”发生了什么吗?