{"id":191884,"date":"2020-10-28T19:42:51","date_gmt":"2020-10-28T11:42:51","guid":{"rendered":"http:\/\/4563.org\/?p=191884"},"modified":"2020-10-28T19:42:51","modified_gmt":"2020-10-28T11:42:51","slug":"composer-2-0-%e7%9a%84-psr-4-%e8%a7%84%e8%8c%83%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=191884","title":{"rendered":"composer 2.0 \u7684 psr-4 \u89c4\u8303\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  composer 2.0 \u7684 psr-4 \u89c4\u8303\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ericgui <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u5728\u6298\u817e\u81ea\u5df1\u7684\u535a\u5ba2\uff0c\u6240\u4ee5\u5f88\u4e45\u4ee5\u6765\u7b2c\u4e00\u6b21\u5199 PHP<\/p>\n<p>\u7adf\u7136\u53d1\u73b0 composer \u5347\u7ea7\u4e86\uff0c\u4e8e\u662f\u6211\u5c31\u5347\u7ea7\u5230\u4e86 2.x<\/p>\n<p>\u4f46\u95ee\u9898\u662f\uff0c\u6211\u6709\u4e00\u4e9b prs-4 \u7684\u914d\u7f6e\uff0c\u5728\u5347\u7ea7\u4e4b\u540e\u62a5\u9519<\/p>\n<p>\u6bd4\u5982\u539f\u5148\u8fd9\u6837\u7684\uff1a<\/p>\n<pre><code>\"autoload\" : {     \"psr-4\": {      \"Abc\\\" : \"abc\/\"     } } <\/code><\/pre>\n<p>\u73b0\u5728\u62a5\u9519\uff0c\u8bf4\u4e0d\u7b26\u5408 psr-4 \u89c4\u8303\uff0c\u4f46\u6539\u4e3a\u5168\u90e8\u5c0f\u5199<code>abc\\: abc\/<\/code>\u5c31\u597d\u4e86\uff0c\u8fd9\u4e5f\u592a\u90aa\u95e8\u4e86\uff0c\u6211\u770b\u6240\u6709\u4eba\u90fd\u8fd9\u4e48\u7528\u554a\uff0c\u6211\u8fd8\u7279\u610f\u67e5\u4e86\u4e00\u4e9b\u8457\u540d\u7684\u5e93\uff0c\u6bd4\u5982 Monolog \u4e4b\u7c7b\u7684\uff0c\u90fd\u662f\u9996\u5b57\u6bcd\u5927\u5199\u7684\u554a\uff0c\u8fd9\u6837\u7684\uff1a <code>Monolog\\: src\/<\/code><\/p>\n<p>\u8fd9\u4e2a prs-4 \u89c4\u8303\uff0c\u662f\u6211\u7406\u89e3\u7684\u4e0d\u5bf9\u5417\uff1f\u6c42\u6307\u6559\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4131404\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : h947136 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5e94\u8be5\u662f\u4f60\u7684\u7c7b\u7684\u547d\u540d\u7a7a\u95f4\u662f\u5c0f\u5199\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4131405\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ericgui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @h947136 \u7c7b\u7684 namespace \u662f\u5927\u5199\u7684\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>composer 2.0 \u7684 ps&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/191884"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=191884"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/191884\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191884"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}