<?xml version='1.0' encoding='UTF-8'?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><title>yangweijie's blog</title><link>https://yangweijie.github.io/note</link><description>a blog with github issues</description><copyright>yangweijie's blog</copyright><docs>http://www.rssboard.org/rss-specification</docs><generator>python-feedgen</generator><image><url>https://github.githubassets.com/favicons/favicon.svg</url><title>avatar</title><link>https://yangweijie.github.io/note</link></image><lastBuildDate>Mon, 03 Aug 2026 02:40:44 +0000</lastBuildDate><managingEditor>yangweijie's blog</managingEditor><ttl>60</ttl><webMaster>yangweijie's blog</webMaster><item><title>关于AI 如何利用开源或者自己调教你的ai agent</title><link>https://yangweijie.github.io/note/post/guan-yu-AI%20-ru-he-li-yong-kai-yuan-huo-zhe-zi-ji-diao-jiao-ni-de-ai%20agent.html</link><description>- ai ide
  - phpstorm or jetbrans 
  - vscode
  - visual studio
  - xcode
  - zed
- ai cli agent
  -  opencode
  -  mimocode
  -  zcode 
- mcp
  - qoder-composer-use windows 上 在 `c:\Users\xxxx\.qoder\plugins\.cache\qoder-bundler\qoder-computer-use\QoderComputerUse.exe`。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/guan-yu-AI%20-ru-he-li-yong-kai-yuan-huo-zhe-zi-ji-diao-jiao-ni-de-ai%20agent.html</guid><pubDate>Sun, 21 Jun 2026 04:03:07 +0000</pubDate></item><item><title>关于导出优化</title><link>https://yangweijie.github.io/note/post/guan-yu-dao-chu-you-hua.html</link><description># 导出性能优化

## 导出的标准流程

1. 查询数据
2. 生成excel
3. 浏览器下载

## 导出遇到的问题

1. 时间过长 （未用索引、查询数据过大、查询次数过多）
2. 内存不够 （测试环境 和 生产环境差异）
3. 本地环境无扩展

## 解决思路

1. 不断优化sql，让查询次数尽量少
2. 优化代码逻辑，减少循环中套循环
3. mock excel生成

### 核心思想

让计算交给最快的处理者（DB、内存）来做

让计算只算一次 

## 案例

### 门店提货订单导出


#### 优化点:

- 去除无用的商品图片关联
- 商品分类和供应商 从查询所有订单后询换订单商品再一条条查询改为了关联商品预加载（N+1=&gt;1）
- 定义了远程关联
- 导出不走扩展 前端xlsx 生成execl

8000多个订单（1万多商品）全部导出由当初60s 降至 5.72s

### 数字福利平台大牌卡券导出



#### 优化点

- 写了一个基类提供 orderList 方法来获取数据 动态传入表名 order_type 且支持回调来跟改获取的字段
- `Extend/DB` 实现了 子查询 先debug 后获取 $db-&gt;last() 原始sql， 后 `selectInSubQuery` 查询时做替换
- 查询卡号时 不关联大表 app_merge_pay_order 来查询 先查询放入where 条件里 in 数组查询
- 将一些循环里的计算 放入 sql Db:raw 里 原生函数查询 如 `'total_fee_mch'  =&gt; DB::raw('CASE WHEN a.order_status=5 AND a.refund_status=1 THEN '0.00' WHEN d.edition = 1 THEN '0.00' WHEN a.total_fee_mch &gt; 0 THEN a.total_fee_mch ELSE a.pay_money END'),`
- 循环里的数据初始化值也放入sql 查询别名字段 `'balance'=&gt;DB::raw(''0''),`
- 去除循环判断 来取数据 改为先将 merge_pay_order 的数据按照 order_sn=&gt; 订单集合 固化为键值 数组，循环整个列表时直接获取
- 表加查询用字段如mch_id、 order_type、 order_sn等
31000个订单数据导出 优化前 257s 优化后 1.5s
- thinkphp6 以后默认模型返回结果集、Db返回数组，数据量大的查询用Db  12000行1.7s 立马变0.2秒 （7.4）

#### 内存方面

单次查询能解决 不需要多次查询组装的 用游标，比chunk 快（chunk将一次查询拆多次分页了）

需要多次查询组装的， 可以考虑多进程分文件写入 最后合并

## 思考

### PHP 处理大数组 给某个键 进行字符串格式化 快 还是 数据库快

如 有30000的数据 每个数据有时间戳create_time  循环30000次 date('Y-m-d H:i:s', $v['create_time'])
还是 查询结果集时 `'create_time'    =&gt; DB::raw('FROM_UNIXTIME(a.create_time)')`,字段计算快?

### 前端生成excel 快还是 后端扩展快？

### json 格式比较大 是否需要将数据压缩 gzip 或改为 ProtocolBuffer 传输更快

xlsx 单sheet 有上限

### 如何应对同条件导出多次？
缓存、 异步。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/guan-yu-dao-chu-you-hua.html</guid><pubDate>Tue, 24 Feb 2026 06:34:49 +0000</pubDate></item><item><title>建站白嫖系列</title><link>https://yangweijie.github.io/note/post/jian-zhan-bai-piao-xi-lie.html</link><description># 访问统计
## [不蒜子](https://www.busuanzi.cc/)
。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/jian-zhan-bai-piao-xi-lie.html</guid><pubDate>Sat, 23 Aug 2025 08:39:06 +0000</pubDate></item><item><title>替代扩展的php扩展库</title><link>https://yangweijie.github.io/note/post/ti-dai-kuo-zhan-de-php-kuo-zhan-ku.html</link><description>[Readme](https://github.com/symfony/polyfill/blob/1.x/README.md)&#13;
- symfony/polyfill-mbstring&#13;
- symfony/polyfill-iconv&#13;
- symfony/polyfill-ctype&#13;
- symfony/polyfill-apcu。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/ti-dai-kuo-zhan-de-php-kuo-zhan-ku.html</guid><pubDate>Sat, 05 Oct 2024 01:00:05 +0000</pubDate></item><item><title>logroate + cron + shell 切割nginx 日志</title><link>https://yangweijie.github.io/note/post/logroate%20%2B%20cron%20%2B%20shell%20-qie-ge-nginx%20-ri-zhi.html</link><description># logrotate 配置 在 `/etc/logrotate.d` 中 定义 nginx&#13;
~~~ conf&#13;
/home/wwwlogs/*log {&#13;
    daily&#13;
    rotate 7&#13;
    missingok&#13;
    notifempty&#13;
    compress&#13;
    dateext&#13;
    sharedscripts&#13;
    create 640 www www&#13;
    postrotate&#13;
    /usr/sbin/service nginx reload&#13;
    endscript&#13;
}&#13;
~~~&#13;
&#13;
在 /opt/中新建 logrotate-nginx.sh&#13;
~~~ shell&#13;
#!/bin/bash&#13;
#创建转储日志压缩存放目录&#13;
mkdir -p /home/wwwlogs/days&#13;
#手工对nginx日志进行切割转换&#13;
/usr/sbin/logrotate -vf /etc/logrotate.d/nginx&#13;
#当前时间&#13;
time=$(date -d 'yesterday' +'%Y-%m-%d')&#13;
#进入转储日志存放目录&#13;
cd /home/wwwlogs/days&#13;
#对目录中的转储日志文件的文件名进行统一转换&#13;
for i in $(ls ./ | grep '^\(.*\)\.[[:digit:]]$')&#13;
do&#13;
mv ${i} ./$(echo ${i}|sed -n 's/^\(.*\)\.\([[:digit:]]\)$/\1/p')-$(echo $time)&#13;
done&#13;
#对转储的日志文件进行压缩存放，并删除原有转储的日志文件，只保存压缩后的日志文件。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/logroate%20%2B%20cron%20%2B%20shell%20-qie-ge-nginx%20-ri-zhi.html</guid><pubDate>Wed, 07 Aug 2024 01:15:23 +0000</pubDate></item><item><title>php加密</title><link>https://yangweijie.github.io/note/post/php-jia-mi.html</link><description>~~~ shell&#13;
composer require phpseclib/phpseclib&#13;
~~~&#13;
# AES&#13;
&#13;
~~~ php&#13;
use phpseclib3\Crypt\AES;&#13;
&#13;
  # 加密&#13;
  $aesKey= md5(uniqid(rand(), true));&#13;
  $iv          = self::IV;&#13;
  // AES加密&#13;
  $aes = new AES('CBC');&#13;
  $aes-&gt;setKey($aesKey);&#13;
  $aes-&gt;setIV($iv);&#13;
  $dataJson = is_array($data) ? json_encode($data, JSON_THROW_ON_ERROR) : $data;&#13;
  $encode   = $aes-&gt;encrypt($dataJson);&#13;
  $encodeStr = strtoupper(bin2hex($encode));&#13;
&#13;
&#13;
  # 解密&#13;
  $iv          = self::IV;&#13;
  $data        = hex2bin(strtolower($data));&#13;
  // AES解密&#13;
  $aes = new AES('CBC');&#13;
  $aes-&gt;setKey($aesKey);&#13;
  $aes-&gt;setIV($iv);&#13;
  $encode = $aes-&gt;decrypt($data);&#13;
~~~&#13;
# RSA&#13;
~~~ php&#13;
# 加密&#13;
  public static function RsaEncode($publicKey, $data, $padding = RSA::ENCRYPTION_OAEP){&#13;
      $key = PublicKeyLoader::load(file_get_contents($publicKey), $password);&#13;
      $key-&gt;withPadding($padding);&#13;
      return base64_encode($key-&gt;encrypt($data));&#13;
  }&#13;
&#13;
  public static function RsaDecode($privateKey, $data, $padding = RSA::ENCRYPTION_OAEP){&#13;
      $key = PublicKeyLoader::load(file_get_contents($privateKey), $password);&#13;
      $key-&gt;withPadding($padding);&#13;
      return $key-&gt;decrypt(base64_decode($data));&#13;
  }&#13;
# 解密&#13;
~~~&#13;
&#13;
# SM3&#13;
&#13;
~~~ shell&#13;
composer require ch4o5/sm3-php&#13;
~~~&#13;
&#13;
~~~php&#13;
$sm3 = sm3('abc');&#13;
~~~&#13;
&#13;
# 证书转换&#13;
有的时候客户发的是p12 证书 可以去[网站](https://myssl.com/cert_convert.html) 上转换&#13;
。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/php-jia-mi.html</guid><pubDate>Tue, 30 Jul 2024 02:00:34 +0000</pubDate></item><item><title>cygwin  php7.4 和swoole</title><link>https://yangweijie.github.io/note/post/cygwin%20%20php7.4%20-he-swoole.html</link><description>先手动最小化d盘装一遍 cygwin64 然后将其重命名cygwin642


下载 [网盘](https://www.yunzhongzhuan.com/#sharefile=PUNA75rL_4607214)中的压缩包 解压至d 或其他非C 盘的根目录

压缩包里的用户名是Administrator 如果 当前机器用户不是，就手动将home/Administrator 改为自己用户，然后 双击开始菜单里的Cygwin64 Terminal 进入，将 /usr/bin 下的composer74s.bat 里d 改为实际判断（已经是d 无需更改）。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/cygwin%20%20php7.4%20-he-swoole.html</guid><pubDate>Tue, 14 May 2024 05:49:36 +0000</pubDate></item><item><title>php 中文文件名下载</title><link>https://yangweijie.github.io/note/post/php%20-zhong-wen-wen-jian-ming-xia-zai.html</link><description>两种&#13;
&#13;
1. 文件名转gbk&#13;
``` php&#13;
        $text = '2024年4月15日商品导出';&#13;
        $filename = mb_convert_encoding($text, 'GBK',  'UTF-8').'.txt';   // a filename in Chinese characters&#13;
        header('Content-Type: application/octet-stream');&#13;
        header('Content-Disposition: filename='.$filename);&#13;
        readfile(realpath('../think'));&#13;
        exit();&#13;
```&#13;
2. urlencode &#13;
&#13;
  ``` php&#13;
        $filename = '2024年4月5日中文文件名.txt';   // a filename in Chinese characters&#13;
        $contentDispositionField = 'Content-Disposition: attachment; '&#13;
            . sprintf('filename='%s'; ', rawurlencode($filename))&#13;
            . sprintf('filename*=utf-8''%s', rawurlencode($filename));&#13;
        header('Content-Type: application/octet-stream');&#13;
        header($contentDispositionField);&#13;
        readfile(realpath('../think'));&#13;
        exit();&#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/php%20-zhong-wen-wen-jian-ming-xia-zai.html</guid><pubDate>Wed, 08 May 2024 07:01:40 +0000</pubDate></item><item><title>2024春节成就</title><link>https://yangweijie.github.io/note/post/2024-chun-jie-cheng-jiu.html</link><description>1. 新建企业微信个人公司'jay的实验室' 15262980903 &#13;
2. 安装开心电视6.0 连接峰米投影 发现未root&#13;
3. 装win11 ltsc 泄露版 发现硬盘卡 第二天中毒了，不推荐使用&#13;
4. 将小主机换成unraid， 成功开心版，EFI 目录要去掉~符才可引导&#13;
5. 成功装x86 版网心云，并迁移车工&#13;
6. 装了win7 x86虚拟机，成功pae 支持16g内存。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/2024-chun-jie-cheng-jiu.html</guid><pubDate>Thu, 08 Feb 2024 09:58:09 +0000</pubDate></item><item><title>微信小程序安全域名</title><link>https://yangweijie.github.io/note/post/wei-xin-xiao-cheng-xu-an-quan-yu-ming.html</link><description>[Tutorial: WebSocket 升级指引（Web &amp; 小程序）](https://web.sdk.qcloud.com/im/doc/zh-cn/tutorial-02-upgradeguideline.html)&#13;
&#13;
2、小程序接入，更改受信域名&#13;
小程序使用前，需要将以下域名设为受信域名（已有的 im 受信域名可以都删掉）：&#13;
&#13;
wss://wss.im.qcloud.com&#13;
wss://wss.tim.qq.com&#13;
https://web.sdk.qcloud.com&#13;
https://webim.tim.qq.com&#13;
https://api.im.qcloud.com&#13;
将以下域名添加到 downloadFile 合法域名：&#13;
&#13;
https://cos.ap-shanghai.myqcloud.com&#13;
https://cos.ap-shanghai.tencentcos.cn&#13;
https://cos.ap-guangzhou.myqcloud.com&#13;
将以下域名添加到 uploadFile 合法域名：&#13;
&#13;
https://cos.ap-shanghai.myqcloud.com&#13;
https://cos.ap-shanghai.tencentcos.cn&#13;
https://cos.ap-guangzhou.myqcloud.com。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/wei-xin-xiao-cheng-xu-an-quan-yu-ming.html</guid><pubDate>Fri, 20 Oct 2023 08:15:28 +0000</pubDate></item><item><title>laravel- 支持phpstorm打开</title><link>https://yangweijie.github.io/note/post/laravel-%20-zhi-chi-phpstorm-da-kai.html</link><description>http://localhost:63342/api/file/?file=%file&amp;line=%line&#13;
&#13;
需要phpstorm 装 ide-remote-control 插件&#13;
&#13;
https://plugins.jetbrains.com/plugin/19991-ide-remote-control。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/laravel-%20-zhi-chi-phpstorm-da-kai.html</guid><pubDate>Thu, 27 Apr 2023 03:45:49 +0000</pubDate></item><item><title>smartgit-win 破解</title><link>https://yangweijie.github.io/note/post/smartgit-win%20-po-jie.html</link><description>最近用windows 开发了，smartgit 破解不了。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/smartgit-win%20-po-jie.html</guid><pubDate>Fri, 31 Mar 2023 01:08:46 +0000</pubDate></item><item><title>镇江求职渠道</title><link>https://yangweijie.github.io/note/post/zhen-jiang-qiu-zhi-qu-dao.html</link><description>- boss 直聘&#13;
- 0511。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zhen-jiang-qiu-zhi-qu-dao.html</guid><pubDate>Thu, 01 Sep 2022 07:55:35 +0000</pubDate></item><item><title>java Xstream 生成 属性和值同时存在的 xml</title><link>https://yangweijie.github.io/note/post/java%20Xstream%20-sheng-cheng-%20-shu-xing-he-zhi-tong-shi-cun-zai-de-%20xml.html</link><description>xstream 基本用法是对应类对象 转为xml&#13;
但是 不支持  `&lt;a href=''&gt;aa&lt;/a&gt;`  这种(我需要的是&lt;p&gt;&lt;img wi=''/&gt;&lt;/p&gt;)。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/java%20Xstream%20-sheng-cheng-%20-shu-xing-he-zhi-tong-shi-cun-zai-de-%20xml.html</guid><pubDate>Thu, 04 Nov 2021 05:56:50 +0000</pubDate></item><item><title>java alieasysdk 扫码支付</title><link>https://yangweijie.github.io/note/post/java%20alieasysdk%20-sao-ma-zhi-fu.html</link><description>官方api里 pc.trade.pay 默认生成的是form 表单，不是原来php端支持的iframe 嵌入二维码的字符串返回，需要手动构建。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/java%20alieasysdk%20-sao-ma-zhi-fu.html</guid><pubDate>Tue, 12 Oct 2021 08:58:12 +0000</pubDate></item><item><title>phpword 合并单元格的坑</title><link>https://yangweijie.github.io/note/post/phpword%20-he-bing-dan-yuan-ge-de-keng.html</link><description>今天发现以前合并单元格并没有生效，经过研究发现已下结论：&#13;
&#13;
- 表格的样式宽度支持四种 NIL、TWIP、AUTO、PERCENT 分别代表无宽度、TWIP word基本单位、自动、百分比&#13;
- 百分比是 1% 代表50份 TWIP&#13;
- 合并单元格，并不会自动实现自动宽度，比如两行三列单元格， 合并第一行前两列，最终得到的是第一行两个cell，第一个cell和原第一个cell宽度相等&#13;
- 如果想要合并单元格 且保证最终合并单元格 的宽度和我们想要的宽度一致，唯一的办法是设置表格宽度后，给每行里的每个单元格设置宽度, 如果设置百分比， 总table 占文档100% 设为5000，然后按照每个单元格自己想要的百分比去设置N*50&#13;
- 合并单元格是通过设置cell的样式实现`['gridSpan' =&gt; 2, 'valign' =&gt; 'center']`&#13;
&#13;
``` 官方示例&#13;
/*&#13;
 *  3. colspan (gridSpan) and rowspan (vMerge)&#13;
 *  ---------------------&#13;
 *  |     |   B    |    |&#13;
 *  |  A  |--------|  E |&#13;
 *  |     | C |  D |    |&#13;
 *  ---------------------&#13;
 */&#13;
&#13;
$section-&gt;addPageBreak();&#13;
$section-&gt;addText('Table with colspan and rowspan', $header);&#13;
&#13;
$fancyTableStyle = array('borderSize' =&gt; 6, 'borderColor' =&gt; '999999');&#13;
$cellRowSpan = array('vMerge' =&gt; 'restart', 'valign' =&gt; 'center', 'bgColor' =&gt; 'FFFF00');&#13;
$cellRowContinue = array('vMerge' =&gt; 'continue');&#13;
$cellColSpan = array('gridSpan' =&gt; 2, 'valign' =&gt; 'center');&#13;
$cellHCentered = array('alignment' =&gt; \PhpOffice\PhpWord\SimpleType\Jc::CENTER);&#13;
$cellVCentered = array('valign' =&gt; 'center');&#13;
&#13;
$spanTableStyleName = 'Colspan Rowspan';&#13;
$phpWord-&gt;addTableStyle($spanTableStyleName, $fancyTableStyle);&#13;
$table = $section-&gt;addTable($spanTableStyleName);&#13;
&#13;
$table-&gt;addRow();&#13;
&#13;
$cell1 = $table-&gt;addCell(2000, $cellRowSpan);&#13;
$textrun1 = $cell1-&gt;addTextRun($cellHCentered);&#13;
$textrun1-&gt;addText('A');&#13;
$textrun1-&gt;addFootnote()-&gt;addText('Row span');&#13;
&#13;
$cell2 = $table-&gt;addCell(4000, $cellColSpan);&#13;
$textrun2 = $cell2-&gt;addTextRun($cellHCentered);&#13;
$textrun2-&gt;addText('B');&#13;
$textrun2-&gt;addFootnote()-&gt;addText('Column span');&#13;
&#13;
$table-&gt;addCell(2000, $cellRowSpan)-&gt;addText('E', null, $cellHCentered);&#13;
&#13;
$table-&gt;addRow();&#13;
$table-&gt;addCell(null, $cellRowContinue);&#13;
$table-&gt;addCell(2000, $cellVCentered)-&gt;addText('C', null, $cellHCentered);&#13;
$table-&gt;addCell(2000, $cellVCentered)-&gt;addText('D', null, $cellHCentered);&#13;
$table-&gt;addCell(null, $cellRowContinue);&#13;
&#13;
&#13;
```&#13;
自己做的&#13;
```&#13;
$table = new Table(array(&#13;
            'borderSize'  =&gt; 6,&#13;
            'borderColor' =&gt; 'black',&#13;
            'width'       =&gt; 5000,&#13;
            'unit'        =&gt; TblWidth::PERCENT,&#13;
            'align'      =&gt; 'center',&#13;
        ));&#13;
&#13;
        $header_style = [&#13;
            'bold' =&gt; true,&#13;
            'size' =&gt; 9&#13;
        ];&#13;
        $paragraphStyle = [&#13;
            'align'=&gt;'center',&#13;
        ];&#13;
        $fontStyle = [&#13;
            'size'  =&gt; 9,&#13;
        ];&#13;
        $table-&gt;addRow();&#13;
        $table-&gt;addCell(39*50)-&gt;addText('名称', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(3*50)-&gt;addText('申请号', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(3*50)-&gt;addText('类型', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(14*50)-&gt;addText('缴费年份', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(26*50)-&gt;addText('缴纳年费日期范围', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(3*50)-&gt;addText('年费', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(10*50)-&gt;addText('滞纳金', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(6*50)-&gt;addText('滞纳金绝限日', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(6*50)-&gt;addText('维护费', $header_style, $paragraphStyle);&#13;
        $total = 0;&#13;
        if($cases){&#13;
            foreach($cases as $key=&gt;&amp;$value){&#13;
                $table-&gt;addRow();&#13;
                $table-&gt;addCell(39*50)-&gt;addText($value['name'], $fontStyle);&#13;
                $table-&gt;addCell(3*50)-&gt;addText($value['apply_no'], $fontStyle);&#13;
                $table-&gt;addCell(3*50)-&gt;addText($value['type'], $fontStyle);&#13;
                $table-&gt;addCell(14*50)-&gt;addText($value['to_year'], $fontStyle);&#13;
                $table-&gt;addCell(26*50)-&gt;addText($value['year_fee_area'], $fontStyle);&#13;
                $table-&gt;addCell(3*50)-&gt;addText((int)$value['year_fee'], $fontStyle);&#13;
                $table-&gt;addCell(10*50)-&gt;addText((int)$value['late_fee'], $fontStyle);&#13;
                $table-&gt;addCell(6*50)-&gt;addText($value['late_fee_end'], $fontStyle);&#13;
                $table-&gt;addCell(6*50)-&gt;addText($value['service_price'], $fontStyle);&#13;
                $total+= (int)($value['year_fee'] + (int)$value['late_fee'] + (int)$value['service_price']);&#13;
            }&#13;
        }&#13;
        $table-&gt;addRow();&#13;
        $table-&gt;addCell(94*50, ['valign'=&gt;'center', 'gridSpan' =&gt; 8, 'unit'=&gt;'pct'])-&gt;addText('合计', $header_style, $paragraphStyle);&#13;
        $table-&gt;addCell(6*50, ['unit'=&gt;'pct'])-&gt;addText($total, $header_style, $paragraphStyle);&#13;
        $templateProcessor-&gt;setComplexBlock('table', $table);&#13;
```&#13;
从而实现了动态生成word中带合并单元格（汇总统计）的功能&#13;
&#13;
![Dingtalk_20210303202156](https://user-images.githubusercontent.com/1614114/109805637-add32c80-7c5e-11eb-980c-dfc3a4c17065.jpg)&#13;
&#13;
&#13;
&gt;参考官方sample Sample_09_Tables.php&#13;
&gt; 如果模板文档里有多个同名的变量， 需要`$templateProcessor-&gt;setComplexValue('company', new Text($config['company']));&#13;
        $templateProcessor-&gt;setComplexValue('company', new Text($config['company']));`  多次&#13;
&#13;
。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/phpword%20-he-bing-dan-yuan-ge-de-keng.html</guid><pubDate>Wed, 03 Mar 2021 12:50:32 +0000</pubDate></item><item><title>springboot整合validation统一参数检查</title><link>https://yangweijie.github.io/note/post/springboot-zheng-he-validation-tong-yi-can-shu-jian-cha.html</link><description>&#13;
&#13;
# 1.背景&#13;
﻿&#13;
实际开发中对参数进行检查,是常见&#13;
﻿&#13;
比如如下代码&#13;
﻿&#13;
~~~&#13;
/**&#13;
     * 参数检查测试(传统做法)&#13;
     *&#13;
     * @param dto&#13;
     * @return&#13;
     */&#13;
    @GetMapping('/paramCheckOld')&#13;
    public BaseResponse paramCheckOld(@RequestBody UserDTO dto) {&#13;
        // 参数检查&#13;
        if (StrUtil.isEmpty(dto.getWeChat())) {&#13;
            return ResponseBuilder.failed('微信号为空');&#13;
        }&#13;
        if (StrUtil.isEmpty(dto.getName())) {&#13;
            return ResponseBuilder.failed('姓名为空');&#13;
        }&#13;
﻿&#13;
        if (dto.getStatus() != null&#13;
                || dto.getStatus() != -1&#13;
                || dto.getStatus() != 0&#13;
                || dto.getStatus() != 1) {&#13;
            return ResponseBuilder.failed('状态为-1,0,1或者null');&#13;
        }&#13;
        // .....如果参数很多这里必然后崩溃..........&#13;
        // 调用业务方法&#13;
        // 响应结果&#13;
        System.out.println('dto=' + dto);&#13;
        return ResponseBuilder.success('统一参数检查.....');&#13;
    }&#13;
~~~&#13;
﻿&#13;
&#13;
﻿&#13;
但是正确的做法应该是,这里其实只使用了一个@Validated注解就搞定了,太方便了.....&#13;
﻿&#13;
&#13;
﻿&#13;
~~~&#13;
 /**&#13;
     * 统一参数检查(牛逼的做法)&#13;
     *&#13;
     * @param dto&#13;
     * @return&#13;
     */&#13;
    @GetMapping('/paramCheck')&#13;
    public BaseResponse paramCheck(@RequestBody @Validated UserDTO dto) {&#13;
        // 参数检查(已检查)&#13;
        // 调用业务方法&#13;
        // 响应结果&#13;
        System.out.println('dto=' + dto);&#13;
        return ResponseBuilder.success('统一参数检查.....');&#13;
    }&#13;
~~~&#13;
﻿&#13;
&#13;
﻿&#13;
# 2.步骤&#13;
﻿&#13;
步骤一:引入jar包&#13;
﻿&#13;
~~~&#13;
 &lt;!--  统一参数校验--&gt;&#13;
        &lt;dependency&gt;&#13;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;&#13;
            &lt;artifactId&gt;spring-boot-starter-validation&lt;/artifactId&gt;&#13;
        &lt;/dependency&gt;&#13;
~~~&#13;
﻿&#13;
步骤二:参数上贴标签&#13;
﻿&#13;
&#13;
﻿&#13;
~~~&#13;
package com.ldp.user.entity.dto;&#13;
﻿&#13;
import com.ldp.user.common.validation.EnumValue;&#13;
import lombok.Data;&#13;
﻿&#13;
import javax.validation.constraints.NotBlank;&#13;
﻿&#13;
/**&#13;
 * @author 姿势帝-博客园&#13;
 * @address https://www.cnblogs.com/newAndHui/&#13;
 * @WeChat 851298348&#13;
 * @create 01/01 4:00&#13;
 * @description&#13;
 */&#13;
@Data&#13;
public class UserDTO {&#13;
    @NotBlank(message = '微信号不能为空')&#13;
    private String weChat;&#13;
﻿&#13;
    @NotBlank(message = '姓名不能为空')&#13;
    private String name;&#13;
    /**&#13;
     * 年龄&#13;
     */&#13;
    private Integer age;&#13;
    /**&#13;
     * 状态&#13;
     * -1:冻结用户 ,0:正常用户, 1:没有实名认证&#13;
     */&#13;
    @EnumValue(intValues = {-1, 0, 1}, message = '状态为-1,0,1或者null')&#13;
    private Integer status;&#13;
    /**&#13;
     * 地址&#13;
     */&#13;
    private String address;&#13;
}&#13;
~~~&#13;
﻿&#13;
&#13;
﻿&#13;
步骤三:控制层方法上贴标签(当然在其他方法上也可以用的,只是一般我们用在控制层上)&#13;
﻿&#13;
﻿&#13;
~~~&#13;
/**&#13;
     * 统一参数检查(牛逼的做法)&#13;
     *&#13;
     * @param dto&#13;
     * @return&#13;
     */&#13;
    @GetMapping('/paramCheck')&#13;
    public BaseResponse paramCheck(@RequestBody @Validated UserDTO dto) {&#13;
        // 参数检查(已检查)&#13;
        // 调用业务方法&#13;
        // 响应结果&#13;
        System.out.println('dto=' + dto);&#13;
        return ResponseBuilder.success('统一参数检查.....');&#13;
    }&#13;
~~~&#13;
﻿&#13;
﻿&#13;
步骤四:统一参数检查不通过时提示消息获取&#13;
﻿&#13;
﻿&#13;
~~~&#13;
  /**&#13;
     * 参数异常捕获&#13;
     *&#13;
     * @param ex&#13;
     * @return&#13;
     */&#13;
    @ResponseBody&#13;
    @ExceptionHandler(value = ConstraintViolationException.class)&#13;
    public Object constraintViolationExceptionHandler(ConstraintViolationException ex) {&#13;
        Set&lt;ConstraintViolation&lt;?&gt;&gt; constraintViolations = ex.getConstraintViolations();&#13;
        Iterator&lt;ConstraintViolation&lt;?&gt;&gt; iterator = constraintViolations.iterator();&#13;
        List&lt;String&gt; msgList = new ArrayList&lt;&gt;();&#13;
        while (iterator.hasNext()) {&#13;
            ConstraintViolation&lt;?&gt; cvl = iterator.next();&#13;
            msgList.add(cvl.getMessageTemplate());&#13;
        }&#13;
        return ResponseBuilder.failed(msgList.toString());&#13;
    }&#13;
﻿&#13;
    @ExceptionHandler(BindException.class)&#13;
    @ResponseBody&#13;
    public Object getBindException(BindException ex) {&#13;
        List&lt;ObjectError&gt; objectErrors = ex.getBindingResult().getAllErrors();&#13;
        if (!CollectionUtils.isEmpty(objectErrors)) {&#13;
            StringBuilder msgBuilder = new StringBuilder();&#13;
            for (ObjectError objectError : objectErrors) {&#13;
                msgBuilder.append(objectError.getDefaultMessage()).append(',');&#13;
            }&#13;
            String errorMessage = msgBuilder.toString();&#13;
            if (errorMessage.length() &gt; 1) {&#13;
                errorMessage = errorMessage.substring(0, errorMessage.length() - 1);&#13;
            }&#13;
            return ResponseBuilder.failed(errorMessage);&#13;
        }&#13;
        return ResponseBuilder.failed(ex.getMessage());&#13;
    }&#13;
~~~&#13;
﻿&#13;
﻿&#13;
步骤五测试&#13;
﻿&#13;
﻿&#13;
~~~&#13;
  @Test&#13;
    void paramCheck() {&#13;
        String url = urlLocal + '/userOrder/paramCheck';&#13;
        System.out.println('请求地址:' + url);&#13;
        HttpRequest request = HttpUtil.createRequest(Method.GET, url);&#13;
        Map&lt;String, Object&gt; map = new TreeMap&lt;&gt;();&#13;
        // 业务参数&#13;
      //  map.put('weChat', '851298348');&#13;
       // map.put('name', '李东平');&#13;
        map.put('age', '18');&#13;
        map.put('status', '0');&#13;
        map.put('address', '四川成都');&#13;
﻿&#13;
        // 公用参数&#13;
        map.put('appid', '1001');&#13;
        map.put('sequenceId', 'seq' + System.currentTimeMillis());&#13;
        map.put('timeStamp', System.currentTimeMillis());&#13;
        map.put('sign', signApi(map, '123456'));&#13;
        String param = JSON.toJSONString(map);&#13;
        request.body(param);&#13;
        System.out.println('请求参数:' + param);&#13;
        request.header('Authorization', token);&#13;
        request.setConnectionTimeout(60 * 1000);&#13;
        String response = request.execute().body();&#13;
        System.out.println('请求结果:' + response);&#13;
    }&#13;
~~~&#13;
﻿&#13;
﻿&#13;
测试结果:&#13;
﻿&#13;
~~~&#13;
{'message':'微信号不能为空,姓名不能为空','code':900}&#13;
~~~&#13;
﻿&#13;
# 3.常用检查规则注解&#13;
﻿&#13;
![](https://img2020.cnblogs.com/blog/858186/202101/858186-20210101170015191-387263373.png)&#13;
﻿&#13;
﻿&#13;
~~~&#13;
JSR提供的校验注解：         &#13;
@Null   被注释的元素必须为 null    &#13;
@NotNull    被注释的元素必须不为 null    &#13;
@AssertTrue     被注释的元素必须为 true    &#13;
@AssertFalse    被注释的元素必须为 false    &#13;
@Min(value)     被注释的元素必须是一个数字，其值必须大于等于指定的最小值    &#13;
@Max(value)     被注释的元素必须是一个数字，其值必须小于等于指定的最大值    &#13;
@DecimalMin(value)  被注释的元素必须是一个数字，其值必须大于等于指定的最小值    &#13;
@DecimalMax(value)  被注释的元素必须是一个数字，其值必须小于等于指定的最大值    &#13;
@Size(max=, min=)   被注释的元素的大小必须在指定的范围内    &#13;
@Digits (integer, fraction)     被注释的元素必须是一个数字，其值必须在可接受的范围内    &#13;
@Past   被注释的元素必须是一个过去的日期    &#13;
@Future     被注释的元素必须是一个将来的日期    &#13;
@Pattern(regex=,flag=)  被注释的元素必须符合指定的正则表达式    &#13;
﻿&#13;
﻿&#13;
Hibernate Validator提供的校验注解：  &#13;
@NotBlank(message =)   验证字符串非null，且trim后长度必须大于0    &#13;
@Email  被注释的元素必须是电子邮箱地址    &#13;
@Length(min=,max=)  被注释的字符串的大小必须在指定的范围内    &#13;
@NotEmpty   被注释的字符串的必须非空    &#13;
@Range(min=,max=,message=)  被注释的元素必须在合适的范围内&#13;
~~~&#13;
﻿&#13;
﻿&#13;
# 4.自定义检查规则注解&#13;
﻿&#13;
如果这些注解还不能满足我们的需求,那么我么可以自己定义满足自己业务规则的注解&#13;
﻿&#13;
这里以自定义一个枚举值检查的注解,这个在实际生产中用的非常普遍&#13;
﻿&#13;
比如在传入用户状态时,只嗯传入-1,0,1或者null,其都是参数不合法的检查注解&#13;
﻿&#13;
[https://www.cnblogs.com/newAndHui/p/14185807.html](https://www.cnblogs.com/newAndHui/p/14185807.html)&#13;
﻿&#13;
# 完美!。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/springboot-zheng-he-validation-tong-yi-can-shu-jian-cha.html</guid><pubDate>Thu, 07 Jan 2021 02:35:01 +0000</pubDate></item><item><title>sql查看mysql中各数据库大小</title><link>https://yangweijie.github.io/note/post/sql-cha-kan-mysql-zhong-ge-shu-ju-ku-da-xiao.html</link><description>用SQL命令查看Mysql数据库大小&#13;
要想知道每个数据库的大小的话，步骤如下：&#13;
&#13;
1、进入information_schema 数据库（存放了其他的数据库的信息）&#13;
&#13;
`use information_schema;`&#13;
&#13;
2、查询所有数据的大小：&#13;
&#13;
`select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;`&#13;
&#13;
3、查看指定数据库的大小：&#13;
&#13;
比如查看数据库home的大小&#13;
&#13;
`select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home';`&#13;
&#13;
4、查看指定数据库的某个表的大小&#13;
&#13;
比如查看数据库home中 members 表的大小&#13;
&#13;
`select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home' and table_name='members';`。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/sql-cha-kan-mysql-zhong-ge-shu-ju-ku-da-xiao.html</guid><pubDate>Thu, 05 Nov 2020 06:11:32 +0000</pubDate></item><item><title>Linux找回缺少的命令</title><link>https://yangweijie.github.io/note/post/Linux-zhao-hui-que-shao-de-ming-ling.html</link><description>在操作Linux 系统时，往往会误删除一部分文件或者移除软件时将依赖的系统包个删除掉，而当时未发现。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Linux-zhao-hui-que-shao-de-ming-ling.html</guid><pubDate>Thu, 25 Jun 2020 02:55:08 +0000</pubDate></item><item><title>windows 2019 ltsc 激活</title><link>https://yangweijie.github.io/note/post/windows%202019%20ltsc%20-ji-huo.html</link><description>```&#13;
slmgr -ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D&#13;
slmgr -skms kms.03k.org&#13;
slmgr -ato&#13;
slmgr -dlv&#13;
```&#13;
不知道什么时候失效，且用且珍惜。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/windows%202019%20ltsc%20-ji-huo.html</guid><pubDate>Wed, 15 Apr 2020 23:32:30 +0000</pubDate></item><item><title>【Windows】自带提权的bat脚本</title><link>https://yangweijie.github.io/note/post/%E3%80%90Windows%E3%80%91-zi-dai-ti-quan-de-bat-jiao-ben.html</link><description>Windows下的开发不可避免的会用到bat脚本来做一些重复的工作，尤其是需要注册的插件dll这块。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/%E3%80%90Windows%E3%80%91-zi-dai-ti-quan-de-bat-jiao-ben.html</guid><pubDate>Sat, 01 Feb 2020 09:38:18 +0000</pubDate></item><item><title>阿里云系统盘扩容</title><link>https://yangweijie.github.io/note/post/a-li-yun-xi-tong-pan-kuo-rong.html</link><description>0.如果yum出问题则更换aliyun的源&#13;
cd /etc/yum.repos.d&#13;
mv CentOS-Base.repo CentOS-Base.repo.bak&#13;
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo&#13;
&#13;
1.安装软件&#13;
yum install cloud-utils-growpart&#13;
yum install xfsprogs&#13;
&#13;
2.Check磁盘&#13;
df -h&#13;
fdisk -l&#13;
&#13;
3.执行（根据阿里云硬盘特性，参数为1 vda1为系统盘）&#13;
growpart /dev/[设备] 1 (sda)   如果这个命令报错了，可执行LANG=en_US.UTF-8命令&#13;
growpart /dev/vda 1&#13;
4.更新&#13;
resize2fs /dev/[分区] (sda1)&#13;
resize2fs /dev/vda1&#13;
5.完成确认&#13;
df -h&#13;
reboot。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/a-li-yun-xi-tong-pan-kuo-rong.html</guid><pubDate>Mon, 20 Jan 2020 04:55:01 +0000</pubDate></item><item><title>阿里云扩容</title><link>https://yangweijie.github.io/note/post/a-li-yun-kuo-rong.html</link><description>0.Check以下&#13;
fdisk -l&#13;
&#13;
1.检查数据&#13;
fdisk -lu /dev/[disk] (sdb)   &#13;
确定是否mbr&#13;
&#13;
fdisk -lu /dev/vdb &#13;
&#13;
&#13;
2.卸载挂载，如果挂载了的话&#13;
umount /dev/[设备盘名] (sdb1)&#13;
&#13;
umount /dev/vdb2&#13;
&#13;
3.删除旧分区&#13;
fdisk -u /dev/[disk] (sdb)&#13;
&#13;
fdisk -u /dev/vdb&#13;
&#13;
p&#13;
d&#13;
p&#13;
w&#13;
&#13;
4.新建分区&#13;
fdisk -u /dev/[disk] (sdb)&#13;
fdisk -u /dev/vdb&#13;
&#13;
p&#13;
n&#13;
p&#13;
default&#13;
default&#13;
default&#13;
w&#13;
&#13;
5.检查&#13;
lsblk /dev/[disk] (sdb)&#13;
&#13;
lsblk /dev/vdb&#13;
&#13;
e2fsck -n /dev/[设备盘名] (sdb1)&#13;
&#13;
e2fsck -n /dev/vdb2&#13;
&#13;
partprobe /dev/[disk] (sdb)&#13;
&#13;
partprobe /dev/vdb&#13;
&#13;
e2fsck -f /dev/[设备盘名] (sdb1)&#13;
&#13;
e2fsck -f /dev/vdb2&#13;
&#13;
resize2fs /dev/[设备盘名] (sdb1)&#13;
&#13;
resize2fs /dev/vdb2&#13;
&#13;
6.Final最终&#13;
mount /dev/[设备盘名] /alidata&#13;
&#13;
mount /dev/vdb2 /alidata&#13;
&#13;
df -h&#13;
&#13;
&#13;
。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/a-li-yun-kuo-rong.html</guid><pubDate>Mon, 20 Jan 2020 04:54:15 +0000</pubDate></item><item><title>unraid amd 3600x mac 配置</title><link>https://yangweijie.github.io/note/post/unraid%20amd%203600x%20mac%20-pei-zhi.html</link><description>```&#13;
&lt;?xml version='1.0' encoding='UTF-8'?&gt;&#13;
&lt;domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'&gt;&#13;
  &lt;name&gt;MacinaboxCatalina&lt;/name&gt;&#13;
  &lt;uuid&gt;06a15c6e-8c82-4fa1-aae6-694e6301cac1&lt;/uuid&gt;&#13;
  &lt;description&gt;MacOS Catalina&lt;/description&gt;&#13;
  &lt;metadata&gt;&#13;
    &lt;vmtemplate xmlns='unraid' name='MacOS' icon='/mnt/user/domains/MacinaboxCatalina/icon/catalina.png' os='Catalina'/&gt;&#13;
  &lt;/metadata&gt;&#13;
  &lt;memory unit='KiB'&gt;8388608&lt;/memory&gt;&#13;
  &lt;currentMemory unit='KiB'&gt;8388608&lt;/currentMemory&gt;&#13;
  &lt;memoryBacking&gt;&#13;
    &lt;nosharepages/&gt;&#13;
  &lt;/memoryBacking&gt;&#13;
  &lt;vcpu placement='static'&gt;12&lt;/vcpu&gt;&#13;
  &lt;cputune&gt;&#13;
    &lt;vcpupin vcpu='0' cpuset='0'/&gt;&#13;
    &lt;vcpupin vcpu='1' cpuset='1'/&gt;&#13;
    &lt;vcpupin vcpu='2' cpuset='2'/&gt;&#13;
    &lt;vcpupin vcpu='3' cpuset='3'/&gt;&#13;
    &lt;vcpupin vcpu='4' cpuset='4'/&gt;&#13;
    &lt;vcpupin vcpu='5' cpuset='5'/&gt;&#13;
    &lt;vcpupin vcpu='6' cpuset='6'/&gt;&#13;
    &lt;vcpupin vcpu='7' cpuset='7'/&gt;&#13;
    &lt;vcpupin vcpu='8' cpuset='8'/&gt;&#13;
    &lt;vcpupin vcpu='9' cpuset='9'/&gt;&#13;
    &lt;vcpupin vcpu='10' cpuset='10'/&gt;&#13;
    &lt;vcpupin vcpu='11' cpuset='11'/&gt;&#13;
  &lt;/cputune&gt;&#13;
  &lt;os&gt;&#13;
    &lt;type arch='x86_64' machine='pc-q35-3.1'&gt;hvm&lt;/type&gt;&#13;
    &lt;loader readonly='yes' type='pflash'&gt;/mnt/user/domains/MacinaboxCatalina/ovmf/OVMF_CODE.fd&lt;/loader&gt;&#13;
    &lt;nvram&gt;/mnt/user/domains/MacinaboxCatalina/ovmf/OVMF_VARS.fd&lt;/nvram&gt;&#13;
  &lt;/os&gt;&#13;
  &lt;features&gt;&#13;
    &lt;acpi/&gt;&#13;
    &lt;apic/&gt;&#13;
  &lt;/features&gt;&#13;
  &lt;cpu mode='host-passthrough' check='none'/&gt;&#13;
  &lt;clock offset='utc'&gt;&#13;
    &lt;timer name='rtc' tickpolicy='catchup'/&gt;&#13;
    &lt;timer name='pit' tickpolicy='delay'/&gt;&#13;
    &lt;timer name='hpet' present='no'/&gt;&#13;
  &lt;/clock&gt;&#13;
  &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;&#13;
  &lt;on_reboot&gt;restart&lt;/on_reboot&gt;&#13;
  &lt;on_crash&gt;restart&lt;/on_crash&gt;&#13;
  &lt;devices&gt;&#13;
    &lt;emulator&gt;/usr/local/sbin/qemu&lt;/emulator&gt;&#13;
    &lt;disk type='file' device='disk'&gt;&#13;
      &lt;driver name='qemu' type='qcow2' cache='writeback'/&gt;&#13;
      &lt;source file='/mnt/user/domains/MacinaboxCatalina/Clover.qcow2'/&gt;&#13;
      &lt;target dev='hdc' bus='sata'/&gt;&#13;
      &lt;boot order='1'/&gt;&#13;
      &lt;address type='drive' controller='0' bus='0' target='0' unit='2'/&gt;&#13;
    &lt;/disk&gt;&#13;
    &lt;disk type='file' device='disk'&gt;&#13;
      &lt;driver name='qemu' type='raw' cache='writeback'/&gt;&#13;
      &lt;source file='/mnt/user/domains/MacinaboxCatalina/Catalina-install.img'/&gt;&#13;
      &lt;target dev='hdd' bus='sata'/&gt;&#13;
      &lt;address type='drive' controller='0' bus='0' target='0' unit='3'/&gt;&#13;
    &lt;/disk&gt;&#13;
    &lt;disk type='file' device='disk'&gt;&#13;
      &lt;driver name='qemu' type='raw' cache='writeback'/&gt;&#13;
      &lt;source file='/mnt/user/domains/MacinaboxCatalina/macos_disk.img'/&gt;&#13;
      &lt;target dev='hde' bus='sata'/&gt;&#13;
      &lt;address type='drive' controller='0' bus='0' target='0' unit='4'/&gt;&#13;
    &lt;/disk&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-ehci1'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-uhci1'&gt;&#13;
      &lt;master startport='0'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-uhci2'&gt;&#13;
      &lt;master startport='2'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-uhci3'&gt;&#13;
      &lt;master startport='4'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='sata' index='0'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='0' model='pcie-root'/&gt;&#13;
    &lt;controller type='pci' index='1' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='1' port='0x10'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='2' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='2' port='0x11'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='3' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='3' port='0x12'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='4' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='4' port='0x13'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='virtio-serial' index='0'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;interface type='bridge'&gt;&#13;
      &lt;mac address='52:54:00:d4:a7:77'/&gt;&#13;
      &lt;source bridge='br0'/&gt;&#13;
      &lt;model type='vmxnet3'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/&gt;&#13;
    &lt;/interface&gt;&#13;
    &lt;serial type='pty'&gt;&#13;
      &lt;target type='isa-serial' port='0'&gt;&#13;
        &lt;model name='isa-serial'/&gt;&#13;
      &lt;/target&gt;&#13;
    &lt;/serial&gt;&#13;
    &lt;console type='pty'&gt;&#13;
      &lt;target type='serial' port='0'/&gt;&#13;
    &lt;/console&gt;&#13;
    &lt;channel type='unix'&gt;&#13;
      &lt;target type='virtio' name='org.qemu.guest_agent.0'/&gt;&#13;
      &lt;address type='virtio-serial' controller='0' bus='0' port='1'/&gt;&#13;
    &lt;/channel&gt;&#13;
    &lt;input type='tablet' bus='usb'&gt;&#13;
      &lt;address type='usb' bus='0' port='1'/&gt;&#13;
    &lt;/input&gt;&#13;
    &lt;input type='mouse' bus='ps2'/&gt;&#13;
    &lt;input type='keyboard' bus='ps2'/&gt;&#13;
    &lt;graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-us'&gt;&#13;
      &lt;listen type='address' address='0.0.0.0'/&gt;&#13;
    &lt;/graphics&gt;&#13;
    &lt;video&gt;&#13;
      &lt;model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/&gt;&#13;
    &lt;/video&gt;&#13;
    &lt;memballoon model='virtio'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/&gt;&#13;
    &lt;/memballoon&gt;&#13;
  &lt;/devices&gt;&#13;
  &lt;qemu:commandline&gt;&#13;
    &lt;qemu:arg value='-usb'/&gt;&#13;
    &lt;qemu:arg value='-device'/&gt;&#13;
    &lt;qemu:arg value='usb-kbd,bus=usb-bus.0'/&gt;&#13;
    &lt;qemu:arg value='-device'/&gt;&#13;
    &lt;qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/&gt;&#13;
    &lt;qemu:arg value='-smbios'/&gt;&#13;
    &lt;qemu:arg value='type=2'/&gt;&#13;
    &lt;qemu:arg value='-cpu'/&gt;&#13;
    &lt;qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check'/&gt;&#13;
  &lt;/qemu:commandline&gt;&#13;
&lt;/domain&gt;&#13;
&#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/unraid%20amd%203600x%20mac%20-pei-zhi.html</guid><pubDate>Wed, 01 Jan 2020 18:04:23 +0000</pubDate></item><item><title>unraid vm-5257主机原始配置</title><link>https://yangweijie.github.io/note/post/unraid%20vm-5257-zhu-ji-yuan-shi-pei-zhi.html</link><description>```&#13;
&lt;?xml version='1.0' encoding='UTF-8'?&gt;&#13;
&lt;domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'&gt;&#13;
  &lt;name&gt;MacinaboxCatalina&lt;/name&gt;&#13;
  &lt;uuid&gt;742f4f24-72be-40ad-aebf-ab604531ef10&lt;/uuid&gt;&#13;
  &lt;description&gt;MacOS Catalina&lt;/description&gt;&#13;
  &lt;metadata&gt;&#13;
    &lt;vmtemplate xmlns='unraid' name='MacOS' icon='/mnt/user/domains/MacinaboxCatalina/icon/catalina.png' os='Catalina'/&gt;&#13;
  &lt;/metadata&gt;&#13;
  &lt;memory unit='KiB'&gt;4194304&lt;/memory&gt;&#13;
  &lt;currentMemory unit='KiB'&gt;4194304&lt;/currentMemory&gt;&#13;
  &lt;memoryBacking&gt;&#13;
    &lt;nosharepages/&gt;&#13;
  &lt;/memoryBacking&gt;&#13;
  &lt;vcpu placement='static'&gt;2&lt;/vcpu&gt;&#13;
  &lt;cputune&gt;&#13;
    &lt;vcpupin vcpu='0' cpuset='0'/&gt;&#13;
    &lt;vcpupin vcpu='1' cpuset='1'/&gt;&#13;
  &lt;/cputune&gt;&#13;
  &lt;os&gt;&#13;
    &lt;type arch='x86_64' machine='pc-q35-3.1'&gt;hvm&lt;/type&gt;&#13;
    &lt;loader readonly='yes' type='pflash'&gt;/mnt/user/domains/MacinaboxCatalina/ovmf/OVMF_CODE.fd&lt;/loader&gt;&#13;
    &lt;nvram&gt;/mnt/user/domains/MacinaboxCatalina/ovmf/OVMF_VARS.fd&lt;/nvram&gt;&#13;
  &lt;/os&gt;&#13;
  &lt;features&gt;&#13;
    &lt;acpi/&gt;&#13;
    &lt;apic/&gt;&#13;
  &lt;/features&gt;&#13;
  &lt;cpu mode='host-passthrough' check='none'&gt;&#13;
    &lt;topology sockets='1' cores='2' threads='1'/&gt;&#13;
  &lt;/cpu&gt;&#13;
  &lt;clock offset='utc'&gt;&#13;
    &lt;timer name='rtc' tickpolicy='catchup'/&gt;&#13;
    &lt;timer name='pit' tickpolicy='delay'/&gt;&#13;
    &lt;timer name='hpet' present='no'/&gt;&#13;
  &lt;/clock&gt;&#13;
  &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;&#13;
  &lt;on_reboot&gt;restart&lt;/on_reboot&gt;&#13;
  &lt;on_crash&gt;restart&lt;/on_crash&gt;&#13;
  &lt;devices&gt;&#13;
    &lt;emulator&gt;/usr/local/sbin/qemu&lt;/emulator&gt;&#13;
    &lt;disk type='file' device='disk'&gt;&#13;
      &lt;driver name='qemu' type='qcow2' cache='writeback'/&gt;&#13;
      &lt;source file='/mnt/user/domains/MacinaboxCatalina/Clover.qcow2'/&gt;&#13;
      &lt;target dev='hdc' bus='sata'/&gt;&#13;
      &lt;boot order='1'/&gt;&#13;
      &lt;address type='drive' controller='0' bus='0' target='0' unit='2'/&gt;&#13;
    &lt;/disk&gt;&#13;
    &lt;disk type='file' device='disk'&gt;&#13;
      &lt;driver name='qemu' type='raw' cache='writeback'/&gt;&#13;
      &lt;source file='/mnt/user/domains/MacinaboxCatalina/Catalina-install.img'/&gt;&#13;
      &lt;target dev='hdd' bus='sata'/&gt;&#13;
      &lt;address type='drive' controller='0' bus='0' target='0' unit='3'/&gt;&#13;
    &lt;/disk&gt;&#13;
    &lt;disk type='file' device='disk'&gt;&#13;
      &lt;driver name='qemu' type='raw' cache='writeback'/&gt;&#13;
      &lt;source file='/mnt/user/domains/MacinaboxCatalina/macos_disk.img'/&gt;&#13;
      &lt;target dev='hde' bus='sata'/&gt;&#13;
      &lt;address type='drive' controller='0' bus='0' target='0' unit='4'/&gt;&#13;
    &lt;/disk&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-ehci1'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-uhci1'&gt;&#13;
      &lt;master startport='0'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-uhci2'&gt;&#13;
      &lt;master startport='2'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='usb' index='0' model='ich9-uhci3'&gt;&#13;
      &lt;master startport='4'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='sata' index='0'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='0' model='pcie-root'/&gt;&#13;
    &lt;controller type='pci' index='1' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='1' port='0x10'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='2' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='2' port='0x11'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='3' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='3' port='0x12'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='pci' index='4' model='pcie-root-port'&gt;&#13;
      &lt;model name='pcie-root-port'/&gt;&#13;
      &lt;target chassis='4' port='0x13'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;controller type='virtio-serial' index='0'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/&gt;&#13;
    &lt;/controller&gt;&#13;
    &lt;interface type='bridge'&gt;&#13;
      &lt;mac address='52:54:00:41:d2:46'/&gt;&#13;
      &lt;source bridge='br0'/&gt;&#13;
      &lt;model type='vmxnet3'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/&gt;&#13;
    &lt;/interface&gt;&#13;
    &lt;serial type='pty'&gt;&#13;
      &lt;target type='isa-serial' port='0'&gt;&#13;
        &lt;model name='isa-serial'/&gt;&#13;
      &lt;/target&gt;&#13;
    &lt;/serial&gt;&#13;
    &lt;console type='pty'&gt;&#13;
      &lt;target type='serial' port='0'/&gt;&#13;
    &lt;/console&gt;&#13;
    &lt;channel type='unix'&gt;&#13;
      &lt;target type='virtio' name='org.qemu.guest_agent.0'/&gt;&#13;
      &lt;address type='virtio-serial' controller='0' bus='0' port='1'/&gt;&#13;
    &lt;/channel&gt;&#13;
    &lt;input type='tablet' bus='usb'&gt;&#13;
      &lt;address type='usb' bus='0' port='1'/&gt;&#13;
    &lt;/input&gt;&#13;
    &lt;input type='mouse' bus='ps2'/&gt;&#13;
    &lt;input type='keyboard' bus='ps2'/&gt;&#13;
    &lt;graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-us'&gt;&#13;
      &lt;listen type='address' address='0.0.0.0'/&gt;&#13;
    &lt;/graphics&gt;&#13;
    &lt;video&gt;&#13;
      &lt;model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/&gt;&#13;
    &lt;/video&gt;&#13;
    &lt;memballoon model='virtio'&gt;&#13;
      &lt;address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/&gt;&#13;
    &lt;/memballoon&gt;&#13;
  &lt;/devices&gt;&#13;
  &lt;qemu:commandline&gt;&#13;
    &lt;qemu:arg value='-usb'/&gt;&#13;
    &lt;qemu:arg value='-device'/&gt;&#13;
    &lt;qemu:arg value='usb-kbd,bus=usb-bus.0'/&gt;&#13;
    &lt;qemu:arg value='-device'/&gt;&#13;
    &lt;qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/&gt;&#13;
    &lt;qemu:arg value='-smbios'/&gt;&#13;
    &lt;qemu:arg value='type=2'/&gt;&#13;
    &lt;qemu:arg value='-cpu'/&gt;&#13;
    &lt;qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check'/&gt;&#13;
  &lt;/qemu:commandline&gt;&#13;
&lt;/domain&gt;&#13;
&#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/unraid%20vm-5257-zhu-ji-yuan-shi-pei-zhi.html</guid><pubDate>Tue, 31 Dec 2019 03:33:46 +0000</pubDate></item><item><title>php word 执行宏</title><link>https://yangweijie.github.io/note/post/php%20word%20-zhi-xing-hong.html</link><description>```&#13;
try {&#13;
        $word = new \COM('word.application') or die('Can't start Word!');&#13;
        $word-&gt;Visible = 0;&#13;
        $word-&gt;Documents-&gt;Open($srcfilename, false, false, false, '1', '1', true);&#13;
        $word-&gt;ActiveDocument-&gt;final = false;&#13;
        $word-&gt;ActiveDocument-&gt;Saved = true;&#13;
        $word-&gt;Application-&gt;run('getPageCount');&#13;
        // $word-&gt;Documents[1]-&gt;SaveAs($destfilename);&#13;
		$word-&gt;ActiveDocument-&gt;ExportAsFixedFormat(&#13;
			$destfilename,&#13;
			17, // wdExportFormatPDF&#13;
			false, // open file after export&#13;
			0, // wdExportOptimizeForPrint&#13;
			3, // wdExportFromTo&#13;
			1, // begin page&#13;
			5000, // end page&#13;
			7, // wdExportDocumentWithMarkup&#13;
			true, // IncludeDocProps&#13;
			true, // KeepIRM&#13;
			1// WdExportCreateBookmarks&#13;
		);&#13;
		$word-&gt;ActiveDocument-&gt;Close();&#13;
        $end = time();&#13;
        $word-&gt;Quit();&#13;
    } catch (\Exception $e) {&#13;
        if (method_exists($word, 'Quit')) {&#13;
            $word-&gt;Quit();&#13;
        }&#13;
        $error = $e-&gt;getCode().PHP_EOL.$e-&gt;getMessage().PHP_EOL.$e-&gt;getTraceAsString();&#13;
        // ptrace($e-&gt;getCode());&#13;
        // ptrace($error);&#13;
        $end = time();&#13;
    }&#13;
```&#13;
名称为word中定义的宏，测试可以把 Visible  = 1 和加 sleep 来看是否执行成功。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/php%20word%20-zhi-xing-hong.html</guid><pubDate>Thu, 05 Dec 2019 07:57:44 +0000</pubDate></item><item><title>php 执行的系统命令带中文时乱码</title><link>https://yangweijie.github.io/note/post/php%20-zhi-xing-de-xi-tong-ming-ling-dai-zhong-wen-shi-luan-ma.html</link><description>首先查看系统对中文的支持&#13;
&#13;
```&#13;
locale -a | grep zh_CN&#13;
&#13;
    zh_CN&#13;
    zh_CN.gb18030&#13;
    zh_CN.gb2312&#13;
    zh_CN.gbk&#13;
    zh_CN.utf8&#13;
&#13;
vi ~/.bash_profile&#13;
文件末尾添加:&#13;
    export LANG='zh_CN.UTF-8'&#13;
    export LC_ALL='zh_CN.UTF-8'&#13;
    export LANG='en_US.UTF-8'&#13;
    export LC_ALL='en_US.UTF-8'&#13;
```&#13;
&#13;
&#13;
在php文件调用exec前设定环境变量&#13;
```&#13;
    $locale='en_US.UTF-8';  // 或  $locale='zh_CN.UTF-8';&#13;
    setlocale(LC_ALL,$locale);&#13;
    putenv('LC_ALL='.$locale);&#13;
```&#13;
————————————————&#13;
版权声明：本文为CSDN博主「小米啄鸡」的原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接及本声明。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/php%20-zhi-xing-de-xi-tong-ming-ling-dai-zhong-wen-shi-luan-ma.html</guid><pubDate>Tue, 26 Nov 2019 04:49:14 +0000</pubDate></item><item><title>在windows下php执行java命令无反应</title><link>https://yangweijie.github.io/note/post/zai-windows-xia-php-zhi-xing-java-ming-ling-wu-fan-ying.html</link><description>&lt;?php    &#13;
&#13;
        exec('java -version',$out,$status);&#13;
&#13;
        var_dump($out);&#13;
&#13;
        echo $status;&#13;
&#13;
?&gt;&#13;
&#13;
执行结果是$out是空数组，$status为0，不知道为什么，java命令（已加入环境变量）在cmd命令行下是可以执行的，而且exec('dir')也是可以成功执行的，不知道java命令为什么会有问题&#13;
&#13;
&#13;
解决了，后来直接在命令行执行脚本发现java -version竟然是标准错误输出，所以如果要得到输出的话，只要java -version 2&gt;&amp;1就可以了，亲测可用。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zai-windows-xia-php-zhi-xing-java-ming-ling-wu-fan-ying.html</guid><pubDate>Tue, 26 Nov 2019 04:35:39 +0000</pubDate></item><item><title>PHP7 serialize_precision 配置不当导致 json_encode() 浮点小数溢出错误</title><link>https://yangweijie.github.io/note/post/PHP7%20serialize_precision%20-pei-zhi-bu-dang-dao-zhi-%20json_encode%28%29%20-fu-dian-xiao-shu-yi-chu-cuo-wu.html</link><description>情是这样的,项目里发现一个奇怪的现象,json_encode一个带浮点价格的数据, 出现溢出, 比如:&#13;
~~~&#13;
&lt;?php&#13;
echo json_encode(277.2);&#13;
// 输出结果为: 277.199999999999989&#13;
~~~&#13;
这明显是不能接受的, 数据虽然很接近, 但毕竟已经变更了&#13;
下意识地认为这是php的一个bug, 不能准确地json序列化一个浮点小数&#13;
这个问题google了半天竟然也无果, 然后我跟同事说, 你们json_encode数据里有小数的时候, 记得先number_format()转化成字符串.&#13;
&#13;
自己又写了个fix方法, 遍历数据, 把is_float()的数据都用number_format()转化了&#13;
~~~&#13;
function json_encode_pre($d, $depth=128, $level=0){&#13;
    if($level&gt;$depth) return $d;&#13;
    if(is_array($d)){&#13;
        foreach ($d as $i =&gt; $v) { $d[$i] = json_encode_pre($v, $depth, $level+1); }&#13;
        return $d;&#13;
    }&#13;
    if(is_float($d)){&#13;
        # 测试发现number_format有效数字低于18(保守取16)时,不会溢出&#13;
        $p = 16 - strlen(intval($d));&#13;
        $f = number_format($d, $p);&#13;
        if($p&gt;1){ $f = preg_replace('/0+$/','', $d); }&#13;
        return $d;&#13;
    }&#13;
    return $d;&#13;
}&#13;
~~~&#13;
echo number_format(277.2, 14); // 当18位有效数字处理(277.2已有4位有效数字)&#13;
// 277.199999999999989&#13;
echo number_format(277.2, 12); // 当16位&#13;
// 277.2000000000000&#13;
echo json_encode(json_encode_pre(277.2));&#13;
// '277.2'&#13;
看到这结果时, 便猜测是有效数字位数的问题导致了溢出, PHP怎么会有这么蠢的设计呢?这是我当时的想法.&#13;
&#13;
然后想着是不是能从源码下手, 于是查了下php源码, 发现这段代码:&#13;
~~~&#13;
static inline void php_json_encode_double(smart_str *buf, double d, int options) /* {{{ */&#13;
{&#13;
    size_t len;&#13;
    char num[PHP_DOUBLE_MAX_LENGTH];&#13;
&#13;
    php_gcvt(d, (int)PG(serialize_precision), '.', 'e', num);&#13;
    len = strlen(num);&#13;
    if (options &amp; PHP_JSON_PRESERVE_ZERO_FRACTION &amp;&amp; strchr(num, '.') == NULL &amp;&amp; len &lt; PHP_DOUBLE_MAX_LENGTH - 2) {&#13;
        num[len++] = '.';&#13;
        num[len++] = '0';&#13;
        num[len] = '\0';&#13;
    }&#13;
    smart_str_appendl(buf, num, len);&#13;
}&#13;
~~~&#13;
是的, 竟然发现了配置项serialize_precision, 这个配置我当初的理解是serialize()方法用的, 而我当初尝试修改过配置项precision, 然并卵, 原来json_encode会用到serialize_precision, 于是修改php.ini, 把它设为16, 原来是17还是18忘了.&#13;
&#13;
&lt;?php&#13;
echo json_encode(277.2);&#13;
// 输出结果为: 277.2&#13;
如果你想重现我的问题, 很简单, 把serialize_precision设为20或更大, 至于这个有效数字最大值是多少才不会溢出, 我还不知道跟什么有关系, 希望能有大神指点了.&#13;
我是通过改配置数值, 出现溢出的值再减去2来用的.&#13;
&#13;
附上配置项说明, 从官方说明上看, 很难想像是跟json_encode是有关系的.&#13;
&#13;
; php.ini&#13;
&#13;
; When floats &amp; doubles are serialized store serialize_precision significant&#13;
; digits after the floating point. The default value ensures that when floats&#13;
; are decoded with unserialize, the data will remain the same.&#13;
serialize_precision = 16&#13;
&#13;
; The number of significant digits displayed in floating point numbers.&#13;
; http://php.net/precision&#13;
precision = 16&#13;
另外源码里有个json_encode的选项JSON_PRESERVE_ZERO_FRACTION, 这个的意思是如果是个是个整数, 是否保留小数点和0, 来看测试结果:&#13;
~~~&#13;
&lt;?php&#13;
echo json_encode(277.0);&#13;
// 277&#13;
echo json_encode(277.0, JSON_PRESERVE_ZERO_FRACTION);&#13;
// 277.0&#13;
~~~。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/PHP7%20serialize_precision%20-pei-zhi-bu-dang-dao-zhi-%20json_encode%28%29%20-fu-dian-xiao-shu-yi-chu-cuo-wu.html</guid><pubDate>Fri, 22 Nov 2019 03:10:56 +0000</pubDate></item><item><title>Ubuntu apt-get 安装 PHP最新版</title><link>https://yangweijie.github.io/note/post/Ubuntu%20apt-get%20-an-zhuang-%20PHP-zui-xin-ban.html</link><description>直接用官方PPA源&#13;
&#13;
sudo add-apt-repository -y ppa:ondrej/php&#13;
sudo apt-get update&#13;
1&#13;
2&#13;
显示软件安装包列表，是否已经有了PHP 7.1，可选&#13;
&#13;
apt-cache pkgnames | grep php7.1&#13;
1&#13;
安装，2018年05月08日 星期二，现在的最新版是7.2&#13;
&#13;
sudo apt-get install php7.2-fpm&#13;
。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Ubuntu%20apt-get%20-an-zhuang-%20PHP-zui-xin-ban.html</guid><pubDate>Sun, 29 Sep 2019 00:54:20 +0000</pubDate></item><item><title>win下和linux下命令行速查表</title><link>https://yangweijie.github.io/note/post/win-xia-he-linux-xia-ming-ling-xing-su-cha-biao.html</link><description>|win|linux|&#13;
|=|=|&#13;
|where| which|。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/win-xia-he-linux-xia-ming-ling-xing-su-cha-biao.html</guid><pubDate>Fri, 28 Jun 2019 00:30:10 +0000</pubDate></item><item><title>git提取出两个版本之间的差异文件并打包</title><link>https://yangweijie.github.io/note/post/git-ti-qu-chu-liang-ge-ban-ben-zhi-jian-de-cha-yi-wen-jian-bing-da-bao.html</link><description>公司的项目原先是使用svn做版本管理，发布项目的时候是采用打包的方式压缩成zip格式的文件，然后用ftp上传。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/git-ti-qu-chu-liang-ge-ban-ben-zhi-jian-de-cha-yi-wen-jian-bing-da-bao.html</guid><pubDate>Thu, 06 Jun 2019 02:42:56 +0000</pubDate></item><item><title>svn 和 git webhook的使用</title><link>https://yangweijie.github.io/note/post/svn%20-he-%20git%20webhook-de-shi-yong.html</link><description>最近由于想提高代码提交的效率不再git commit &amp;&amp; git push 和 svn commit 后每次要去服务器更新代码。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/svn%20-he-%20git%20webhook-de-shi-yong.html</guid><pubDate>Mon, 08 Oct 2018 08:36:26 +0000</pubDate></item><item><title>在线工具集</title><link>https://yangweijie.github.io/note/post/zai-xian-gong-ju-ji.html</link><description>- http://www.bithublab.org/ 代码搜索。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zai-xian-gong-ju-ji.html</guid><pubDate>Thu, 16 Aug 2018 08:06:07 +0000</pubDate></item><item><title>Ubuntu18.04下更改apt源为阿里云源</title><link>https://yangweijie.github.io/note/post/Ubuntu18.04-xia-geng-gai-apt-yuan-wei-a-li-yun-yuan.html</link><description>前言：看见Ubuntu新出了18.04版本感觉不错，装一个玩玩，虽然有很多教程可以参考，但我也给出一个不是很一样的方案吧，尽量解释的详细一点。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Ubuntu18.04-xia-geng-gai-apt-yuan-wei-a-li-yun-yuan.html</guid><pubDate>Sat, 04 Aug 2018 08:26:22 +0000</pubDate></item><item><title>nesk/puphpeteer使用记</title><link>https://yangweijie.github.io/note/post/nesk-puphpeteer-shi-yong-ji.html</link><description>一次模拟登录并采集登录后cookie的记录&#13;
&#13;
# 安装&#13;
&#13;
```&#13;
composer require nesk/puphpeteer&#13;
npm install @nesk/puphpeteer&#13;
```&#13;
有的人会漏了第二个，然后报奇怪的错误&#13;
&#13;
# 熟悉文档&#13;
&#13;
## 值得注意的PuPHPeteer 和 Puppeteer 之间的不同&#13;
&#13;
### Puppeteer's 的类必须实例化， 所有require 改为new&#13;
### 不需要使用 await 关键词&#13;
### 一些方法被别名了&#13;
* $ =&gt; querySelector&#13;
* $$ =&gt; querySelectorAll&#13;
* $x =&gt; querySelectorXPath&#13;
* $eval =&gt; querySelectorEval&#13;
* $$eval =&gt; querySelectorAllEval&#13;
### 执行的 函数必须通过JsFunction 创建&#13;
&#13;
```&#13;
use Nesk\Rialto\Data\JsFunction;&#13;
&#13;
$pageFunction = JsFunction::create(['element'], '&#13;
    return element.textContent;&#13;
');&#13;
```&#13;
### 已成必须通过-&gt;tryCatch 捕获&#13;
&#13;
# 我的实践&#13;
&#13;
```&#13;
    public function index()&#13;
    {&#13;
    	$url = 'http://cpservice.sipo.gov.cn/SecurityCode?timestamp='.time();&#13;
    	$ret = $this-&gt;ocr_code($url, 4, 1);&#13;
    }&#13;
&#13;
    public function get_cookie(){&#13;
        // @unlink('verify.png');&#13;
        // @unlink('result.png');&#13;
        $puppeteer = new Puppeteer;&#13;
        $browser = $puppeteer-&gt;launch([&#13;
            'headless'=&gt;false&#13;
        ]);&#13;
        try {&#13;
            $page = $browser-&gt;newPage();&#13;
            $page-&gt;goto('http://cpservice.sipo.gov.cn/index.jsp');&#13;
            $img = $page-&gt;querySelector('#Verify');&#13;
            $usernameInput = $page-&gt;querySelector('#username');&#13;
            $usernameInput-&gt;focus(); //定位到用户名&#13;
            $page-&gt;keyboard-&gt;type('XXXXXXXXXX');&#13;
            $passwordInput = $page-&gt;querySelector('#password');&#13;
            $passwordInput-&gt;focus();&#13;
            $page-&gt;keyboard-&gt;type('XXXXXXXXXX');&#13;
            $page-&gt;screenshot(['path' =&gt; 'verify.png',&#13;
                'clip'=&gt;[&#13;
                    'x'=&gt;445,'y'=&gt;513, 'width'=&gt;70,'height'=&gt;30&#13;
                ]&#13;
            ]);&#13;
            $url = 'http://dp.cn/verify.png';&#13;
            $ocr_url = 'http://dp.cn/index/index/ocr_code';&#13;
            $debug_url = 'http://o2.cn/oxygen/user/front_log';&#13;
$js =  &lt;&lt;&lt;JS&#13;
var xmlhttp;&#13;
var ret = '1111';&#13;
if (window.XMLHttpRequest){&#13;
    xmlhttp = new XMLHttpRequest();&#13;
}else{&#13;
  xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');&#13;
}&#13;
xmlhttp.open('POST','{$ocr_url}',false);&#13;
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');&#13;
xmlhttp.send('url={$url}');&#13;
xmlhttp.onreadystatechange=function(){&#13;
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){&#13;
        ret = xmlhttp.responseText;&#13;
        return;&#13;
    }&#13;
}&#13;
if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){&#13;
    ret = xmlhttp.responseText;&#13;
}else{&#13;
    xmlhttp.open('GET','{$debug_url}?msg='+ JSON.stringify([xmlhttp.readyState, xmlhttp.status,xmlhttp.responseText, xmlhttp.responseXML]),true);&#13;
    xmlhttp.send();&#13;
}&#13;
return ret;&#13;
JS;&#13;
            $verifyFunction = JsFunction::create([], $js);&#13;
            $dimensions = $page-&gt;evaluate($verifyFunction);&#13;
            dump($dimensions);&#13;
            if($dimensions != '1111' &amp;&amp; $dimensions != ''){&#13;
                $securityCodeInput = $page-&gt;querySelector('#securityCode');&#13;
                $securityCodeInput-&gt;focus();&#13;
                $page-&gt;keyboard-&gt;type($dimensions);&#13;
                $page-&gt;screenshot(['path' =&gt; 'result.png']);&#13;
                $loginFunction = JsFunction::create([], '&#13;
                    return login();&#13;
                ');&#13;
                $dimensions2 = $page-&gt;evaluate($loginFunction);&#13;
                $page-&gt;waitForNavigation(['timeout'=&gt;5000]);&#13;
                $jumpFunction = JsFunction::create([], '&#13;
                    return document.cookie;&#13;
                ');&#13;
                $dimensions3 = $page-&gt;evaluate($jumpFunction);&#13;
                $page-&gt;screenshot(['path' =&gt; 'result2.png']);&#13;
                dump($dimensions3);&#13;
            }else{&#13;
&#13;
            }&#13;
        } catch (Node\Exception $exception) {&#13;
            ptrace($e-&gt;getMessage().PHP_EOL.$e-&gt;getTraceAsString());&#13;
            print($e-&gt;getMessage().PHP_EOL.$e-&gt;getTraceAsString());&#13;
        }&#13;
        $browser-&gt;close();&#13;
    }&#13;
&#13;
    public function ocr_code($url, $length = 4, $debug =0){&#13;
        if(false !== stripos($url, 'http')){&#13;
            $img = file_get_contents($url);&#13;
        }else{&#13;
            $img = base64_decode($url);&#13;
        }&#13;
        // TODO md5 缓存识别结果&#13;
        // halt($img);&#13;
        $tmp = tempnam(sys_get_temp_dir(), 'code');&#13;
        file_put_contents($tmp, $img);&#13;
        // ptrace($tmp);&#13;
        // return $tmp;&#13;
		$ret = plugin_action('BaiduAi', 'Ocr', 'basicAccurate', [$img]);&#13;
        ptrace($ret);&#13;
        $words = $ret['words_result']['0']['words'];&#13;
        $words = trim($words, ' ');&#13;
        $words = str_ireplace(['.',' ', '\''], '', $words);&#13;
		if($debug){&#13;
	        echo '&lt;img src=''.base64EncodeImage($tmp).''&gt;';&#13;
			// dump($ret);&#13;
			// dump($words);&#13;
		}&#13;
		return strlen($words) == $length? $words: '';&#13;
    }&#13;
```&#13;
&#13;
百度ai 用的海豚里我封装的插件 不是100%成功率，如果要高成功率 可以尝试自己tensflow训练，因为网站固定字体生成的验证码&#13;
&#13;
# 注意点：&#13;
- js里ajax用原生的，我之前node的puphpeteer 就是es7里异步 await 什么的找了一个http node模块写了个请求，结果请求成功参数永远返回不出来。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/nesk-puphpeteer-shi-yong-ji.html</guid><pubDate>Sun, 15 Jul 2018 14:33:49 +0000</pubDate></item><item><title>tp5 postgresql</title><link>https://yangweijie.github.io/note/post/tp5%20postgresql.html</link><description>return [&#13;
    // 数据库类型&#13;
    'type'            =&gt; 'pgsql',&#13;
    // 服务器地址&#13;
    'hostname'        =&gt; 'localhost',&#13;
    // 数据库名&#13;
    'database'        =&gt; 'oxygen',&#13;
    // 用户名&#13;
    'username'        =&gt; 'postgres',&#13;
    // 密码&#13;
    'password'        =&gt;  '123456',&#13;
    // 端口&#13;
    'hostport'        =&gt; '5432',&#13;
    // 连接dsn&#13;
    'dsn'             =&gt; '',&#13;
    // 数据库连接参数&#13;
    'params'          =&gt; [],&#13;
    // 数据库编码默认采用utf8&#13;
    'charset'         =&gt; 'utf8',&#13;
    // 数据库表前缀&#13;
    'prefix'          =&gt; 'dp_',&#13;
    // 数据库调试模式&#13;
    'debug'           =&gt; true,&#13;
    // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)&#13;
    'deploy'          =&gt; 0,&#13;
    // 数据库读写是否分离 主从式有效&#13;
    'rw_separate'     =&gt; false,&#13;
    // 读写分离后 主服务器数量&#13;
    'master_num'      =&gt; 1,&#13;
    // 指定从服务器序号&#13;
    'slave_no'        =&gt; '',&#13;
    // 是否严格检查字段是否存在&#13;
    'fields_strict'   =&gt; false,&#13;
    // 数据集返回类型&#13;
    'resultset_type'  =&gt; 'array',&#13;
    // 自动写入时间戳字段&#13;
    'auto_timestamp'  =&gt; false,&#13;
    // 时间字段取出后的默认时间格式&#13;
    'datetime_format' =&gt; false,&#13;
    // 是否需要进行SQL性能分析&#13;
    'sql_explain'     =&gt; false,&#13;
];&#13;
开启pgsql pdo_pgsql 扩展&#13;
执行tp 官方文档里的sql&#13;
&#13;
自增主键 通过sequence来实现的&#13;
。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/tp5%20postgresql.html</guid><pubDate>Mon, 09 Jul 2018 14:27:22 +0000</pubDate></item><item><title>sql General error: 1267 Illegal mix of collations (utf8mb4_general_ci,IMPLICIT)</title><link>https://yangweijie.github.io/note/post/sql%20General%20error-%201267%20Illegal%20mix%20of%20collations%20%28utf8mb4_general_ci%2CIMPLICIT%29.html</link><description>今天客户的微信注册遇到昵称问题&#13;
&#13;
![image](https://user-images.githubusercontent.com/1614114/41708734-fe46bda2-7573-11e8-8de6-65acadb6fb9c.png)&#13;
&#13;
开始找了个修改表结构的sql 改了几个特殊字段， 结果还是报错&#13;
&#13;
索性tp写了个循环后 将所有表的字符全改utf8mb4了&#13;
&#13;
 ```&#13;
   public function modify_table_charset(){&#13;
    	$tables = Db::query('show tables');&#13;
    	$sql = '';&#13;
    	foreach ($tables as $t) {&#13;
    		$sql .= PHP_EOL.&lt;&lt;&lt;SQL&#13;
ALTER TABLE {$t['Tables_in_novel']} CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_general_ci;&#13;
&#13;
SQL;&#13;
&#13;
    	}&#13;
		echo $sql;&#13;
    }&#13;
```&#13;
&#13;
还有改数据库默认编码。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/sql%20General%20error-%201267%20Illegal%20mix%20of%20collations%20%28utf8mb4_general_ci%2CIMPLICIT%29.html</guid><pubDate>Thu, 21 Jun 2018 08:55:39 +0000</pubDate></item><item><title>windows开发优化</title><link>https://yangweijie.github.io/note/post/windows-kai-fa-you-hua.html</link><description># 命令行&#13;
&#13;
## Scoop&#13;
`iex (new-object net.webclient).downloadstring('https://get.scoop.sh')`&#13;
&#13;
`scoop bucket add extras`&#13;
`scoop bucket add php-bucket https://github.com/nueko/php-ext-bucket`&#13;
`scoop bucket add php`&#13;
&#13;
## pickle&#13;
[pickle ](https://github.com/FriendsOfPHP/pickle) 用来安装 php扩展&#13;
&#13;
win php扩展下载目录&#13;
http://windows.php.net/downloads/pecl/releases/&#13;
&#13;
https://github.com/Microsoft/php-sdk-binary-tools&#13;
&#13;
```&#13;
cd php-sdk &#13;
&#13;
phpsdk_buildtree phpdev&#13;
```&#13;
cd C:\php-sdk\phpdev\vc15\x64&#13;
`git clone -b PHP-7.2.6 https://github.com/php/php-src.git`&#13;
&#13;
cd php-src&#13;
&#13;
## pacman -Syu。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/windows-kai-fa-you-hua.html</guid><pubDate>Thu, 14 Jun 2018 23:08:00 +0000</pubDate></item><item><title>教你如何在windows下操作EFI分区，方便安装和配置Clover</title><link>https://yangweijie.github.io/note/post/jiao-ni-ru-he-zai-windows-xia-cao-zuo-EFI-fen-qu-%EF%BC%8C-fang-bian-an-zhuang-he-pei-zhi-Clover.html</link><description># 教你如何在windows下操作EFI分区，方便安装和配置Clover&#13;
&#13;
摘 要&#13;
&#13;
使用Clover引导的朋友可能对EFI分区不陌生吧，EFI是中可扩展借口，Clover四叶草启动引导工具就是通过EFI的方式引导的，所以用clover安装黑苹果就需要对CEFI分区进行操作，下面介绍一下在windows下如何操作EFI分区。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/jiao-ni-ru-he-zai-windows-xia-cao-zuo-EFI-fen-qu-%EF%BC%8C-fang-bian-an-zhuang-he-pei-zhi-Clover.html</guid><pubDate>Fri, 08 Jun 2018 00:00:10 +0000</pubDate></item><item><title>Linux删除（清空）正在运行的应用日志文件内容</title><link>https://yangweijie.github.io/note/post/Linux-shan-chu-%EF%BC%88-qing-kong-%EF%BC%89-zheng-zai-yun-xing-de-ying-yong-ri-zhi-wen-jian-nei-rong.html</link><description>  在测试环境定位问题时，如果发现日志文件内容太多或太大，有时需要删除该日志，如Tomcat，Nginx日志。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Linux-shan-chu-%EF%BC%88-qing-kong-%EF%BC%89-zheng-zai-yun-xing-de-ying-yong-ri-zhi-wen-jian-nei-rong.html</guid><pubDate>Mon, 04 Jun 2018 07:28:47 +0000</pubDate></item><item><title>php inotify 扩展的安装</title><link>https://yangweijie.github.io/note/post/php%20inotify%20-kuo-zhan-de-an-zhuang.html</link><description>一、安装&#13;
&#13;
1）  从内核和目录里面查看是否支持inotify&#13;
&#13;
[root@nfs01 ~]# **uname -r**&#13;
&#13;
**2.6.32-573.el6.x86_64**&#13;
&#13;
[root@nfs01 ~]#** ls -l /proc/sys/fs/inotify/**    -→主要查看下面有没有三个目录&#13;
&#13;
总用量 0&#13;
&#13;
-rw-r--r-- 1 root root 0 1月  21 13:03 max_queued_events&#13;
&#13;
-rw-r--r-- 1 root root 0 1月  21 13:03 max_user_instances&#13;
&#13;
-rw-r--r-- 1 root root 0 1月  21 13:03 max_user_watches&#13;
&#13;
**2****）检查是否有安装inotify ****如果没有就安装**&#13;
&#13;
**rpm -qa inotify-tools**&#13;
&#13;
没有就先安装epol源&#13;
&#13;
yum.repos.d]# **wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo**&#13;
&#13;
之后安装&#13;
&#13;
[root@nfs01 ~]#** yum install inotify-tools -y**&#13;
&#13;
**二、参数讲解、**&#13;
&#13;
[root@nfs01 ~]# **which inotifywait**&#13;
&#13;
**/usr/bin/inotifywait**&#13;
&#13;
[root@nfsserver inotify-tools]# **bin/inotifywait —help**&#13;
&#13;
r ：递归查询目录&#13;
&#13;
q：打印很少的信息，仅仅打印监控事件的信息  安静状态&#13;
&#13;
m：始终保持事件监听状态&#13;
&#13;
excluder#排除文件或者目录的时候不区分大小写&#13;
&#13;
timefmt：指定时间输出的格式&#13;
&#13;
d ：后台运行&#13;
&#13;
-e： 事件 里面有很多方法&#13;
&#13;
![复制代码](https://common.cnblogs.com/images/copycode.gif)&#13;
&#13;
下面是事件参数&#13;
&#13;
Events:&#13;
&#13;
        access          file or directory contents were read   访问&#13;
&#13;
        modify          file or directory contents were written  修改&#13;
&#13;
        attrib          file or directory attributes changed  属性发生变化&#13;
&#13;
        close_write     file or directory closed, after being opened in 写入之后关闭&#13;
&#13;
                        writeable mode&#13;
&#13;
        close_nowrite   file or directory closed, after being opened in read-only mode&#13;
&#13;
        close           file or directory closed, regardless of read/write mode &#13;
&#13;
        open            file or directory opened&#13;
&#13;
        moved_to        file or directory moved to watched directory  移动到哪里&#13;
&#13;
        moved_from      file or directory moved from watched directory&#13;
&#13;
        move            file or directory moved to or from watched directory&#13;
&#13;
        create          file or directory created within watched directory&#13;
&#13;
        delete          file or directory deleted within watched directory&#13;
&#13;
        delete_self     file or directory was deleted&#13;
&#13;
        unmount         file system containing file or directory unmounted卸载&#13;
&#13;
![复制代码](https://common.cnblogs.com/images/copycode.gif)&#13;
&#13;
之后就可以和nfs共享服务器之间的实时备份&#13;
&#13;
我曾七次鄙视自己的灵魂: 第一次,当它本可进取时，却故作谦卑； 第二次,当它空虚时，用爱欲来填充； 第三次,在困难和容易之间，它选择了容易； 第四次,它犯了错，却借由别人也会犯错来宽慰自己； 第五次,它自由软弱，却把它认为是生命的坚韧； 第六次,当它鄙夷一张丑恶的嘴脸时，却不知那正是自己面具中的一副； 第七次,它侧身于生活的污泥中虽不甘心，却又畏首畏尾。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/php%20inotify%20-kuo-zhan-de-an-zhuang.html</guid><pubDate>Mon, 28 May 2018 03:10:09 +0000</pubDate></item><item><title>使用LSP插件将 sublime 变成 PHP IDE</title><link>https://yangweijie.github.io/note/post/shi-yong-LSP-cha-jian-jiang-%20sublime%20-bian-cheng-%20PHP%20IDE.html</link><description># 安装LSP&#13;
```npm install -g ocaml-language-server```&#13;
&#13;
# st 安装 LSP&#13;
```pac install  package ``` 搜 LSP 就行&#13;
#  本地composer 安装 php的LSP&#13;
&#13;
修改 ~/.composer/composer.json 设置&#13;
```&#13;
'minimum-stability': 'dev',&#13;
'prefer-stable': true,&#13;
```&#13;
&gt; ps win 在 C:/Users/jay/AppData/Roaming/Composer&#13;
&#13;
&#13;
run `composer global require felixfbecker/language-server`&#13;
&#13;
run  `composer run-script --working-dir=/PATH-TO-HOME-DIR/.composer/vendor/felixfbecker/language-server parse-stubs`&#13;
&#13;
修改 **LSP.sublime-settings - User**&#13;
```&#13;
{&#13;
  'clients': {&#13;
    'phpls': {&#13;
      'command': ['php', '/PATH-TO-HOME-DIR/.composer/vendor/felixfbecker/language-server/bin/php-language-server.php'],&#13;
      'scopes': ['source.php'],&#13;
      'syntaxes': ['Packages/PHP/PHP.sublime-syntax'],&#13;
      'languageId': 'php'&#13;
    }&#13;
  }&#13;
}&#13;
```&#13;
Preferences.sublime-settings - User 里添加触发器&#13;
```&#13;
'auto_complete_triggers':&#13;
[&#13;
  {&#13;
    'characters': '$&gt;:\\',&#13;
    'selector': 'source.php'&#13;
  }&#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/shi-yong-LSP-cha-jian-jiang-%20sublime%20-bian-cheng-%20PHP%20IDE.html</guid><pubDate>Sat, 12 May 2018 01:44:33 +0000</pubDate></item><item><title>yar使用</title><link>https://yangweijie.github.io/note/post/yar-shi-yong.html</link><description>每个服务器上都安装yar扩展&#13;
&#13;
然后要被访问的服务器上写一段代码，开启rpc 服务器&#13;
index控制器index方法里：&#13;
~~~&#13;
  if($_SERVER['PHP_SELF'] == '/nmp_remote.php'){&#13;
            $this-&gt;yar();&#13;
            return '';&#13;
        }&#13;
        &#13;
public function yar(){&#13;
        $server = new \Yar_Server(new YarApi);&#13;
        return $server-&gt;handle();&#13;
}&#13;
~~~&#13;
&#13;
~~~&#13;
namespace app\index\controller;&#13;
Class YarApi{&#13;
&#13;
	/**&#13;
	 * 调用内部函数&#13;
	 * @param  string $name   函数名&#13;
	 * @param  array  $params 参数 没有传[]&#13;
	 * @return mixed         返回结果&#13;
	 */&#13;
	public function function_call($name, $params=[]){&#13;
		if(function_exists($name)){&#13;
			return call_user_func_array($name, $params);&#13;
		}else{&#13;
			return 'function not exists';&#13;
		}&#13;
	}&#13;
&#13;
	/**&#13;
	 * 调用类方法&#13;
	 * @param  string $className 类命名空间&#13;
	 * @param  string $method    方法名&#13;
	 * @param  array  $params    参数 没有传[]&#13;
	 * @return mixed            返回结果&#13;
	 */&#13;
	public function class_call($className, $method, $params=[]){&#13;
		if(method_exists($className, $method)){&#13;
			return call_user_func_array([$className, $method], $params);&#13;
		}else{&#13;
			return 'method not exists';&#13;
		}&#13;
	}&#13;
&#13;
	/**&#13;
	 * 实列话类&#13;
	 * @param  string $className 类命名空间&#13;
	 * @param  array  $params    参数&#13;
	 * @return mixed            返回结果&#13;
	 */&#13;
	public function instance_class($className, $params=[]){&#13;
        if(class_exists($className, false)){&#13;
            $class = new \ReflectionClass($className);&#13;
            $ret = $class-&gt;newInstanceArgs($params);&#13;
            return $ret;&#13;
        }else{&#13;
            return 'class not exists';&#13;
        }&#13;
    }&#13;
&#13;
    public function constant($name){&#13;
    	if(defined($name)){&#13;
    		return constant($name);&#13;
    	}else{&#13;
    		return 'constant no defined';&#13;
    	}&#13;
    }&#13;
&#13;
}&#13;
&#13;
~~~&#13;
暴露的是 server里传入的类 的方法&#13;
&#13;
这两个方法其实用于调用函数和类方法 、 类方法支持静态。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/yar-shi-yong.html</guid><pubDate>Fri, 27 Apr 2018 14:00:59 +0000</pubDate></item><item><title>自建git</title><link>https://yangweijie.github.io/note/post/zi-jian-git.html</link><description># 自建git&#13;
&#13;
由于码云项目出了企业版 每个项目成员最多5个人。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zi-jian-git.html</guid><pubDate>Fri, 27 Apr 2018 13:50:06 +0000</pubDate></item><item><title>tp5 swoole</title><link>https://yangweijie.github.io/note/post/tp5%20swoole.html</link><description>  swoole的资料：&#13;
https://wiki.swoole.com&#13;
&#13;
主要看了 环境依赖、编译安装、快速起步&#13;
&#13;
2. 起步 聊天室 websocket 参见ws.zip。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/tp5%20swoole.html</guid><pubDate>Fri, 27 Apr 2018 13:46:59 +0000</pubDate></item><item><title>eolinker开源版安装没法设置端口问题</title><link>https://yangweijie.github.io/note/post/eolinker-kai-yuan-ban-an-zhuang-mei-fa-she-zhi-duan-kou-wen-ti.html</link><description>先本地安装后，修改配置文件将端口改为非3306的。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/eolinker-kai-yuan-ban-an-zhuang-mei-fa-she-zhi-duan-kou-wen-ti.html</guid><pubDate>Tue, 17 Apr 2018 07:05:28 +0000</pubDate></item><item><title>2018 计划</title><link>https://yangweijie.github.io/note/post/2018%20-ji-hua.html</link><description>- [ ] sublime tp5 插件的完善&#13;
- [ ] laravel 学习和使用&#13;
- [ ] react的学习&#13;
- [ ]  同唱小程序&#13;
- [x] 减肥&#13;
- [ ] 女朋友 结婚&#13;
- [ ] composer 发包&#13;
- [x] 仿微信的自动回复助手 &#13;
- [ ] 博客多平台发布程序&#13;
- [ ] 博客桌面化  。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/2018%20-ji-hua.html</guid><pubDate>Tue, 20 Feb 2018 15:49:57 +0000</pubDate></item><item><title>Mac系统下安装及卸载JDK</title><link>https://yangweijie.github.io/note/post/Mac-xi-tong-xia-an-zhuang-ji-xie-zai-JDK.html</link><description>一、安装JDK&#13;
&#13;
1、下载JDK&#13;
&#13;
Oracle 1.7以后才有Mac版，1.6以前的版本都是苹果公司编译的。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Mac-xi-tong-xia-an-zhuang-ji-xie-zai-JDK.html</guid><pubDate>Mon, 19 Feb 2018 09:53:39 +0000</pubDate></item><item><title>ThinkPhp5 数据迁移(think-migration)</title><link>https://yangweijie.github.io/note/post/ThinkPhp5%20-shu-ju-qian-yi-%28think-migration%29.html</link><description>在thinkphp5中提供了数据迁移工具(think-migration),它是机遇phinx开发(文档地址：[http://docs.phinx.org/en/latest/](http://docs.phinx.org/en/latest/))&#13;
&#13;
一：配置think-migration&#13;
&#13;
在commond.php 中添加&#13;
&#13;
&#13;
&#13;
~~~&#13;
&lt;?php &#13;
return [ 'think\\migration\\command\\migrate\\Create',&#13;
    'think\\migration\\command\\migrate\\Run',&#13;
    'think\\migration\\command\\migrate\\Rollback',&#13;
    'think\\migration\\command\\migrate\\Status',&#13;
    'think\\migration\\command\\seed\\Create',&#13;
    'think\\migration\\command\\seed\\Run', ]; &#13;
~~~&#13;
&#13;
&#13;
&#13;
注意由于think-migration存放在thinkphp/vendor中 所以在think中需要将vendor加入auoload&#13;
&#13;
`require __DIR__.'/../thinkphp/vendor/autoload.php';`&#13;
&#13;
二：命令行运行&#13;
&#13;
 在命令行输入php think 可以看见&#13;
&#13;
![](https://images2015.cnblogs.com/blog/447797/201703/447797-20170323101103877-508042847.png)&#13;
&#13;
migrate:数据库迁移工具 seed:数据库填充工具&#13;
&#13;
主要讨论migrate:&#13;
&#13;
  migrate:create : 创建一个新的数据迁移类,php think migrate:create ,文件名须采用驼峰命名法&#13;
&#13;
  forexample:php think migrate:create ScProductImage 文件会在制定目录下生成一个php文件&#13;
&#13;
![](https://images2015.cnblogs.com/blog/447797/201703/447797-20170323102133361-523470162.png)&#13;
&#13;
＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊&#13;
&#13;
migrate:run : 完成数据迁移工作 `php think migrate:run`&#13;
&#13;
＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊＊&#13;
&#13;
migrate:status:查看migrate工作状态 `php think migrate:status`&#13;
&#13;
![](https://images2015.cnblogs.com/blog/447797/201703/447797-20170323102649471-1084055119.png)&#13;
&#13;
***********************************************************************************************&#13;
&#13;
  migrate:rollback : 回滚数据到指定的一个数据迁移版本 `php think migrate:rollback -t `&#13;
&#13;
   就是我们上图上面红框表示的值&#13;
&#13;
三：migrate文件编写&#13;
&#13;
     在migrate中有三个方法&#13;
&#13;
     up:在migrate:run时执行(前提是文件中不存在change方法)&#13;
&#13;
    down:在migrate:rollback时执行(前提是文件中不存在change方法)&#13;
&#13;
    change:migrate:run 和migrate:rollback时执行 (如果存在该方法 则不会去执行up 与down)。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/ThinkPhp5%20-shu-ju-qian-yi-%28think-migration%29.html</guid><pubDate>Thu, 01 Feb 2018 01:10:39 +0000</pubDate></item><item><title>阻止用户离开页面时确认的正确姿势</title><link>https://yangweijie.github.io/note/post/zu-zhi-yong-hu-li-kai-ye-mian-shi-que-ren-de-zheng-que-zi-shi.html</link><description>stackoverflow 说unload 中alert被浏览器 阻止了，只能在beforeunload 中返回字符串。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zu-zhi-yong-hu-li-kai-ye-mian-shi-que-ren-de-zheng-que-zi-shi.html</guid><pubDate>Sat, 20 Jan 2018 02:07:56 +0000</pubDate></item><item><title>swoole+inotify实现异步实时文件监控</title><link>https://yangweijie.github.io/note/post/swoole%2Binotify-shi-xian-yi-bu-shi-shi-wen-jian-jian-kong.html</link><description>## inotify扩展介绍&#13;
&#13;
inotify是Linux内核提供的一组系统调用，它可以监控文件系统操作，比如文件或者目录的创建、读取、写入、权限修改和删除等。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/swoole%2Binotify-shi-xian-yi-bu-shi-shi-wen-jian-jian-kong.html</guid><pubDate>Wed, 17 Jan 2018 02:56:43 +0000</pubDate></item><item><title>HTTP 499 状态码 nginx下 499错误</title><link>https://yangweijie.github.io/note/post/HTTP%20499%20-zhuang-tai-ma-%20nginx-xia-%20499-cuo-wu.html</link><description> 日志记录中HTTP状态码出现499错误有多种情况，我遇到的一种情况是nginx反代到一个永远打不开的后端，就这样了，日志状态记录是499、发送字节数是0。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/HTTP%20499%20-zhuang-tai-ma-%20nginx-xia-%20499-cuo-wu.html</guid><pubDate>Mon, 08 Jan 2018 06:08:14 +0000</pubDate></item><item><title> mysql float和double类型的区别</title><link>https://yangweijie.github.io/note/post/%20mysql%20float-he-double-lei-xing-de-qu-bie.html</link><description>1.float类型&#13;
float列类型默认长度查不到结果，必须指定精度，比如 &#13;
num float, insert into table (num) values (0.12); select * from table where num=0.12的话，empty set。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/%20mysql%20float-he-double-lei-xing-de-qu-bie.html</guid><pubDate>Wed, 06 Dec 2017 10:08:35 +0000</pubDate></item><item><title>basic 认证 php 获取失效问题</title><link>https://yangweijie.github.io/note/post/basic%20-ren-zheng-%20php%20-huo-qu-shi-xiao-wen-ti.html</link><description>用的php apidoc  有一个basic 认证 之前一直好好的，突然同事说 判断沙盒方式的错了。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/basic%20-ren-zheng-%20php%20-huo-qu-shi-xiao-wen-ti.html</guid><pubDate>Tue, 07 Nov 2017 09:48:17 +0000</pubDate></item><item><title>Nginx配置SSL证书部署HTTPS网站</title><link>https://yangweijie.github.io/note/post/Nginx-pei-zhi-SSL-zheng-shu-bu-shu-HTTPS-wang-zhan.html</link><description>**一、什么是 SSL 证书，什么是 HTTPS**&#13;
SSL 证书是一种数字证书，它使用 Secure Socket Layer 协议在浏览器和 Web 服务器之间建立一条安全通道，从而实现：&#13;
1、数据信息在客户端和服务器之间的加密传输，保证双方传递信息的安全性，不可被第三方窃听；&#13;
2、用户可以通过服务器证书验证他所访问的网站是否真实可靠。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Nginx-pei-zhi-SSL-zheng-shu-bu-shu-HTTPS-wang-zhan.html</guid><pubDate>Tue, 24 Oct 2017 07:17:31 +0000</pubDate></item><item><title>MySQL 对比数据库表结构</title><link>https://yangweijie.github.io/note/post/MySQL%20-dui-bi-shu-ju-ku-biao-jie-gou.html</link><description>介绍&#13;
本章主要介绍怎样对比数据库的表结构的差异，这里主要介绍使用mysqldiff工具来对比表结构的差异，其实在5.6版本之后通过查询information库中的系统表也能对比出来，但是mysqldiff还有一个好处就是可以直接生产差异的SQL语句这个功能就是我们需要利用的，而通过分析系统表要实现这个就比较难；接下来就来看看怎样使用这个工具。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/MySQL%20-dui-bi-shu-ju-ku-biao-jie-gou.html</guid><pubDate>Mon, 21 Aug 2017 09:49:47 +0000</pubDate></item><item><title>如何在Ubuntu上安装最新版本的Node.js</title><link>https://yangweijie.github.io/note/post/ru-he-zai-Ubuntu-shang-an-zhuang-zui-xin-ban-ben-de-Node.js.html</link><description>```&#13;
# apt-get update  &#13;
# apt-get install -y python-software-properties software-properties-common  &#13;
# add-apt-repository ppa:chris-lea/node.js  &#13;
# apt-get update  &#13;
# apt-get install nodejs  &#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/ru-he-zai-Ubuntu-shang-an-zhuang-zui-xin-ban-ben-de-Node.js.html</guid><pubDate>Sun, 13 Aug 2017 09:33:57 +0000</pubDate></item><item><title>git warning: LF will be replaced by CRLF解决</title><link>https://yangweijie.github.io/note/post/git%20warning-%20LF%20will%20be%20replaced%20by%20CRLF-jie-jue.html</link><description>初始化自己项目的时候，出现了N+个warning: LF will be replaced by CRLF，&#13;
&#13;
git config --global core.autocrlf false&#13;
&#13;
参考：http://stackoverflow.com/questions/1967370/git-is-saying-lf-will-be-replaced-by-crlf&#13;
&#13;
看来存入缓存的时候，不同的操作系统文件结尾返回不一样，所以的CRLF会被替换为LF。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/git%20warning-%20LF%20will%20be%20replaced%20by%20CRLF-jie-jue.html</guid><pubDate>Sat, 12 Aug 2017 03:00:19 +0000</pubDate></item><item><title>supervisor初体验</title><link>https://yangweijie.github.io/note/post/supervisor-chu-ti-yan.html</link><description>&#13;
&#13;
**1.安装**&#13;
&#13;
宿主机环境：（Centos7）&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-3d52bb0de044d78d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
宿主机环境&#13;
&#13;
#yum install python-setuptools&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-e10c50020df81643.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
yum install python-setuptools&#13;
&#13;
#easy_install supervisor&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-3efd1976de43fa03.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
easy_install supervisor&#13;
&#13;
**测试安装是否成功：**&#13;
&#13;
#echo_supervisord_conf&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-0fa69d64c0541fd4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
echo_supervisord_conf&#13;
&#13;
**2.创建配置文件**&#13;
&#13;
创建supervisor配置文件目录/etc/supervisor/&#13;
&#13;
#mkdir -m 755 -p /etc/supervisor/&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-a35442b3b3322d2f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
mkdir -m 755 -p /etc/supervisor/&#13;
&#13;
创建主配文件supervisord.conf&#13;
&#13;
#echo_supervisord_conf &gt; /etc/supervisor/supervisord.conf&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-57b2b291869440b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
echo_supervisord_conf &gt; /etc/supervisor/supervisord.conf&#13;
&#13;
创建项目配置文件目录&#13;
&#13;
# mkdir -m 755 conf.d&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-bdf1528dab7d0811.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
# mkdir -m 755 conf.d&#13;
&#13;
3.调试&#13;
&#13;
在/home/k1ic/supervisor_simple 目录下创建test.c&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-02ba4cf694e9a6f0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
test.c&#13;
&#13;
编译为test #gcc -o test test.c&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-cf151a9c4551a838.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
gcc -o test test.c&#13;
&#13;
在/etc/supervisor/conf.d 目录下创建 test.ini&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-941fcf9c291e0caf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
test.ini&#13;
&#13;
在主配文档中引入test.ini&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-7a827afc1b0a1460.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
files = ./conf.d/*.ini&#13;
&#13;
启动supervisor&#13;
&#13;
# supervisord -c /etc/supervisor/supervisord.conf&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-69e6e917e6739846.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
supervisord -c /etc/supervisor/supervisord.conf&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-b03469800dce2f08.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
pstree -p | grep supervisord&#13;
&#13;
查看supervisord.log发现program test已启动&#13;
&#13;
# cat /tmp/supervisord.log&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-5078fcc82a70ca05.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
# cat /tmp/supervisord.log&#13;
&#13;
用 supervisorctl 查看已经被监控的program（**注：直接用 #supervisorctl 会提示：http://localhost:9001 refused connection**）&#13;
&#13;
#supervisorctl -c /etc/supervisor/supervisord.conf&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-56c63f5d75495aa4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
supervisorctl -c /etc/supervisor/supervisord.conf&#13;
&#13;
增加一例监控php脚本&#13;
&#13;
创建skud.ini&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-a3dbfb53f038b47e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
skud.ini&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-727cca0530107c8d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
[program:skuld]&#13;
&#13;
在/home/k1ic/supervisor_simple目录下创建skuld.php&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-6b747b9cd5bf02e2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
skuld.php&#13;
&#13;
重启监控服务&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-e97398ee02681218.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
reload&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-c8322a7f66809846.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
pstree&#13;
&#13;
================分割线================&#13;
&#13;
**这才是重点^^**&#13;
&#13;
0\. supervisor 比较适合监控业务应用，且只能监控前台程序，**php fork方式实现的daemon不能用它监控，**否则supervisor&gt; status 会提示：**BACKOFF  Exited too quickly (process log may have details)**&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-e05f53999df42586.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
**BACKOFF  Exited too quickly (process log may have details)**&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-dd9a1b44b39d19e5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
cat supervisord.log&#13;
&#13;
1.每次修改配置文件后**需进入supervisorctl，执行reload**， 改动部分才能生效&#13;
&#13;
![](http://upload-images.jianshu.io/upload_images/35360-8aaf0b1f7e40807b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)&#13;
&#13;
reload&#13;
&#13;
2.两个命令&#13;
&#13;
supervisord : supervisor的服务器端部分，用于supervisor启动&#13;
&#13;
supervisorctl：启动supervisor的命令行窗口，在该命令行中可执行start、stop、status、reload等操作。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/supervisor-chu-ti-yan.html</guid><pubDate>Thu, 03 Aug 2017 06:20:28 +0000</pubDate></item><item><title>在CentOS 7上利用systemctl添加自定义系统服务</title><link>https://yangweijie.github.io/note/post/zai-CentOS%207-shang-li-yong-systemctl-tian-jia-zi-ding-yi-xi-tong-fu-wu.html</link><description>CentOS 7继承了RHEL 7的新的特性，例如强大的systemctl，而systemctl的使用也使得以往系统服务的/etc/init.d的启动脚本的方式就此改变，也大幅提高了系统服务的运行效率。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zai-CentOS%207-shang-li-yong-systemctl-tian-jia-zi-ding-yi-xi-tong-fu-wu.html</guid><pubDate>Thu, 03 Aug 2017 06:09:40 +0000</pubDate></item><item><title>php类库速查表升级</title><link>https://yangweijie.github.io/note/post/php-lei-ku-su-cha-biao-sheng-ji.html</link><description># 速查表 新版升级&#13;
&#13;
## 历史回顾&#13;
&#13;
我感叹于laravel的生态完好，tp5的类api的缺失（以前thinkphp3时代，帮助公司用apigen NetBeans里生成过一个[3.1版本的api](http://www.thinkphp.cn/api/)）。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/php-lei-ku-su-cha-biao-sheng-ji.html</guid><pubDate>Mon, 31 Jul 2017 14:36:32 +0000</pubDate></item><item><title>phper从st到vscode</title><link>https://yangweijie.github.io/note/post/phper-cong-st-dao-vscode.html</link><description># 是什么&#13;
&#13;
微软出的重新定义编码的一款免费开源跨平台的文本编辑器，媲美IDE。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/phper-cong-st-dao-vscode.html</guid><pubDate>Mon, 31 Jul 2017 09:59:45 +0000</pubDate></item><item><title>git 使用</title><link>https://yangweijie.github.io/note/post/git%20-shi-yong.html</link><description>参见 https://github.com/woai30231/webDevDetails/blob/master/13/readme.md。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/git%20-shi-yong.html</guid><pubDate>Mon, 31 Jul 2017 09:08:07 +0000</pubDate></item><item><title>提问的智慧（转）</title><link>https://yangweijie.github.io/note/post/ti-wen-de-zhi-hui-%EF%BC%88-zhuan-%EF%BC%89.html</link><description># 提问的智慧&#13;
&#13;
**How To Ask Questions The Smart Way**&#13;
&#13;
Copyright © 2001,2006,2014 Eric S. Raymond, Rick Moen&#13;
&#13;
本指南英文版版权为 Eric S. Raymond, Rick Moen 所有。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/ti-wen-de-zhi-hui-%EF%BC%88-zhuan-%EF%BC%89.html</guid><pubDate>Sat, 22 Jul 2017 00:54:29 +0000</pubDate></item><item><title>亲测，免费 “ 锐速 ” ，BBR 网络加速 可用！</title><link>https://yangweijie.github.io/note/post/qin-ce-%EF%BC%8C-mian-fei-%20%E2%80%9C%20-rui-su-%20%E2%80%9D%20%EF%BC%8CBBR%20-wang-luo-jia-su-%20-ke-yong-%EF%BC%81.html</link><description>| kernel 4.9版本后的内核新增了一款TCP拥塞控制技术：BBR，这个是好东西。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/qin-ce-%EF%BC%8C-mian-fei-%20%E2%80%9C%20-rui-su-%20%E2%80%9D%20%EF%BC%8CBBR%20-wang-luo-jia-su-%20-ke-yong-%EF%BC%81.html</guid><pubDate>Wed, 12 Jul 2017 15:28:40 +0000</pubDate></item><item><title>小米笔记本安装 ubuntu 后，wifi 无法使用的解决方案：</title><link>https://yangweijie.github.io/note/post/xiao-mi-bi-ji-ben-an-zhuang-%20ubuntu%20-hou-%EF%BC%8Cwifi%20-wu-fa-shi-yong-de-jie-jue-fang-an-%EF%BC%9A.html</link><description>~~~ shell&#13;
vi /etc/modprobe.d/blacklist.conf&#13;
~~~&#13;
&#13;
最后一行加入&#13;
&#13;
~~~ conf&#13;
blacklist acer-wmi&#13;
~~~&#13;
&#13;
保存退出重启就好了。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/xiao-mi-bi-ji-ben-an-zhuang-%20ubuntu%20-hou-%EF%BC%8Cwifi%20-wu-fa-shi-yong-de-jie-jue-fang-an-%EF%BC%9A.html</guid><pubDate>Mon, 10 Jul 2017 23:46:37 +0000</pubDate></item><item><title>Javascript  取模运算、取商、取整方法</title><link>https://yangweijie.github.io/note/post/Javascript%20%20-qu-mo-yun-suan-%E3%80%81-qu-shang-%E3%80%81-qu-zheng-fang-fa.html</link><description>~~~ js&#13;
//求余数  &#13;
document.write(1%4);  &#13;
document.write(6%4);  &#13;
//求商  &#13;
console.info(1/4);  &#13;
console.info(6/4);  &#13;
//求商，取整  &#13;
console.info(parseInt(1/4));  &#13;
console.info(parseInt(6/4));  &#13;
console.info('----');  &#13;
//天花板取整  &#13;
console.info(Math.ceil(1/4));  &#13;
//地板取整  &#13;
console.info(Math.floor(1/4));&#13;
&#13;
~~~&#13;
&#13;
![](http://zhijia-10060660.file.myqcloud.com/article/images/20170315151213_541.png)。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Javascript%20%20-qu-mo-yun-suan-%E3%80%81-qu-shang-%E3%80%81-qu-zheng-fang-fa.html</guid><pubDate>Mon, 10 Jul 2017 23:44:40 +0000</pubDate></item><item><title>vue2 点击事件在ios下卡顿， 用fastclick就好了</title><link>https://yangweijie.github.io/note/post/vue2%20-dian-ji-shi-jian-zai-ios-xia-qia-dun-%EF%BC%8C%20-yong-fastclick-jiu-hao-le.html</link><description>RT。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/vue2%20-dian-ji-shi-jian-zai-ios-xia-qia-dun-%EF%BC%8C%20-yong-fastclick-jiu-hao-le.html</guid><pubDate>Mon, 10 Jul 2017 23:43:34 +0000</pubDate></item><item><title>phpStrom激活</title><link>https://yangweijie.github.io/note/post/phpStrom-ji-huo.html</link><description>[https://www.iteblog.com/idea/](https://www.iteblog.com/idea/)。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/phpStrom-ji-huo.html</guid><pubDate>Mon, 10 Jul 2017 23:42:41 +0000</pubDate></item><item><title>Vue watch 方法得这么写才正确，才能wath对象属性变化</title><link>https://yangweijie.github.io/note/post/Vue%20watch%20-fang-fa-de-zhe-me-xie-cai-zheng-que-%EF%BC%8C-cai-neng-wath-dui-xiang-shu-xing-bian-hua.html</link><description>``` js&#13;
var app = new Vue({&#13;
    el: '#app',&#13;
    data: {&#13;
        form: {&#13;
            param: {&#13;
                cleanup: false,&#13;
                useInlineStylesBlock: false,&#13;
                stripOriginalStyleTags: false,&#13;
                excludeMediaQueries: true,&#13;
                excludeConditionalInlineStylesBlock: true,&#13;
            },&#13;
            style: '',&#13;
            content: '',&#13;
        },&#13;
        afterParse:''&#13;
    },&#13;
    watch: {&#13;
        form: {&#13;
            handler:function (newVal, oldVal) {&#13;
                    axios.post($('[name=form]').attr('action'), {&#13;
                        param:this.form&#13;
                    })&#13;
                    .then(function (response) {&#13;
                        this.afterParse = response;&#13;
                    })&#13;
                    .catch(function (error) {&#13;
                        console.log(error);&#13;
                        alert('网络出错了');&#13;
                    });&#13;
                },&#13;
                deep:true&#13;
        }&#13;
    }&#13;
})  &#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Vue%20watch%20-fang-fa-de-zhe-me-xie-cai-zheng-que-%EF%BC%8C-cai-neng-wath-dui-xiang-shu-xing-bian-hua.html</guid><pubDate>Mon, 10 Jul 2017 23:41:36 +0000</pubDate></item><item><title>给前端的微信图文编辑器</title><link>https://yangweijie.github.io/note/post/gei-qian-duan-de-wei-xin-tu-wen-bian-ji-qi.html</link><description>微信公众号编辑器，在公司和前端处理图文消息预览和实际发送不一致问题，研究开发出此工具，基于tp5，codemirror，ueditor、vue和CssToInlineStyles&#13;
&#13;
直接将css+html 转换为html和行内样式，方便发布时复制，并且提供了预览&#13;
&#13;
同时 这样的转换处理支持 email outlook&#13;
&#13;
首页：[http://5000.gr24ae8f.jaylabs.xunda-bj.goodrain.net:10080](http://5000.gr24ae8f.jaylabs.xunda-bj.goodrain.net:10080/)&#13;
&#13;
效果图：![](http://zhijia-10060660.file.myqcloud.com/article/images/20170322080756_148.png)&#13;
&#13;
git 地址 [https://git.coding.net/jaylabs/wechat_msg_editor.git](https://git.coding.net/jaylabs/wechat_msg_editor.git)。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/gei-qian-duan-de-wei-xin-tu-wen-bian-ji-qi.html</guid><pubDate>Mon, 10 Jul 2017 23:39:30 +0000</pubDate></item><item><title>js停止浏览器加载：</title><link>https://yangweijie.github.io/note/post/js-ting-zhi-liu-lan-qi-jia-zai-%EF%BC%9A.html</link><description>~~~ js&#13;
window.stop();&#13;
~~~。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/js-ting-zhi-liu-lan-qi-jia-zai-%EF%BC%9A.html</guid><pubDate>Mon, 10 Jul 2017 23:37:41 +0000</pubDate></item><item><title>tp3.2 的动态验证 范围验证</title><link>https://yangweijie.github.io/note/post/tp3.2%20-de-dong-tai-yan-zheng-%20-fan-wei-yan-zheng.html</link><description>~~~ php&#13;
        $model = M();&#13;
        $rules = [&#13;
            ['a', '1,2', '不支持的商户经营类型',0, 'in'],&#13;
        ];&#13;
        $ret = $model-&gt;validate($rules)-&gt;create(['a'=&gt;2]);&#13;
        dump($ret);&#13;
        die;&#13;
~~~&#13;
&#13;
字段、范围值，提示，验证时间，in。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/tp3.2%20-de-dong-tai-yan-zheng-%20-fan-wei-yan-zheng.html</guid><pubDate>Mon, 10 Jul 2017 23:36:44 +0000</pubDate></item><item><title>php 整洁之道</title><link>https://yangweijie.github.io/note/post/php%20-zheng-ji-zhi-dao.html</link><description>[php-code-clean](https://github.com/yangweijie/clean-code-php)。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/php%20-zheng-ji-zhi-dao.html</guid><pubDate>Mon, 10 Jul 2017 23:35:55 +0000</pubDate></item><item><title>mubu.com－颠覆法律人工作方式（动图演示）</title><link>https://yangweijie.github.io/note/post/mubu.com%EF%BC%8D-dian-fu-fa-lv-ren-gong-zuo-fang-shi-%EF%BC%88-dong-tu-yan-shi-%EF%BC%89.html</link><description>&gt; 作者：夏海珠 北京市盈科（广州）律师事务所 本人转载&#13;
&#13;
还在用普通文档进行工作安排？&#13;
&#13;
还在用word记录笔记？&#13;
&#13;
想一键生成思维导图？&#13;
&#13;
想用随手随地更新文件？&#13;
&#13;
mubuio（幕布）将带给你一个更高效的方式！&#13;
&#13;
跟着笔者，从现在开始尝试一种简单直观的管理方法 ！&#13;
&#13;
再也不做加班狗！&#13;
&#13;
mubuio－颠覆法律人工作方式（动图演示） 基本操作 应用场景 工作清单 读书、课程笔记 思维导图 会议记录 微信同步&#13;
&#13;
# 基本操作&#13;
&#13;
一般情况下，在浏览器输入：[http://mubu.io](https://mubu.com/inv/19590)，跳转进入幕布。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/mubu.com%EF%BC%8D-dian-fu-fa-lv-ren-gong-zuo-fang-shi-%EF%BC%88-dong-tu-yan-shi-%EF%BC%89.html</guid><pubDate>Mon, 10 Jul 2017 23:33:47 +0000</pubDate></item><item><title>MySQL按照汉字的拼音排序、按照首字母分类</title><link>https://yangweijie.github.io/note/post/MySQL-an-zhao-han-zi-de-pin-yin-pai-xu-%E3%80%81-an-zhao-shou-zi-mu-fen-lei.html</link><description>~~~ sql&#13;
ORDER BY convert(name using gbk) ASC&#13;
~~~。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/MySQL-an-zhao-han-zi-de-pin-yin-pai-xu-%E3%80%81-an-zhao-shou-zi-mu-fen-lei.html</guid><pubDate>Mon, 10 Jul 2017 23:32:13 +0000</pubDate></item><item><title>怎么更改AppData文件夹的路径?</title><link>https://yangweijie.github.io/note/post/zen-me-geng-gai-AppData-wen-jian-jia-de-lu-jing--.html</link><description>*   首先要在“开始”——“运行”内输入“regedit”打开注册表编辑器，然后要在“文件”下拉菜单中的“导出”功能备份好注册表，以防万一，接着在左侧窗口依次打开： `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders`&#13;
*   在右侧窗口里，你看到的“名称”就代表那些特殊的文件夹，“数据”就是它们所对应的默认存储路径。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zen-me-geng-gai-AppData-wen-jian-jia-de-lu-jing--.html</guid><pubDate>Mon, 10 Jul 2017 23:31:20 +0000</pubDate></item><item><title>数据导入报错：Got a packet bigger than‘max_allowed_packet’bytes的问题</title><link>https://yangweijie.github.io/note/post/shu-ju-dao-ru-bao-cuo-%EF%BC%9AGot%20a%20packet%20bigger%20than%E2%80%98max_allowed_packet%E2%80%99bytes-de-wen-ti.html</link><description>2个解决方法：&#13;
&#13;
1.临时修改：`mysql&gt;set global max_allowed_packet=524288000;修改 #512M`&#13;
&#13;
2.修改my.cnf，需重启mysql。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/shu-ju-dao-ru-bao-cuo-%EF%BC%9AGot%20a%20packet%20bigger%20than%E2%80%98max_allowed_packet%E2%80%99bytes-de-wen-ti.html</guid><pubDate>Mon, 10 Jul 2017 23:30:13 +0000</pubDate></item><item><title>PHP获取上周、本周、上月、本月、本季度、上季度时间方法大全</title><link>https://yangweijie.github.io/note/post/PHP-huo-qu-shang-zhou-%E3%80%81-ben-zhou-%E3%80%81-shang-yue-%E3%80%81-ben-yue-%E3%80%81-ben-ji-du-%E3%80%81-shang-ji-du-shi-jian-fang-fa-da-quan.html</link><description>```php&#13;
/**date 2015-04-11&#13;
     * author http://www.lai18.com&#13;
     **/&#13;
    echo date('Ymd',strtotime('now')), '\n';&#13;
    echo date('Ymd',strtotime('-1 week Monday')), '\n';&#13;
    echo date('Ymd',strtotime('-1 week Sunday')), '\n';&#13;
    echo date('Ymd',strtotime('+0 week Monday')), '\n';&#13;
    echo date('Ymd',strtotime('+0 week Sunday')), '\n';&#13;
&#13;
    echo '*********第几个月:';&#13;
    echo date('n');&#13;
    echo '*********本周周几:';&#13;
    echo date('w');&#13;
    echo '*********本月天数:';&#13;
    echo date('t');&#13;
    echo '*********';&#13;
&#13;
    echo '&lt;br&gt;上周起始时间:&lt;br&gt;';&#13;
    echo date('Y-m-d H:i:s',mktime(0, 0 , 0,date('m'),date('d')-date('w')+1-7,date('Y'))),'\n';&#13;
    echo date('Y-m-d H:i:s',mktime(23,59,59,date('m'),date('d')-date('w')+7-7,date('Y'))),'\n';&#13;
    echo '&lt;br&gt;本周起始时间:&lt;br&gt;';&#13;
    echo date('Y-m-d H:i:s',mktime(0, 0 , 0,date('m'),date('d')-date('w')+1,date('Y'))),'\n';&#13;
    echo date('Y-m-d H:i:s',mktime(23,59,59,date('m'),date('d')-date('w')+7,date('Y'))),'\n';&#13;
&#13;
    echo '&lt;br&gt;上月起始时间:&lt;br&gt;';&#13;
    echo date('Y-m-d H:i:s',mktime(0, 0 , 0,date('m')-1,1,date('Y'))),'\n';&#13;
    echo date('Y-m-d H:i:s',mktime(23,59,59,date('m') ,0,date('Y'))),'\n';&#13;
    echo '&lt;br&gt;本月起始时间:&lt;br&gt;';&#13;
    echo date('Y-m-d H:i:s',mktime(0, 0 , 0,date('m'),1,date('Y'))),'\n';&#13;
    echo date('Y-m-d H:i:s',mktime(23,59,59,date('m'),date('t'),date('Y'))),'\n';&#13;
&#13;
    $season = ceil((date('n'))/3);//当月是第几季度&#13;
    echo '&lt;br&gt;本季度起始时间:&lt;br&gt;';&#13;
    echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),'\n';&#13;
    echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date('Y'))),date('Y'))),'\n';&#13;
&#13;
    $season = ceil((date('n'))/3)-1;//上季度是第几季度&#13;
    echo '&lt;br&gt;上季度起始时间:&lt;br&gt;';&#13;
    echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),'\n';&#13;
    echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date('Y'))),date('Y'))),'\n';&#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/PHP-huo-qu-shang-zhou-%E3%80%81-ben-zhou-%E3%80%81-shang-yue-%E3%80%81-ben-yue-%E3%80%81-ben-ji-du-%E3%80%81-shang-ji-du-shi-jian-fang-fa-da-quan.html</guid><pubDate>Mon, 10 Jul 2017 23:28:29 +0000</pubDate></item><item><title>thinkphp5 速查表</title><link>https://yangweijie.github.io/note/post/thinkphp5%20-su-cha-biao.html</link><description>[https://yangweijie.github.io/thinkphp-lts/](https://yangweijie.github.io/thinkphp-lts/)&#13;
&#13;
![](http://zhijia-10060660.file.myqcloud.com/article/images/20170501072145_184.png)终于完成了thinkphp5的 速查表，同时开发了一个海豚cms的速查表插件，如果有想生成框架速查表的同学可以联系我。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/thinkphp5%20-su-cha-biao.html</guid><pubDate>Mon, 10 Jul 2017 23:27:32 +0000</pubDate></item><item><title>tp5 最新版 数据集查询后 调用内置分页后 想修改分页过的数据 补充额外字段</title><link>https://yangweijie.github.io/note/post/tp5%20-zui-xin-ban-%20-shu-ju-ji-cha-xun-hou-%20-diao-yong-nei-zhi-fen-ye-hou-%20-xiang-xiu-gai-fen-ye-guo-de-shu-ju-%20-bu-chong-e-wai-zi-duan.html</link><description>tp5 最新版 数据集查询后 调用内置分页后 想修改分页过的数据 补充额外字段 可以用collection 的 offsetSet 方法&#13;
&#13;
~~~php&#13;
$productCategory = Db::name('ProductCategory')-&gt;alias('a')-&gt;field('a.id,a.category_name,a.discount,a.order_index,count(b.id) as product_num')&#13;
          -&gt;join('kwy_product b', 'b.product_category_id =a.id', 'left')-&gt;where($where)-&gt;group('a.id')-&gt;order('a.order_index asc')-&gt;paginate(10);&#13;
&#13;
        foreach($productCategory-&gt;all() as $key =&gt;$val ){&#13;
            $productCategory-&gt;offsetSet($key, array_merge($val, ['sex'=&gt;1]));&#13;
        }&#13;
~~~&#13;
&#13;
完成获取器的操作 以后可能支持分页类对象的each 方法修改数据。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/tp5%20-zui-xin-ban-%20-shu-ju-ji-cha-xun-hou-%20-diao-yong-nei-zhi-fen-ye-hou-%20-xiang-xiu-gai-fen-ye-guo-de-shu-ju-%20-bu-chong-e-wai-zi-duan.html</guid><pubDate>Mon, 10 Jul 2017 23:25:48 +0000</pubDate></item><item><title>在windows 命令行中打开 当前目录</title><link>https://yangweijie.github.io/note/post/zai-windows%20-ming-ling-xing-zhong-da-kai-%20-dang-qian-mu-lu.html</link><description>~~~shell&#13;
explorer .&#13;
~~~。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/zai-windows%20-ming-ling-xing-zhong-da-kai-%20-dang-qian-mu-lu.html</guid><pubDate>Mon, 10 Jul 2017 23:24:47 +0000</pubDate></item><item><title>MySQL 监控相关常用查询</title><link>https://yangweijie.github.io/note/post/MySQL%20-jian-kong-xiang-guan-chang-yong-cha-xun.html</link><description>~~~ sql&#13;
--查看MySQL本次启动后的运行时间(单位：秒)&#13;
show status like 'uptime';&#13;
&#13;
--查看select语句的执行数&#13;
show [global] status like 'com_select';&#13;
&#13;
--查看insert语句的执行数&#13;
show [global] status like 'com_insert';&#13;
&#13;
--查看update语句的执行数&#13;
show [global] status like 'com_update';&#13;
&#13;
--查看delete语句的执行数&#13;
show [global] status like 'com_delete';&#13;
&#13;
--查看试图连接到MySQL(不管是否连接成功)的连接数&#13;
show status like 'connections';&#13;
&#13;
--查看线程缓存内的线程的数量。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/MySQL%20-jian-kong-xiang-guan-chang-yong-cha-xun.html</guid><pubDate>Mon, 10 Jul 2017 23:21:36 +0000</pubDate></item><item><title>HTML 转 PDF 之 wkhtmltopdf 工具简介  术语定义</title><link>https://yangweijie.github.io/note/post/HTML%20-zhuan-%20PDF%20-zhi-%20wkhtmltopdf%20-gong-ju-jian-jie-%20%20-shu-yu-ding-yi.html</link><description>## 术语定义&#13;
&#13;
### 文档对象&#13;
&#13;
“文档对象”是指PDF文档中的文档对象，共有三种类型的“文档对象”，他们分别是“页面对象”，“封面对象”和“目录对象”。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/HTML%20-zhuan-%20PDF%20-zhi-%20wkhtmltopdf%20-gong-ju-jian-jie-%20%20-shu-yu-ding-yi.html</guid><pubDate>Mon, 10 Jul 2017 23:20:12 +0000</pubDate></item><item><title>css设置各种中文字体如雅黑、黑体、宋体、楷体等等</title><link>https://yangweijie.github.io/note/post/css-she-zhi-ge-zhong-zhong-wen-zi-ti-ru-ya-hei-%E3%80%81-hei-ti-%E3%80%81-song-ti-%E3%80%81-kai-ti-deng-deng.html</link><description>~~~ css&#13;
.selector{ font-family:'Microsoft YaHei',微软雅黑,'MicrosoftJhengHei',华文细黑,STHeiti,MingLiu }&#13;
~~~&#13;
&#13;
加上中文名“微软雅黑”是为了兼容opera。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/css-she-zhi-ge-zhong-zhong-wen-zi-ti-ru-ya-hei-%E3%80%81-hei-ti-%E3%80%81-song-ti-%E3%80%81-kai-ti-deng-deng.html</guid><pubDate>Mon, 10 Jul 2017 23:15:14 +0000</pubDate></item><item><title>慕课手机客户端缓存的视频，存储路径在哪里？</title><link>https://yangweijie.github.io/note/post/mu-ke-shou-ji-ke-hu-duan-huan-cun-de-shi-pin-%EF%BC%8C-cun-chu-lu-jing-zai-na-li-%EF%BC%9F.html</link><description>~~~ shell&#13;
/storage/sdcard0/Android/data/cn.com.open.mooc/Mooc/video/&#13;
~~~。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/mu-ke-shou-ji-ke-hu-duan-huan-cun-de-shi-pin-%EF%BC%8C-cun-chu-lu-jing-zai-na-li-%EF%BC%9F.html</guid><pubDate>Mon, 10 Jul 2017 23:13:42 +0000</pubDate></item><item><title>查看某个表的字段结构：</title><link>https://yangweijie.github.io/note/post/cha-kan-mou-ge-biao-de-zi-duan-jie-gou-%EF%BC%9A.html</link><description>```sql&#13;
DESC persons;&#13;
&#13;
DESCRIBE persons;&#13;
&#13;
SHOW columns FROM persons;&#13;
```。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/cha-kan-mou-ge-biao-de-zi-duan-jie-gou-%EF%BC%9A.html</guid><pubDate>Mon, 10 Jul 2017 23:12:07 +0000</pubDate></item><item><title>wamp安装php扩展</title><link>https://yangweijie.github.io/note/post/wamp-an-zhuang-php-kuo-zhan.html</link><description>pecl的mongodb扩展链接我们很多开发工作都要在windows下进行，但是在windows下给这些脚本程序安装一些插件扩展都比较麻烦，没有办法像linux环境一样一行命令完成，这里我在为PHP安装mongodb扩展的时候遇到了一些问题，特此写一遍wamp安装php扩展的教程。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/wamp-an-zhuang-php-kuo-zhan.html</guid><pubDate>Mon, 10 Jul 2017 23:10:33 +0000</pubDate></item><item><title>JS/jQuery 遍历对象属性</title><link>https://yangweijie.github.io/note/post/JS-jQuery%20-bian-li-dui-xiang-shu-xing.html</link><description>## Javascript For/In 循环： 循环遍历对象的属性&#13;
&#13;
~~~ js&#13;
var person={fname:'John',lname:'Doe',age:25};  &#13;
&#13;
for (x in person)  {  &#13;
   txt=txt + person[x];  &#13;
}&#13;
&#13;
~~~ js&#13;
&#13;
结果：JohnDoe25&#13;
&#13;
## jQuery jQuery.each() 遍历对象属性&#13;
&#13;
~~~ js&#13;
var arr = ['one', 'two', 'three', 'four', 'five'];  &#13;
var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 };&#13;
&#13;
~~~&#13;
&#13;
### 遍历数组&#13;
&#13;
~~~ js&#13;
var text = 'Array ';  &#13;
jQuery.each(arr, function(i, val) {  &#13;
    text = text + ' #Index:' + i + ':' + val;  &#13;
});  &#13;
&#13;
console.log(text);&#13;
&#13;
~~~&#13;
&#13;
//Array #Index:0:one #Index:1:two #Index:2:three #Index:3:four #Index:4:five&#13;
&#13;
### 遍历对象&#13;
&#13;
~~~&#13;
text = 'Object ';  &#13;
jQuery.each(obj, function(i, val) {  &#13;
    text = text + 'Key:' + i + ', Value:' + val; &#13;
});  &#13;
&#13;
console.log(text);  &#13;
&#13;
//Object Key:one, Value:1Key:two, Value:2Key:three, Value:3Key:four, Value:4Key:five,&#13;
~~~。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/JS-jQuery%20-bian-li-dui-xiang-shu-xing.html</guid><pubDate>Mon, 10 Jul 2017 23:08:00 +0000</pubDate></item><item><title>composer 更新thinkphp5.0 稳定版为开发版</title><link>https://yangweijie.github.io/note/post/composer%20-geng-xin-thinkphp5.0%20-wen-ding-ban-wei-kai-fa-ban.html</link><description>想用composer 更新当前tp5为5.1dev 版 只需要将composer.json think/framework 的版本 改为&#13;
&#13;
~~~ php&#13;
5.0dev&#13;
&#13;
~~~&#13;
&#13;
然后用&#13;
&#13;
~~~ shell&#13;
composer update&#13;
&#13;
~~~&#13;
&#13;
就可以更新了。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/composer%20-geng-xin-thinkphp5.0%20-wen-ding-ban-wei-kai-fa-ban.html</guid><pubDate>Mon, 10 Jul 2017 23:05:03 +0000</pubDate></item><item><title>给通过书签给chrome控制台添加jquery支持</title><link>https://yangweijie.github.io/note/post/gei-tong-guo-shu-qian-gei-chrome-kong-zhi-tai-tian-jia-jquery-zhi-chi.html</link><description>~~~ javascript&#13;
javascript:(function(){ var jq = document.createElement('script');  jq.src = 'http://apps.bdimg.com/libs/jquery/1.8.3/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(jq);  jQuery.noConflict();})();&#13;
~~~。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/gei-tong-guo-shu-qian-gei-chrome-kong-zhi-tai-tian-jia-jquery-zhi-chi.html</guid><pubDate>Mon, 10 Jul 2017 23:02:54 +0000</pubDate></item><item><title>查找端口占用进程</title><link>https://yangweijie.github.io/note/post/cha-zhao-duan-kou-zhan-yong-jin-cheng.html</link><description>今天发现启动不了apache 看windows 事件查看器 发现提示日志写不了。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/cha-zhao-duan-kou-zhan-yong-jin-cheng.html</guid><pubDate>Mon, 10 Jul 2017 23:01:26 +0000</pubDate></item><item><title>base64格式 如何获取图片大小</title><link>https://yangweijie.github.io/note/post/base64-ge-shi-%20-ru-he-huo-qu-tu-pian-da-xiao.html</link><description>&#13;
今天 微信群友问了一句 base64格式 如何获取图片大小，我想了下 有个`getimagesizefromstring` 函数 可以获取，让他看手册，结果他说能不能不存获取。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/base64-ge-shi-%20-ru-he-huo-qu-tu-pian-da-xiao.html</guid><pubDate>Mon, 10 Jul 2017 22:59:04 +0000</pubDate></item><item><title>Hello World!</title><link>https://yangweijie.github.io/note/post/Hello%20World%21.html</link><description># 从花哨回归内容&#13;
&#13;
经历过pjblog、点点、oneblog、阿里云，由于经费的原因，还有开发精力的原因，个人动态php博客暂时停止，从折腾 走向 极简。</description><guid isPermaLink="true">https://yangweijie.github.io/note/post/Hello%20World%21.html</guid><pubDate>Mon, 10 Jul 2017 15:42:27 +0000</pubDate></item></channel></rss>