{"id":199193,"date":"2025-05-03T13:06:04","date_gmt":"2025-05-03T05:06:04","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199193\/"},"modified":"2025-05-03T13:06:04","modified_gmt":"2025-05-03T05:06:04","slug":"%e7%a6%81%e7%94%a8ecshop%e7%bc%93%e5%ad%98%e5%85%b3%e9%97%adecshop%e7%bc%93%e5%ad%98%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199193\/","title":{"rendered":"\u7981\u7528ecshop\u7f13\u5b58,\u5173\u95edecshop\u7f13\u5b58\u529f\u80fd"},"content":{"rendered":"<p>&nbsp;<span style=\"font-size: 12px;line-height: 18px\">ECSHOP\u7684\u7f13\u5b58\u5b58\u653e\u5728temp \/\u6587\u7ae0\u5939\u4e0b\uff0c\u65f6\u95f4\u957f\u4e86\u8fd9\u4e2a\u6587\u4ef6\u5939\u5c31\u4f1a\u975e\u5e38\u5e9e\u5927\uff0c\u62d6\u6162\u7f51\u7ad9\u901f\u5ea6\u3002\u8fd8\u6709\u5f88\u591a\u60c5\u51b5\u6211\u4eec\u4e0d\u9700\u8981\u4ed6\u7684\u7f13\u5b58\u3002\u672c\u6587\u4ecb\u7ecd\u7981\u7528ECSHOP\u7f13\u5b58\u7684\u65b9\u6cd5\u3002 <\/span><\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\">\u3000\u3000ECSHOP\u7684\u7f13\u5b58\u6709\u4e24\u90e8\u5206\uff0c\u4e00\u90e8\u5206\u662fSMARTY\u7684\u9875\u9762\u7f13\u5b58\uff1b\u53e6\u4e00\u90e8\u5206\u662fSQL\u67e5\u8be2\u7ed3\u679c\u7684\u7f13\u5b58\u3002\u8fd9\u4e24\u90e8\u5206\u90fd\u662f\u4fdd\u5b58\u5728templates\/caches\/\u6587\u4ef6\u5939\u4e0b\u3002\u53ea\u8981\u6211\u4eec\u5206\u522b\u5173\u95ed\u8fd9\u4e24\u4e2a\u529f\u80fd\uff0c\u5c31\u53ef\u4ee5\u5b8c\u5168\u7981\u7528ECSHOP\u7684\u7f13\u5b58\u3002\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u5173\u95ed\u5176\u4e2d\u67d0\u4e00\u4e2a\u3002<\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\">\u3000\u3000\uff11.\u5173\u95edSMARTY\u7684\u7f13\u5b58\uff1a<br \/> \u6253\u5f00includes\/cls_template.php\uff0c\u627e\u5230\u4e0b\u9762\u4e00\u6bb5<\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\"><span>\u3000\u3000if (file_put_contents($this-&gt;cache_dir . \u2018\/\u2019 . $cachename . \u2018.php\u2019, \u2018&lt;?php exit;?&gt;\u2019 . $data . $out) === false)<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trigger_error(\u2018can\\\u2019t write:\u2019 . $this-&gt;cache_dir . \u2018\/\u2019 . $cachename . \u2018.php\u2019);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/span><\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\">\u3000\u3000\u5c06\u8fd9\u4e00\u90e8\u5206\u6ce8\u91ca\u6389\u5373\u53ef\uff0c\u6539\u6210<\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\"><span>\/*<br \/> if (file_put_contents($this-&gt;cache_dir . \u2018\/\u2019 . $cachename . \u2018.php\u2019, \u2018&lt;?php exit;?&gt;\u2019 . $data . $out) === false)<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trigger_error(\u2018can\\\u2019t write:\u2019 . $this-&gt;cache_dir . \u2018\/\u2019 . $cachename . \u2018.php\u2019);<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br \/> *\/<\/span><\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\">\u3000\u3000\uff12.\u5173\u95edSQL\u67e5\u8be2\u7ed3\u679c\u7f13\u5b58<br \/> \u6253\u5f00includes\/cls_mysql.php&nbsp;<br \/> \u627e\u5230<br \/> <span>&nbsp; \u3000\u3000var $max_cache_time=3600;\/\/\u6700\u5927\u7684\u7f13\u5b58\u65f6\u95f4\uff0c\u4ee5\u79d2\u4e3a\u5355\u4f4d<\/span><br \/> \u6539\u4e3a<br \/> &nbsp;<span>&nbsp;\u3000\u3000 var $max_cache_time=0;\/\/\u6700\u5927\u7684\u7f13\u5b58\u65f6\u95f4\uff0c\u4ee5\u79d2\u4e3a\u5355\u4f4d<\/span><\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\">ecshop\u7684\u7f13\u5b58\u673a\u5236\u6709\u7f3a\u9677\uff0c\u5efa\u8bae\u6b63\u5f0f\u505a\u7ad9\u4f18\u5316\u4fee\u6539\u540e\u518d\u4f7f\u7528\u3002\u82e5\u540cMemcache\u3001eAccelerator\u3001Xcache\u5185\u5b58\u4f18\u5316\u7ed3\u6784\u7ed3\u5408\u4f7f\u7528\u66f4\u4f73<\/p>\n<p style=\"line-height: 1.5;margin-top: 0px;margin-right: 0px;margin-bottom: 1.25em;margin-left: 0px;padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px\">\u6b22\u8fce\u5e7f\u5927\u5ba2\u6237\u8054\u7cfb\u597d\u6a21\u677f\uff0c\u4f7f\u7528\u4f18\u5316\u63a8\u5e7f\u670d\u52a1\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;ECSHOP\u7684\u7f13\u5b58\u5b58&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-199193","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=199193"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199193\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}