使用save和updateAll 方法时,有时会遇到带引号的字符串,直接保存会报错,可以使用下面的方法:
$db = $this->model->getDataSource();
$db->value($value,'string');
HTTPDUSER=`ps aux | grep -E 'nobody|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
setfacl -R -m u:${HTTPDUSER}:rwx app/tmp
setfacl -R -d -m u:${HTTPDUSER}:rwx app/tmp
修复报错cakephp Warning (2): count() [function.count]: Parameter must be an array or an object that implements Countable [CORE/src/Database/QueryCompiler.php, line 126
https://github.com/cakephp/cakephp/blob/master/src/Database/QueryCompiler.php#L128
当 session engine 为 CacheSession 时 ,调用logout时会报 Warning: Warning (2): session_regenerate_id(): Session object destruction failed. ID: user (path: /tmp)。 解决办法: https://github.com/cakephp/cakephp/commit/e808b70d431caa6d850f7531bec1f728c84d5442
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
setfacl -R -m u:${HTTPDUSER}:rwx storage/
setfacl -R -m u:${HTTPDUSER}:rwx bootstrap/cache/
php excel 内容第一个字符不能为=,会报错PHPExcel_Calculation_Exception, 解决办法:内容前面添加一个Ascii char number 0 (zero)。
$text= chr(0).$text;