简短问题: 在Magento中为管理区域实施Google Api OAuth2身份验证的最简洁方法是什么?
长篇问题: 所有新的Google API都使用OAuth2.php客户端库在这里,它抽象OAuth2处理 https://code.google.com/p/google-api-php-client/
这个过程很简单
客户端库中的示例都是平面文件.所以我正在寻找将其融入MVC结构的最佳方式......或者Magento是精确的.
让我们具体一点.它用于检索Google通讯录.到目前为止,我有:
我遇到的问题是我不能做最后的重定向.即使我使用adminhtml帮助器getUrl方法,它附加了'key'url参数,当我从前端重定向到后端时,我被踢到仪表板.
有没有更好的方法在Magento中实现Googles OAuth2?
如何重定向到直接管理URL?
我试图让Elasticsearch忽略连字符.我不希望它将连字符的任何一边分成单独的单词.看起来很简单,但我正在敲打墙壁.
我希望字符串"Roland JD-Xi"产生以下术语:[roland jd-xi,roland,jd-xi,jdxi,roland jdxi]
我无法轻易实现这一目标.大多数人只会键入'jdxi',所以我最初的想法就是删除连字符.所以我使用以下定义
name: {
"type": "string",
"analyzer": "language",
"include_in_all": true,
"boost": 5,
"fields": {
"my_standard": {
"type": "string",
"analyzer": "my_standard"
},
"my_prefix": {
"type": "string",
"analyzer": "my_text_prefix",
"search_analyzer": "my_standard"
},
"my_suffix": {
"type": "string",
"analyzer": "my_text_suffix",
"search_analyzer": "my_standard"
}
}
Run Code Online (Sandbox Code Playgroud)
}
相关的分析仪和过滤器定义为
{
"number_of_replicas": 0,
"number_of_shards": 1,
"analysis": {
"analyzer": {
"std": {
"tokenizer": "standard",
"char_filter": "html_strip",
"filter": ["standard", "elision", "asciifolding", "lowercase", "stop", "length", "strip_hyphens"]
...
"my_text_prefix": {
"tokenizer": "whitespace",
"char_filter": "my_filter",
"filter": ["standard", "elision", "asciifolding", …Run Code Online (Sandbox Code Playgroud)