{"id":3451,"date":"2019-11-13T13:31:20","date_gmt":"2019-11-13T04:31:20","guid":{"rendered":"https:\/\/learningbox.co.jp\/?p=3451"},"modified":"2019-11-13T14:02:34","modified_gmt":"2019-11-13T05:02:34","slug":"blog_composer","status":"publish","type":"post","link":"https:\/\/learningbox.co.jp\/en\/2019\/11\/13\/blog_composer\/","title":{"rendered":"Let's use Composer!"},"content":{"rendered":"<h1>Composer\u3092\u4f7f\u304a\u3046\uff01<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learningbox.online\/wp-content\/uploads\/2019\/11\/Composer1-2.png\" alt=\"Composer\" width=\"900\" height=\"341\" class=\"aligncenter size-full wp-image-26835\" \/>\u30d6\u30ed\u30b0\u8a18\u4e8b\u521d\u6295\u7a3f\u306e\u958b\u767a\u306e\u5409\u91ce\ud83d\udd2b\u3067\u3059\u3002\u4eca\u56de\u306fPHP\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f9d\u5b58\u95a2\u4fc2\u7ba1\u7406\u30c4\u30fc\u30ebComposer\u306b\u3064\u3044\u3066\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u672c\u7a3f\u3082\u3069\u3046\u305e\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u81f4\u3057\u307e\u3059\u3002<\/p>\n<p class=\"mokujimidasi\">\u76ee\u6b21\u306f\u3053\u3061\u3089<\/p>\n<ul class=\"mokuji\">\n<li>1. Composer\u3068\u306f\uff1f<\/li>\n<li>2. Composer\u306e\u5229\u70b9<\/li>\n<li>3. \u307e\u3068\u3081<\/li>\n<\/ul>\n<h2><strong>Composer\u3068\u306f\uff1f<\/strong><\/h2>\n<p>Composer\u306f\u3001PHP \u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u5fc5\u8981\u3068\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u7ba1\u7406\u3059\u308b<span class=\"yellowline\"><strong>\u300c\u30e9\u30a4\u30d6\u30e9\u30ea\u4f9d\u5b58\u7ba1\u7406\u30c4\u30fc\u30eb\u300d<\/strong><\/span>\u3067\u3059\u3002Composer\u304c\u512a\u308c\u3066\u3044\u308b\u70b9\u306f<span style=\"border-bottom:solid 2px red;\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306ePHP\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u7ba1\u7406<\/span>\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u306f A \u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3060\u3063\u305f\u3068\u3057\u307e\u3059\u3002 \u3057\u304b\u3057 A \u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u306f B \u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u3067B\u3092\u5229\u7528\u3059\u308b\u306b\u306fC\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u3067\u3042\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 \u624b\u4f5c\u696d\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u53ce\u96c6\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u4f9d\u5b58\u95a2\u4fc2\u3092\u5168\u3066\u81ea\u3089\u3067\u89e3\u6c7a\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001Composer \u3092\u4f7f\u3046\u3068\u5229\u7528\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3057\u3066\u3001A\u3092\u5ba3\u8a00\u3059\u308c\u3070\u3001\u81ea\u52d5\u7684\u306bB \u3001C\u3082\u542b\u3081\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learningbox.online\/wp-content\/uploads\/2019\/11\/img00-1024x437.png\" alt=\"Composer\" width=\"1024\" height=\"437\" class=\"aligncenter size-large wp-image-26808\" \/><\/p>\n<h2><strong>Composer\u306e\u5229\u70b9<\/strong><\/h2>\n<p class=\"well\">\n<strong>1 . \u958b\u767a\u74b0\u5883\u306e\u5171\u6709\u304c\u7c21\u5358\u306b\u884c\u3048\u308b<\/strong><br \/>\n<strong>2 . \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u7dba\u9e97\u306b\u4fdd\u3066\u308b<\/strong><br \/>\n<strong>3 . \u72ec\u81ea\u30af\u30e9\u30b9\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9<\/strong><br \/>\n<span style=\"color:red;\">\u203b\u3053\u306e3\u3064\u306e\u5229\u70b9\u306b\u3064\u3044\u3066\u9806\u756a\u306b\u8aac\u660e\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/span>\n<\/p>\n<h3><strong>\u958b\u767a\u74b0\u5883\u306e\u5171\u6709\u304c\u7c21\u5358\u306b\u884c\u3048\u308b<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learningbox.online\/wp-content\/uploads\/2019\/11\/Composer3.png\" alt=\"\" width=\"725\" height=\"399\" class=\"aligncenter size-full wp-image-26829\" \/><br \/>\n\u958b\u767a\u3092\u9032\u3081\u308b\u306b\u3042\u305f\u3063\u3066\u69d8\u3005\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u306b\u306a\u3063\u3066\u304f\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u958b\u767a\u30e1\u30f3\u30d0\u30fc\u304c\u500b\u4eba\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3059\u308b\u306e\u306f\u975e\u5e38\u306b\u624b\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3057\u3001\u30e1\u30f3\u30d0\u30fc\u9593\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7d71\u4e00\u51fa\u6765\u3066\u3044\u306a\u3044\u7b49\u3068\u3044\u3063\u305f\u554f\u984c\u3082\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001<strong>Composer<\/strong>\u306f\u300ccompoesr require \u300d\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3060\u3051\u3067\u3001<span style=\"border-bottom:solid 2px red;\">\u81ea\u52d5\u7684\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u89e3\u6c7a\u3057\u305f\u3046\u3048\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/span>\u300ccomposer require\u300d\u30b3\u30de\u30f3\u30c9\u5165\u529b\u5f8c\u306b\u306fcomposer.lock\u3068\u3044\u3046\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831\u304c\u8a18\u8f09\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\ncomposer.lock\u3092\u30e1\u30f3\u30d0\u30fc\u9593\u3067\u5171\u6709\u3057\u3066\u3001composer.lock\u304c\u5b58\u5728\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u300ccomposer install\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u30e1\u30f3\u30d0\u30fc\u9593\u3067\u540c\u4e00\u306e\u74b0\u5883\u3092\u7c21\u5358\u306b\u7528\u610f\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<h3><strong>\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u7dba\u9e97\u306b\u4fdd\u3066\u308b<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learningbox.online\/wp-content\/uploads\/2019\/11\/composer2.png\" alt=\"\" width=\"656\" height=\"280\" class=\"aligncenter size-full wp-image-26827\" \/><br \/>\nComposer\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u7fa4\u306f\u4e00\u62ec\u3067\u300cvendor\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002<br \/>\n\u300cvendor\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u306e\u7ba1\u7406\u5bfe\u8c61\u5916\u306b\u3059\u308b\u3053\u3068\u3067\u5927\u91cf\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u3042\u3052\u306a\u304f\u3066\u6e08\u307f\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u8ab0\u304b\u304c\u6539\u5909\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u306b\u542b\u307e\u308c\u308b\u3053\u3068\u3092\u9632\u3050\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<h3><strong>\u72ec\u81ea\u30af\u30e9\u30b9\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9<\/strong><\/h3>\n<p>PHP\u306b\u306f\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u3068\u3044\u3046\u300cinclude_once\u300d\u306a\u3069\u3067\u660e\u793a\u7684\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307e\u306a\u304f\u3066\u3082\u3001\u4f7f\u7528\u3055\u308c\u305f\u969b\u306b\u81ea\u52d5\u7684\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u304f\u308c\u308b\u4ed5\u7d44\u307f\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"box1\">\n<p>{<br \/>\n\u3000&#8221;autoload&#8221;: {<br \/>\n\u3000\u3000&#8221;classmap&#8221;: [<br \/>\n\u3000\u3000\u3000&#8221;module&#8221;<br \/>\n\u3000\u3000]<br \/>\n\u3000}<br \/>\n}\n<\/p>\n<\/div>\n<p><strong>composer.json<\/strong>\u306b\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u8a18\u8ff0\u3057\u3066<strong>\u300ccomposer dump-autoload\u300d<\/strong>\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u3001\u81ea\u52d5\u3067\u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2><strong>\u307e\u3068\u3081<\/strong><\/h2>\n<p>Composer\u306f\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u5411\u3051\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304a\u3088\u3073\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u7ba1\u7406\u3059\u308b\u6a19\u6e96\u5f62\u5f0f\u3092\u63d0\u4f9b\u3059\u308b\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002<br \/>\n\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066\u3001<span style=\"border-bottom:solid 2px red;\">\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u305f\u308a\u3001\u8907\u96d1\u306a\u51e6\u7406\u3092\u3068\u3063\u3066\u3082\u7c21\u5358\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span>composer\u3092\u4f7f\u3046\u3053\u3068\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u7ba1\u7406\u3092\u7c21\u5358\u306b\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308b\u306e\u3067\u3001\u7a4d\u6975\u7684\u306b\u4f7f\u7528\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"Composer\u3092\u4f7f\u304a\u3046\uff01 \u30d6\u30ed\u30b0\u8a18\u4e8b\u521d\u6295\u7a3f\u306e\u958b\u767a\u306e\u5409\u91ce\ud83d\udd2b\u3067\u3059\u3002\u4eca\u56de\u306fPHP\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f9d\u5b58\u95a2\u4fc2\u7ba1\u7406\u30c4\u30fc\u30ebCo [&hellip;]","protected":false},"author":22,"featured_media":3457,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"0","_wpcom_ai_launchpad_first_post":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6,7,40],"tags":[],"class_list":["post-3451","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-7","category-40"],"acf":[],"jetpack_featured_media_url":"https:\/\/learningbox.co.jp\/wp-content\/uploads\/2019\/11\/Composer4.png","jetpack_shortlink":"https:\/\/wp.me\/pgMrZ4-TF","_links":{"self":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts\/3451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/comments?post=3451"}],"version-history":[{"count":10,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts\/3451\/revisions"}],"predecessor-version":[{"id":3464,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/posts\/3451\/revisions\/3464"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/media\/3457"}],"wp:attachment":[{"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/media?parent=3451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/categories?post=3451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learningbox.co.jp\/en\/wp-json\/wp\/v2\/tags?post=3451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}