1. 安装
npm install uglify-js -g
2. 单文件压缩
uglifyjs .\u17.js -o u17.min.js
3. 谁教下我怎么混淆?
1. 安装
npm install uglify-js -g
2. 单文件压缩
uglifyjs .\u17.js -o u17.min.js
3. 谁教下我怎么混淆?
假设你的项目项目使用composer
1. 安装,为了兼容php5.4使用的是1.x版本
composer require twig/twig:~1.0
2. 封装为trait以集成
namespace objects\Traits;
trait DoufuTwig {
/**
* @var \Twig_Environment
*/
private $twig;
protected function renderTwig($path, $data = []) {
if (! $this->twig) {
$loader = new \Twig_Loader_Filesystem(APPPATH . 'views');
$this->twig = new \Twig_Environment($loader,
array(
'cache' => APPPATH . 'cache',
'auto_reload' => true
));
}
return $this->twig->render($path, $data);
}
}
3. 使用
集成到控制器父类
namespace Ncontrollers;
use objects\Traits\DoufuTwig;
abstract class Controller
{
use DoufuTwig;
}
控制器内使用
...
echo $this->renderTwig('xxx/login.html');
...
xtrabackup –backup –compress –target-dir=/mysqlbackup/full –user=aaa –host=hostname –password=xxxx –databases=ggggg
xtrabackup –backup –compress –target-dir=/mysqlbackup/incr –incremental-basedir=/mysqlbackup/full –user=aaa –host=hostname –password=xxxx –databases=ggggg
–compress 压缩
<br />
<b>Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data’ to ‘-1’ in php.ini and use the php://input stream instead. in
<b>Unknown</b> on line
<b>0</b>
<br />
<br />
<b>Warning</b>: Cannot modify header information – headers already sent in
<b>Unknown</b> on line
<b>0</b>
<br />
edit php.ini and set always_populate_raw_post_data = -1
; Always populate the $HTTP_RAW_POST_DATA variable. PHP’s default behavior is
; to disable this feature and it will be removed in a future version.
; If post reading is disabled through enable_post_data_reading,
; $HTTP_RAW_POST_DATA is *NOT* populated.
; http://php.net/always-populate-raw-post-data
always_populate_raw_post_data = -1

令人无语bug,你猜得没错是编码问题我的编码是utf8mb4_unicode_ci,这是laravel的默认编码啊,解决办法是使用 utf8mb4_bin 即可。。。。
api.xxxx.com/aaa 页面下setcookie,
api.xxxx.com/xxx,cookie 有效
api.xxxx.com/index.php/xxx,cookie 无效
其实是cookie path的问题
setcookie($key, $value, null, ‘/’, null, null);
切换到root用户执行pecl命令,当前用户没有php程序目录的写入权限
今天维修公司笔记本,开机显示
stuck key XX
上网查询到是键盘某个键处于按下状态,无法弹起
XX就是坏掉的键的编码
键盘码参考
http://flint.cs.yale.edu/cs422/doc/art-of-asm/pdf/APNDXC.PDF
empty
(PHP 4, PHP 5, PHP 7)
empty — 检查一个变量是否为空
说明 ¶
bool empty ( mixed $var )
判断一个变量是否被认为是空的。当一个变量并不存在,或者它的值等同于FALSE,那么它会被认为不存在。如果变量不存在的话,empty()并不会产生警告。
Note:
在 PHP 5.5 之前,empty() 仅支持变量;任何其他东西将会导致一个解析错误。换言之,下列代码不会生效: empty(trim($name))。 作为替代,应该使用trim($name) == false.