Drupal core版本:core\lib\Drpual.php ;在每次drupal内核发布的时候应该有自动化脚本更新。
wrk压力测试工具使用注意事项
wrk --timeout 10 --latency -t 1 -c 1 -d10 "https://www.dplor.com/"
1. 如果测试结果中出现大量timeout,使用--timeout参数。因为wrk默认超时时间是2s
2. 添加--latency可以返回响应时间
3. 站点url请以"/"结尾。比如如果压力测试本博客,url是https://www.dplor.com/ 。如果忽略最后一个/,结果会差异很大。
本博客升级到Drupal 9了
周末有空,趁着Drupal 9发布了,也把本博客从Drupal 7升级到了Drupal 9。
因为内容比较简单,直接使用drupal自带的升级工具升级。
theme没法升级,但是内容都迁移过来了。
总体来说还比较简单方便。
Drupal 8 commerce composer依赖关系图
commerce kickstart目前看起来不支持drupal 8,取而代之的是drupalcommerce/demo-project。 按照官方的版本库来推测,默认drupal commerce项目,应该都是从drupalcommerce/project-base开始创建。
Drupal 8 http client代码及其代理设置
Drupal 8 使用代理(目前看下来只支持http(s)代理,不支持socks代理)。如果启用代理,在settings.php添加如下参数:
Drupal8 常用API
##获取当前用户$current_user = \Drupal::currentUser();$user = \Drupal\user\Entity\User::load($current_user->id());// or just$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
entity query
dev子域名在chrome浏览器下强制跳转为https的解释
最近发现,在chrome浏览器里面,所有的*.dev域名,都被强制跳转到https,哪怕手工输入http://x.dev,也会被强制跳转为https://x.dev。这个给开发带来很多困扰。
经过调查,发现这个问题,在chrome浏览器无解。原因如下:
.dev这个顶级域名被google拥有。
chrome浏览器在代码级别限制.dev跳转为https。
除了.dev这个,如下顶级域名,在chrome浏览器下,也会强制跳转到https:
.google .foo .page .app .chrome
解决办法如下:
-
避免使用chrome浏览器
-
如果上面要求做不到,那么就避开使用如上的域名作为开发使用,使用.test .localhost等替代。
drush使用代理
drush与网络的交互,是通过curl或者wget.
drush本身不提供代理功能,但是可以通过设置curl或者wget代理从而实现drush的代理下载功能.
针对curl方式的socks5代理上网,如下是两种配置方式.推荐第二种:
第一种:
export http_proxy=socks5h://10.10.10.100:2080 https_proxy=socks5h://10.10.10.100:2080
第二种:
vi ~/.curlrc proxy=socks5h://10.10.10.100:2080
扩展:curl命令行使用代理:
curl -x socks5h://10.10.10.100:2080 google.com
drupal8快速安装
#下载代码 composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction #使用drupal console安装.省的在界面上一步步点击. drupal si standard --langcode="en" --db-type="mysql" --db-host="mysql" --db-name="drupal8_test" --db-port="3306" --db-user="root" --db-pass="Abcd1234" --site-name="drupal 8" --site-mail="example@a.com" --account-name="admin" --account-mail="admin@example.com" --account-pass="password"
MySql 对不存在主键的表添加主键并放在第一列.
ALTER table users Add id int NOT NULL AUTO_INCREMENT primary key FIRST
Glossary
- May 2023 (7)
- March 2023 (1)
- October 2022 (1)
- October 2021 (2)
- August 2021 (4)
- June 2021 (2)
- May 2021 (1)
- April 2021 (2)
- November 2020 (1)
- June 2020 (2)
- December 2019 (2)
- November 2019 (1)
- August 2019 (1)
- February 2018 (1)
- October 2017 (1)
- September 2017 (1)
- July 2017 (1)
- June 2017 (2)
- May 2017 (1)
- March 2017 (3)
- December 2016 (2)
- November 2016 (4)
- October 2016 (3)
- June 2016 (1)
- December 2015 (1)
- November 2015 (6)
- October 2015 (2)
- September 2015 (1)
- August 2015 (1)
- July 2015 (1)
- June 2015 (1)
- May 2015 (1)
- March 2015 (1)
- January 2015 (1)
- December 2014 (3)
- October 2014 (5)
- September 2014 (3)
- August 2014 (1)
- July 2014 (1)
- June 2014 (1)
- May 2014 (1)
- April 2014 (2)
- March 2014 (2)
- February 2014 (2)
- January 2014 (4)
- December 2013 (1)
- March 2013 (2)
- February 2013 (2)
- December 2012 (2)
- November 2012 (4)
- October 2012 (1)
- September 2012 (6)
- August 2012 (15)
- July 2012 (5)
- June 2012 (13)
- May 2012 (9)
- April 2012 (8)
- March 2012 (9)
- February 2012 (3)
- January 2012 (1)
- December 2011 (1)
- November 2011 (6)
- October 2011 (2)
- September 2011 (17)
- August 2011 (4)
- July 2011 (4)
- June 2011 (5)
- May 2011 (4)