参考地址:http://www.cnblogs.com/sandea/p/5714830.html 1.不通过日志获取AR执行的原生SQL语句和打印变量数据 $query = User::find() ->select(['username'])->where(['id'=>[1,2,3,4]) // get the AR raw sql in YII2 $commandQuery = clone $query; echo $commandQuery->createCommand(…
Composer 是新一代的PHP依赖管理工具.本文介绍使用Composer的五个小技巧,希望能给你的PHP开发带来方便. 1. 仅更新单个库 只想更新某个特定的库,不想更新它的所有依赖,很简单 composer update foo/bar 此外,这个技巧还可以用来解决“警告信息问题”.你一定见过这样的警告信息: Warning: The lock file is not up to date with the latest changes in composer.json, you may…