{"id":5286,"date":"2019-12-10T16:34:39","date_gmt":"2019-12-10T07:34:39","guid":{"rendered":"http:\/\/test.bscre8.com\/bslife\/?p=5286"},"modified":"2025-04-02T12:48:54","modified_gmt":"2025-04-02T03:48:54","slug":"nojiri20191210","status":"publish","type":"post","link":"https:\/\/www.bscre8.com\/journal\/2019\/12\/10\/nojiri20191210\/","title":{"rendered":"\u3010EC-CUBE3\u3011EC-CUBE3\u306bwordpress\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002<br \/>\n\u30c7\u30b6\u30a4\u30ca\u30fc\u306e\u91ce\u5c3b\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306fEC-CUBE3\u306bwordpress\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u3084\u308a\u304b\u305f\u306b\u3064\u3044\u3066\u3001\u5099\u5fd8\u9332\u3082\u517c\u306d\u3066\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u610f\u5916\u3068\u5927\u5909\u3067\u3057\u305f\u3002<\/p>\n<p>\u3010\u53c2\u8003\u306b\u3057\u305f\u30da\u30fc\u30b8\u3011<br \/>\n\u2460EC\u30b5\u30a4\u30c8\u306b\u30d6\u30ed\u30b0\u8ffd\u52a0\uff08EC-CUBE3\u3068WordPress\u306e\u9023\u643a\uff09<br \/>\n<a href=\"https:\/\/b-risk.jp\/blog\/2019\/09\/eccube3_wordpress\/\" rel=\"noopener\" target=\"_blank\">https:\/\/b-risk.jp\/blog\/2019\/09\/eccube3_wordpress\/<\/a><\/p>\n<p>\u2461EC-CUBE3.013 WordPress\u306e\u65b0\u7740\u60c5\u5831\u3092\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u8868\u793a<br \/>\n<a href=\"https:\/\/goweb.jp\/stblog4\/2017\/01\/55\/\" rel=\"noopener\" target=\"_blank\">https:\/\/goweb.jp\/stblog4\/2017\/01\/55\/<\/a><\/p>\n<h2>EC-CUBE\u306ehtaccess\u306b\u300c\u30d5\u30a9\u30eb\u30c0\u4ee5\u4e0b\u3092EC-CUBE\u306e\u76f4\u63a5\u7ba1\u7406\u4e0b\u304b\u3089\u5916\u3059\u300d\u8a18\u8ff0\u3092\u8ffd\u52a0<\/h2>\n<p>\u307e\u305a\u53c2\u8003\u30b5\u30a4\u30c8\u2460\u304b\u3089\u5f15\u7528\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30b5\u30fc\u30d0\u4e0a\u306bEC-CUBE\u3068wordpress\u3092\u305d\u308c\u305e\u308c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\nEC-CUBE\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u304c\u5272\u3068\u5f37\u3081\u306a\u305f\u3081\u3001\u666e\u901a\u306b\u300cwordpress\u300d\u3068\u3044\u3046\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u3063\u3066\u305d\u3053\u306bWordPress\u3092\u7f6e\u3044\u3066\u3082\u52d5\u304d\u307e\u305b\u3093\u3002<br \/>\n\u5171\u5b58\u306e\u305f\u3081\u306b\u3001EC-CUBE\u5074\u306e\u300c.htaccess\u300d\u3067\u300cwordpress\u300d\u30d5\u30a9\u30eb\u30c0\u4ee5\u4e0b\u3092EC-CUBE\u306e\u76f4\u63a5\u7ba1\u7406\u4e0b\u304b\u3089\u5916\u3059\u4f5c\u696d\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint\"><code>\r\n\r\n\r\n\r\n\r\n...\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !^(.*)\\.(gif|png|jpe?g|css|ico|js|svg)$ [NC]\r\nRewriteRule ^(.*)$ index.php [QSA,L]\r\n...\r\n\r\n\u3000\u3000\u2193\r\n...\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !^(.*)\\.(gif|png|jpe?g|css|ico|js|svg)$ [NC]\r\nRewriteCond $1 !^(wordpress\/)\r\nRewriteRule ^(.*)$ index.php [QSA,L]\r\n<\/code><\/pre>\n<p>\u3053\u306e\u4e0b\u6e96\u5099\u304c\u5fc5\u8981\u3067\u3059<\/p>\n<h2>twig\u306e\u4e2d\u3067\u5f37\u5f15\u306bPHP\u306e\u95a2\u6570\u3092\u982d\u306b\u300cphp_\u300d\u3092\u5165\u308c\u308b\u3053\u3068\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b<\/h2>\n<p>\u4ee5\u4e0b\u53c2\u8003\u30b5\u30a4\u30c8\u2461\u304b\u3089\u5f15\u7528\uff08\u4e00\u90e8\u8abf\u6574\uff09\u3057\u3066\u3044\u307e\u3059<br \/>\n<strong>1.\u300csrc\/Eccube\/Twig\/Extension\/EccubeExtension.php\u300d\u306e\u300cpublic function getFunctions()\u300d\u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18<\/strong><\/p>\n<pre class=\"prettyprint\"><code>\r\n\r\n\r\n\r\n\r\nnew \\Twig_SimpleFunction('php_*', array($this,'phpFunctions'),array('is_safe' => array('html'))),\r\n<\/code><\/pre>\n<p><strong>2.\u7d9a\u3044\u3066\u300cclass EccubeExtension extends \\Twig_Extension\u300d\u5185\u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18<\/strong><\/p>\n<pre class=\"prettyprint\"><code>\r\n\r\n\r\n\r\n\r\npublic function phpFunctions()\r\n    {\r\n        $arg_list = func_get_args();\r\n        $function = array_shift($arg_list);\r\n \r\n        if(is_callable($function)){\r\n            return call_user_func_array($function, $arg_list);\r\n        }\r\n\r\n        $errMsg = 'Called to an undefined function : <b>php_' . $function . \"<\/b> \";\r\n        trigger_error($errMsg, E_USER_NOTICE);\r\n        return NULL;\r\n    }\r\n<\/code><\/pre>\n<p><strong>3.\u300cwordpress\u300d\u30d5\u30a9\u30eb\u30c0\u306e\u76f4\u4e0b\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u306e\u300cnews.php\u300d\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210<\/strong><\/p>\n<pre class=\"prettyprint\"><code>\r\n\r\n\r\n\r\n\r\n<?php require_once('wp-load.php'); ?>\r\n\r\n<dl class=\"cf\">\r\n<?php query_posts('post_type=post&#038;posts_per_page=10&#038;paged='.$paged); ?>    \r\n<?php if(have_posts()): while(have_posts()): the_post(); ?>\r\n<dt><?php the_time('Y\u5e74m\u6708d\u65e5'); ?><\/dt>\r\n<dd><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?><\/a><\/h3>\r\n<\/dd>\r\n<?php endwhile; endif; ?>\r\n<\/dl>\r\n<\/code><\/pre>\n<p><strong>4.EC-CUBE\u5185\u3067\u65b0\u7740\u60c5\u5831\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u305f\u3044\u4efb\u610f\u306e\u7b87\u6240\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30bd\u30fc\u30b9\u3092\u8ffd\u52a0<\/strong><\/p>\n<pre class=\"prettyprint\"><code>\r\n\r\n\r\n\r\n\r\n{{ php_file_get_contents('http:\/\/\u30c9\u30e1\u30a4\u30f3\u540d\/wordpress\/news.php') }}\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3067EC-CUBE\u306e\u30c6\u30f3\u30d7\u30ec\u4e0a\u306bwordpress\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\uff08\u306f\u305a\uff09<br \/>\nEC-CUBE\u3060\u3051\u3060\u3068\u3001\u304a\u77e5\u3089\u305b\u5468\u308a\u306e\u5468\u77e5\u304c\u610f\u5916\u3068\u4e0d\u4fbf\u3060\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\nwordpress\u3068\u9023\u643a\u3055\u305b\u308b\u3053\u3068\u3067\u3001CMS\u3068\u3057\u3066\u3088\u308a\u4f7f\u3044\u3084\u3059\u304f\u306a\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3002 \u30c7\u30b6\u30a4\u30ca\u30fc\u306e\u91ce\u5c3b\u3067\u3059\u3002 \u4eca\u56de\u306fEC-CUBE3\u306bwordpress\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u3084\u308a\u304b\u305f\u306b\u3064\u3044\u3066\u3001\u5099\u5fd8\u9332\u3082\u517c\u306d\u3066\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u610f\u5916\u3068\u5927\u5909\u3067\u3057\u305f\u3002 \u3010\u53c2\u8003\u306b\u3057\u305f\u30da\u30fc\u30b8\u3011 \u2460EC\u30b5&hellip;<\/p>\n","protected":false},"author":1,"featured_media":5292,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[114],"tags":[],"class_list":["post-5286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-insight"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/posts\/5286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/comments?post=5286"}],"version-history":[{"count":1,"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/posts\/5286\/revisions"}],"predecessor-version":[{"id":15118,"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/posts\/5286\/revisions\/15118"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/media\/5292"}],"wp:attachment":[{"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/media?parent=5286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/categories?post=5286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bscre8.com\/journal\/wp-json\/wp\/v2\/tags?post=5286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}