摘要: 1 class AlarmController 2 { 3 const VALID = 1; //有效 4 const INVALID = 0; //无效 5 6 /** 7 * @param array $data 8 * @return bool 9 */ 10 public functi... 阅读全文
posted @ 2017-05-03 20:09 spectrelb 阅读(249) 评论(0) 推荐(0) 编辑
摘要: https://www.epochconverter.com/ 阅读全文
posted @ 2017-05-03 19:32 spectrelb 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 官方文档:http://php.net/manual/zh/function.call-user-func.php 工作中遇到这样的业务,会有很大switch的判断,如下: 如果以后在加很多case,那么会变得可读性很差,为了扩展于是我这样想的 这样就省略了switch case, 想要添加,只需要 阅读全文
posted @ 2017-05-03 16:50 spectrelb 阅读(246) 评论(0) 推荐(0) 编辑
摘要: http://mp.weixin.qq.com/s/hbeye307DrNI8TOxud5uRA 阅读全文
posted @ 2017-05-02 18:34 spectrelb 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-05-02 15:53 spectrelb 阅读(238) 评论(0) 推荐(0) 编辑
摘要: del exists 1.字符串 set,get 2.列表 lRange lRem lPush rPush 3.有序列表 zadd zrem zscore 4.hash hset hget hdel 阅读全文
posted @ 2017-05-02 14:51 spectrelb 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 打开phpinfo() 看php版本是ts还是nts, 如上是ts版本的,所以需要安装redis的ts版本, redis的扩展下载地址 https://pecl.php.net/package/redis,根据自己的选择,选择对应的扩展, 下载好扩展后,把php_redis.dll 文件放入到本地, 阅读全文
posted @ 2017-05-02 12:02 spectrelb 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 打开phpinfo() 看php版本是ts还是nts, 如上是ts版本的,所以需要安装mongodb的ts版本, mongodb的扩展下载地址 https://pecl.php.net/package/mongodb,根据自己的选择,选择对应的扩展, 下载好扩展后,把php_mongodb.dll 阅读全文
posted @ 2017-05-02 11:55 spectrelb 阅读(1023) 评论(0) 推荐(0) 编辑
摘要: crontab -e 查看并且编辑定时脚本命令 每一分钟执行一次脚本,并且写入log */1 * * * * php /var/www/api/cron/Mission/setMeetingDone.php >> /var/log/cron_log/setMeetingDone rm -rf 删除文 阅读全文
posted @ 2017-05-02 11:21 spectrelb 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 链接 http://www.oschina.net/question/1779564_2143393 这是去除黄线 再去除灰色线 阅读全文
posted @ 2017-05-02 11:08 spectrelb 阅读(1596) 评论(0) 推荐(0) 编辑
摘要: git config -l 查看全局 git config --global alias.co checkout window下配置全局命令 git status git add git add git commit git pull git push git log -n10 查看前10条 git 阅读全文
posted @ 2017-05-02 10:57 spectrelb 阅读(158) 评论(0) 推荐(0) 编辑
摘要: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'desc, cr... 阅读全文
posted @ 2017-05-02 10:50 spectrelb 阅读(1166) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * 数组形式的原生sql 3 */ 4 public function arrayA(array $did) 5 { 6 $statement = $this->getEntityManager()->getConnection()->executeQuery(' 7 SELECT did, count(1) as num 8 FROM posit... 阅读全文
posted @ 2017-05-02 10:44 spectrelb 阅读(1073) 评论(0) 推荐(0) 编辑
摘要: 1 //得到当前毫秒时间戳 2 public function millStampTime() 3 { 4 list($tmp1, $tmp2) = explode(' ', microtime()); 5 return (float)sprintf('%.0f', (floatval($tmp1) + floatval($tmp2)) *... 阅读全文
posted @ 2017-05-02 10:36 spectrelb 阅读(3063) 评论(0) 推荐(0) 编辑
摘要: /** *生成随机指定长度的字符串 */ public static function stringGenerate($length){ $str = null; $strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789_abcdefghijklmnopqrstuvwxyz"; $max = strlen($strPol)-1; for($i=0;$i... 阅读全文
posted @ 2016-10-26 09:49 spectrelb 阅读(1604) 评论(0) 推荐(0) 编辑
摘要: http://mozilla.com.cn/thread-52722-1-1.html安装网页翻译插件 http://mozilla.com.cn/thread-52722-1-1.html安装网页翻译插件 symfony2是基于php的web框架 http://www.chrisyue.com/s 阅读全文
posted @ 2016-10-26 09:44 spectrelb 阅读(508) 评论(0) 推荐(0) 编辑