简介
本文主要通过代码前后改造对比来介绍laravel blade模板loop变量使用。
环境
- php > 5.6
- laravel > 5.3
Continue reading
例如:
[2017-10-22 10:13:57.833504] production.INFO: -- Startup {"method":"GET","uri":"/v1/stocks"} {"pid":7124,"line":"App\\Bootstrap\\ApplicationLog->startupLog:66"}
[2017-10-22 10:13:57.898702] production.INFO: get stocks info {"pid":7124,"line":"App\\Http\\Controllers\\StocksController->index:66"}
[2017-10-22 10:13:57.903274] production.INFO: -- Shutdown {"time":"70.371[ms]","memory":"2048[kb]"} {"pid":7124,"line":"App\\Bootstrap\\ApplicationLog->handleShutdownLog:81"}
例如
[2017-10-21 22:27:42] production.DEBUG: select count(*) as aggregate from `stocks_input` where `stocks_input`.`deleted_at` is null; {"time":0.55}
[2017-10-21 22:27:42] production.DEBUG: select * from `stocks_input` where `stocks_input`.`deleted_at` is null order by `created_at` desc limit 10 offset 0; {"time":0.84}
[2017-10-21 22:27:42] production.DEBUG: select * from `goods` where `goods`.`id` = 1 limit 1; {"time":0.74}
[2017-10-21 22:28:15] production.DEBUG: select * from `goods` where `goods`.`id` = 1 limit 1; {"time":0.76}
[2017-10-21 22:28:15] production.DEBUG: select * from `regions` where `regions`.`id` = 110102 limit 1; {"time":0.87}
[2017-10-21 22:28:15] production.DEBUG: select * from `regions` where `regions`.`id` = 110000 limit 1; {"time":0.81}
记录Application的开始和结束日志
– 开始日志: URL请求或命令行记录
– 结束日志: 处理时间和内存使用峰值记录
例如:
[2017-10-19 23:06:00] local.INFO: -- Startup {"command":"php artisan list"}
[2017-10-19 23:06:00] local.INFO: -- Shutdown {"time":"36.955[ms]","memory":"10[mb]"}
[2017-10-19 23:11:37] local.INFO: -- Startup {"method":"GET","uri":"/v1/stocks"}
[2017-10-19 23:11:37] local.INFO: -- Shutdown {"time":"21.765[ms]","memory":"4096[kb]"}
$oldrow = MyModel::find($id);
$newrow = $oldrow->replicate();
$newrow->some_column = 'new data';
$newrow->save();
基本使用到命令如上。
然而它是否如我们想像般工作的?