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

终于把这个博客找回来🌶️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中定义转换成驼峰式,当表中没有这条记录时,会认为不存在驼峰式的字段属性,从而导致数据插入出错。
 
 iterm2
 expect 和zr sr不能同时用。想用sr zr的时候用ssh登陆远程服务器

 

posted @ 2019-01-30 19:13  zhuoyuzz  阅读(276)  评论(0编辑  收藏  举报