上路抗压,野爹常来
摘要: PHP7连接Mongo #PHP7连接mongo protected $conn = null; protected $database = null;//MongoDB数据库名 public function _initialize() { $this->conn = self::getMongo 阅读全文
posted @ 2021-05-25 16:12 上路抗压 阅读(130) 评论(0) 推荐(0) 编辑
摘要: ##config配置 /*redis链接*/ 'redis' => [ 'default' => [ 'type' => 'redis', 'debug' => true, 'hostname' => '127.0.0.1', 'port' => 6379, 'auth' => '', 'timeo 阅读全文
posted @ 2021-05-20 11:11 上路抗压 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 百度下载QueryList类库文件 /** * 抓取数据源 * @param $rules array 抓取规则 * @param $url string url * @return mixed */ function getQueryList($rules, $url) { $html = fil 阅读全文
posted @ 2021-04-23 10:15 上路抗压 阅读(97) 评论(0) 推荐(0) 编辑
摘要: //php获取指定范围内的日期 function periodDate($startDate, $endDate) { $startTime = strtotime($startDate); $endTime = strtotime($endDate); $arr = []; while ($sta 阅读全文
posted @ 2021-04-23 10:13 上路抗压 阅读(181) 评论(0) 推荐(0) 编辑
摘要: //获取两个日期之间相差天数 function diffBetweenTwoDays ($day1, $day2) { $second1 = strtotime($day1); $second2 = strtotime($day2); if ($second1 < $second2) { $tmp 阅读全文
posted @ 2021-04-23 10:12 上路抗压 阅读(319) 评论(0) 推荐(0) 编辑
摘要: //1、Unix时间戳转日期 function unixtime_to_date($unixtime, $timezone = 'PRC') { $datetime = new DateTime("@$unixtime"); //DateTime类的bug,加入@可以将Unix时间戳作为参数传入 $ 阅读全文
posted @ 2021-04-23 10:11 上路抗压 阅读(518) 评论(0) 推荐(0) 编辑
摘要: ES 功能类库 <?php /** * Created by PhpStorm. * User: Administrator * Date: 2021/4/2 * Time: 17:36 */ use Elasticsearch\ClientBuilder; class ES{ private $e 阅读全文
posted @ 2021-04-23 10:09 上路抗压 阅读(310) 评论(0) 推荐(0) 编辑
摘要: package com.example.demo.unity; import com.auth0.jwt.JWT;import com.auth0.jwt.algorithms.Algorithm;import com.example.demo.dao.Admin;import org.slf4j. 阅读全文
posted @ 2021-02-21 09:52 上路抗压 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1、生成JWT验证字符串 /** * 生成token * @param admin Object * @return String */public String getToken(Admin admin){ String token = ""; //JWT.create()创建token with 阅读全文
posted @ 2021-02-21 09:49 上路抗压 阅读(109) 评论(0) 推荐(0) 编辑
摘要: ##一、tp5.1安装workerman composer安装: composer require topthink/think-worker=2.0.* ##二、使用 使用自定义类作为worker入口服务类 在config中创建worker_server.php <?php // + // | W 阅读全文
posted @ 2021-02-21 09:45 上路抗压 阅读(1036) 评论(0) 推荐(0) 编辑