摘要:
出了一个问题, 今天早上从正式环境下下载sql文件, 然后导入到本地环境,却怎么也不生效, 这个是什么问题呢, 原来是因为导错了文件, 为什么会出现这个问题呢,我不知道, 可能是因为文件太多了, 是因为下载目的文件夹里面有很多类似的文件, 然后我直接选择了高亮的那一个, 但选择的这个是错的。 其实都
阅读全文
posted @ 2018-03-22 09:36
qqisnow2021
阅读(217)
推荐(0)
摘要:
https://drupal.stackexchange.com/questions/223376/what-is-the-correct-way-to-set-cache-contexts-on-custom-blocks
阅读全文
posted @ 2018-03-21 16:39
qqisnow2021
阅读(92)
推荐(0)
摘要:
https://www.qed42.com/blog/lazy-builders-drupal8--先加载,然后通过javascript插入到DOM中去。很神奇的技术。
阅读全文
posted @ 2018-03-21 14:56
qqisnow2021
阅读(173)
推荐(0)
摘要:
当一段数据废了很大劲才获取到,这时要考虑使用cache:max-age,感觉没啥用,一般只尊重后台的设置,主要是针对于匿名用户tag: 不管匿名和还是登陆用户,都有效,但不知道有什么用,特别是自己定义的一个字符串tagcontext: 应该是有些变体,所以--所谓数据费了很大劲,我估计是数据比从数据
阅读全文
posted @ 2018-03-21 13:58
qqisnow2021
阅读(120)
推荐(0)
摘要:
Revert This operation changes your site configuration (living in the database) to match up with the definitions in the feature module code.Change data
阅读全文
posted @ 2018-03-20 14:55
qqisnow2021
阅读(126)
推荐(0)
摘要:
To avoid unexpected requests to the server, you should call encodeURIComponent on any user-entered parameters that will be passed as part of a URI. Fo
阅读全文
posted @ 2018-03-19 09:43
qqisnow2021
阅读(519)
推荐(0)
摘要:
The other responses focus on the differences between the two functions. This is true, but if the source array does not contain null or 0 or "", ... (e
阅读全文
posted @ 2018-03-15 16:48
qqisnow2021
阅读(233)
推荐(0)
摘要:
http%3a%2f%2fwww.baidu.com%2fa-b%2fc+dhttp://www.baidu.com/a-b/c d空格+/ %2f: %3ahttp%3a%2f%2fwww.baidu.com%2fa-b%2fc+d%3fa%3db%26c%3dd%3d = %26 &
阅读全文
posted @ 2018-03-15 15:06
qqisnow2021
阅读(110)
推荐(0)
摘要:
https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=zh-cn 我们唯一要做的就是确保服务器提供必要的 ETag 令牌。检查您的服务器文档中有
阅读全文
posted @ 2018-03-14 17:20
qqisnow2021
阅读(193)
推荐(0)
摘要:
https://medium.com/@joshirohit100/cache-context-drupal-8-part-2-10088f67012ehttps://medium.com/@joshirohit100/cache-context-drupal-8-part-1-55303ec665
阅读全文
posted @ 2018-03-14 11:08
qqisnow2021
阅读(121)
推荐(0)
摘要:
if( 1 || 2 && 0) { var_dump('1111');}if((1 || 2) && 0) { var_dump('2222');}if(1 || (2 && 0)) { var_dump('3333');}
阅读全文
posted @ 2018-03-12 15:50
qqisnow2021
阅读(154)
推荐(0)
摘要:
Text (plain) varchar(16000)<input class="js-text-full text-full form-text" data-drupal-selector="edit-field-article-text-plain-0-value" id="edit-field
阅读全文
posted @ 2018-03-12 14:29
qqisnow2021
阅读(159)
推荐(0)
摘要:
$config['system.logging']['error_level'] = 'verbose';如果这个选项打开则在drush cr的时候报错。in settings.local.php
阅读全文
posted @ 2018-03-09 17:18
qqisnow2021
阅读(201)
推荐(0)
摘要:
直接拷贝数据库,方便简单直接。免得一个一个地方的配置。
阅读全文
posted @ 2018-03-09 10:55
qqisnow2021
阅读(124)
推荐(0)
摘要:
每次sass scss/style.scss css/styl.css都会生成不同的style.css文件,可能是很细微的区别吧顺便还会生成style.map文件,这个基本不变,如果这个文件删了,会让firebug产生源映射错误。如果我本地的firebug没有设置启用源映射,则即便没有css.map
阅读全文
posted @ 2018-03-09 10:46
qqisnow2021
阅读(424)
推荐(0)
摘要:
f12 如果开 他就关 如果关 他就开f5 加载页面当firebug开着的时候, 如果加载页面,则会自动跑到调试器窗口,这显然是不行的,那么只有关闭firebug然后再加载页面,还好都有快捷键方式。 PROD上的代码要非常小心,不能后退,只能从前面推过去。
阅读全文
posted @ 2018-03-09 10:05
qqisnow2021
阅读(85)
推荐(0)
摘要:
content security policy 是服务器发送到浏览器的message header 键值对, 只有出现在上面的 url 里的才能生效, 不然浏览器就直接 拒绝了。其中有个 default-src 的属性, 这是一个属性key, 值就是后面属性的默认值, 后面如何设置了具体的值 就会覆
阅读全文
posted @ 2018-03-09 09:45
qqisnow2021
阅读(114)
推荐(0)
摘要:
有时你想忽略一些自己的文件,却不想污染 repo 中的 .gitignore,也可以修改 .git/info/exclude 文件。语法和 .gitignore 一样。 --global 是可选,如果不带--global则只是配置本地的user.name和user.email
阅读全文
posted @ 2018-03-08 11:03
qqisnow2021
阅读(165)
推荐(0)
摘要:
$arr = array('Hello','World!','I','love','Shanghai!'); echo implode($arr," ");echo "\n\t\n\r"; echo implode(" ",$arr); 这个地方在屏幕上显示是没有换行的但如果查看屏幕右键源代码的话,
阅读全文
posted @ 2018-03-05 13:33
qqisnow2021
阅读(239)
推荐(0)
摘要:
当服务器重启后, 有可能让Key发生改变, 这个时候提示public key不能用了,其实本地的Public key是有效的,我们要删除/备份本地的Known host, 重新git pull 就可以更新本地的known host了。就好了。
阅读全文
posted @ 2018-03-05 10:37
qqisnow2021
阅读(318)
推荐(0)
摘要:
$ export https_proxy=http://xx.xx.xx.xx:x$ export http_proxy=http://x.x.x.x:x谁能想到大小写在任何地方都有可能产生不同的结果。
阅读全文
posted @ 2018-03-02 10:20
qqisnow2021
阅读(1432)
推荐(0)
摘要:
$response->send();就是调用Header一些变量setCookieecho $content等一些操作$autoloader = require_once 'autoload.php';获取加载类对象$kernel = new DrupalKernel('prod', $autolo
阅读全文
posted @ 2018-03-01 14:31
qqisnow2021
阅读(198)
推荐(0)
摘要:
I'd like to add that for including a custom class that doesn't fit into the D8 "plugin, controller, form, etc." defaults, you can still do so as noted
阅读全文
posted @ 2018-03-01 10:46
qqisnow2021
阅读(125)
推荐(0)
摘要:
HEAD 就是当前分支名 指向当前分支 当你checkout到其他分支,则HEAD的指向又会发生变化
阅读全文
posted @ 2018-02-28 14:46
qqisnow2021
阅读(119)
推荐(0)
摘要:
Tilde Version Range (~)-- the last second is fixed. except for 0.XThe ~ operator is best explained by example: ~1.2 is equivalent to >=1.2 <2.0.0, whi
阅读全文
posted @ 2018-02-28 13:28
qqisnow2021
阅读(239)
推荐(0)
摘要:
1 一次测试通过 则第二次重复的测试就会通过,如果环境正常的话2 测试就一定要改变因素 换个时间 换个邮箱 换个地点 换个用户名 换个角色3 最好是搞懂来龙去脉。 测试风格的代码 1, 注释一看都明白 2, 单个功能便于测试; 写出来的代码一定要便于测试单独的测试 还有就是多测试, 多想想到底做对了
阅读全文
posted @ 2018-02-28 10:46
qqisnow2021
阅读(473)
推荐(0)
摘要:
数据为了表达某个意思,结构只是一种表现形式, 具体的结构真的不要去关心,反而要想为什么是这种结构,有什么规律,首先记住是数组还是对象或者字符串,从大的往小的记忆,细节太话费时间但对具体的场景意义不大。
阅读全文
posted @ 2018-02-08 17:37
qqisnow2021
阅读(109)
推荐(0)
摘要:
annotation/plugin.php -> 定义 configuration 键值Plugin/PN/xxx.php 具体的plugin实现PNInnterface -> plugin的最初的属性方法定义PNBase.php -> 定义基本的插件属性和方法PNManager.php -> 插件
阅读全文
posted @ 2018-02-08 16:34
qqisnow2021
阅读(224)
推荐(0)
摘要:
F3 — Jumps to include file or variable declaration/definitionAlt+Left and Alt+Right — Navigate through my source to back and forward. Shortcuts for Na
阅读全文
posted @ 2018-02-07 13:19
qqisnow2021
阅读(130)
推荐(0)
摘要:
hooks -- 是一些内置的Hook 一般用户开发 代码的Hooksinfo --> exclude 是不包括在内的文件/文件夹 一般很少用logs --> HEAD : HEAD的移动轨迹 --> refs: heads: 分支名, 新建几个分支就有几个文件夹objects --> 内置的什么对
阅读全文
posted @ 2018-02-07 10:01
qqisnow2021
阅读(76)
推荐(0)
摘要:
那是不可能的本地可以那么远程也就可以的这是一个基本的原理但也会有少量的例外,比如代码没有上传上去。那不是见鬼吗,反正代码层面不会有问题了吧。
阅读全文
posted @ 2018-02-02 17:21
qqisnow2021
阅读(219)
推荐(0)
摘要:
line 283 $definitions = $this->getDiscovery()->getDefinitions();这种情况下,只有1 搜索getdiscovery或者getdefinition去看到底系统有哪些地方弄了啥?2 点进方法去看, 去分析具体的对象3 ctrl+0是这个类有多
阅读全文
posted @ 2018-02-02 14:28
qqisnow2021
阅读(182)
推荐(0)
摘要:
<?php/*$reg = '/(?:\<p\>)?\[(press\-feed\-all)/';$str = '[press-feed-all';preg_match_all($reg,$str,$matches);var_dump($matches);array (size=2) 0 => ar
阅读全文
posted @ 2018-01-30 16:24
qqisnow2021
阅读(130)
推荐(0)
摘要:
git config global http.proxy http://135.245.48.34:8000原型: git config --global http.proxy http[s]://userName:password@proxyaddress:port
阅读全文
posted @ 2018-01-23 09:01
qqisnow2021
阅读(1304)
推荐(0)
摘要:
计算机软件的一切就是由0和1组成,所以一万个0和1只要错了其中一个,都有可能全盘报错,所以有错误是很正常的,没有错误只能说运气太好,也说明在写代码的时候1, 尽量‘’防止‘’出现错误2, 不要怕错误,‘尽情‘’弄 还有一个naming things因为字符串节约的原因,很多name真的就是单词拆开的
阅读全文
posted @ 2018-01-22 15:13
qqisnow2021
阅读(172)
推荐(0)
摘要:
遇到报错could not open stream: 可能是因为本地网络问题于是加了proxy并且前缀http://本来开始也没有加http://后来试了一下就可以试试总是有办法的哦?一个字符都可以改变整个事情哦?
阅读全文
posted @ 2018-01-22 14:44
qqisnow2021
阅读(160)
推荐(0)
摘要:
在开发测试环境中尽量不要使用cache包括page_cache和css/js aggregation今天就发现一个问题多站点就要删除default下面的settings.php和services.yml一个站点正常一个站点显示 的资源已被阻止,因为 MIME 类型不匹配的资源已被阻止,因为 MIME
阅读全文
posted @ 2018-01-18 15:12
qqisnow2021
阅读(1415)
推荐(0)
摘要:
$abc = $form_state->getValue('abc')[0]['value']; if($abc == 'abc'){ drupal_set_message('aa'); } $form_state->getValue('abc')[0]['value']这个值是不存在的情况下也不会
阅读全文
posted @ 2018-01-17 15:19
qqisnow2021
阅读(884)
推荐(0)
摘要:
在硬菜的烹饪过程中, 需要用到try catch 因为可以捕捉到exception message, 并且符合其他Object oriented写法, 既可以收集到别人写的message也可以自己写message方便,而且不打扰其他代码的运行, 方便调试代码。
阅读全文
posted @ 2017-12-13 11:34
qqisnow2021
阅读(268)
推荐(0)
摘要:
try { echo $abc + 1 . "\n"; } catch (Exception $e) { echo 'Caught exception: qinqiu ', $e->getMessage(), "\n"; throw new Exception('try a gain'); } fi
阅读全文
posted @ 2017-12-13 10:27
qqisnow2021
阅读(505)
推荐(0)