首页 > 其他 > 详细

踩坑一时爽,一直踩坑一直爽

时间:2019-01-30 19:32:39      阅读:137      评论:0      收藏:0      [点我收藏+]

终于把这个博客找回来???2333

 

把一直在有道云笔记零零散散记的东西在这里更新一份。

先从踩坑开始8??,毕竟坑踩多了才能成长!

 


20171212

redis使用set存数据,设置过期时间的单位是s(秒),pset的时间单位是ms(毫秒)


"permission deny"

linux系统报的这个错误基本都是权限问题。php业务log是由php-cgi生成的,所以文件所属用户是cgi用户。

项目中场景:

定时任务由root用户启动,生成的log文件是root用户所有,而php-cgi用户是deploy,导致业务日志写不进log。
解决方法,用deploy用户设置定时任务。

in_array()的第三个参数
in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool
needle

The searched value.

Note: 

If needle is a string, the comparison is done in a case-sensitive manner.

haystack

The array.

strict

If the third parameter strict is set to TRUE then the in_array() function will also check the types of the needle in the haystack.


Phalcon\Config::merge()会把没有key的数组合并,出现重复数据。(array_merge()同理)
 

事务transaction
务必commit,出错rollback

短信验证码防刷策略
包括发送和验证两个场景

property_exists在phalcon model中使用有个坑,数据库中存的是下划线分隔,model中定义转换成驼峰式,当表中没有这条记录时,会认为不存在驼峰式的字段属性,从而导致数据插入出错。
 
 
 

 

踩坑一时爽,一直踩坑一直爽

原文:https://www.cnblogs.com/92sunqing/p/10339490.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!