{"id":398,"date":"2022-08-10T09:54:26","date_gmt":"2022-08-10T00:54:26","guid":{"rendered":"https:\/\/www.b64.pw\/blog\/?p=398"},"modified":"2022-08-10T09:54:27","modified_gmt":"2022-08-10T00:54:27","slug":"php%e3%81%aecomposer%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa%e3%81%ae%e4%bd%9c%e3%82%8a%e6%96%b9","status":"publish","type":"post","link":"https:\/\/www.b64.pw\/blog\/?p=398","title":{"rendered":"PHP\u306eComposer\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f5c\u308a\u65b9"},"content":{"rendered":"\n<p>PHP\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u306eComposer\u304b\u3089\u3064\u304b\u3048\u308b\u5f62\u5f0f\u3067\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f5c\u308a\u65b9<\/p>\n\n\n\n<h2>\u6e96\u5099<\/h2>\n\n\n\n<p>composer\u30b3\u30de\u30f3\u30c9\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f<\/p>\n\n\n\n<p>ubuntu\u306e\u5834\u5408\u306fapt\u3067\u5165\u308c\u3066\u3057\u307e\u3046\u306e\u304c\u697d<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo apt install composer<\/code><\/pre><\/div>\n\n\n\n<p>\u3082\u3057\u307b\u304b\u306e\u74b0\u5883\u3060\u3063\u305f\u308a\u624b\u52d5\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3044\u5834\u5408\u306f\u4e0b\u8a18\u3092\u53c2\u7167<\/p>\n\n\n\n<p>Composer<br>https:\/\/getcomposer.org\/download\/<\/p>\n\n\n\n<h2>\u30d1\u30c3\u30b1\u30fc\u30b8\u8a2d\u5b9a<\/h2>\n\n\n\n<p>\u307e\u305a\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>composer init<\/code><\/pre><\/div>\n\n\n\n<p>\u4e0a\u8a18\u3092\u5b9f\u884c\u3059\u308b\u3068\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\u8a2d\u5b9a\u9805\u76ee\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u7b54\u3048\u3066\u3044\u304f\u3068composer.json\u306a\u3069\u304c\u4f5c\u3089\u308c\u308b<\/p>\n\n\n\n<p>\u805e\u304b\u308c\u308b\u5185\u5bb9\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Package name (&lt;vendor&gt;\/&lt;name&gt;) #\u30d1\u30c3\u30b1\u30fc\u30b8\u540d \u4f5c\u8005\u540d\/\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306e\u5f62\u5f0f\u3067\u6307\u5b9a\nDescription []: #\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u8aac\u660e\u3001\u7701\u7565\u53ef\nAuthor # \u4f5c\u8005\u306e\u540d\u524d\u3068\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\nMinimum Stability # composer.json\u306b\u8a18\u8f09\u3059\u308bminimum-stability\u306e\u8a2d\u5b9a\u3001\u7701\u7565\u53ef\nPackage Type (e.g. library, project, metapackage, composer-plugin) []: # \u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u5834\u5408\u306flibrary\u3068\u6307\u5b9a\nLicense []: # \u3053\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30e9\u30a4\u30bb\u30f3\u30b9\u6307\u5b9a\u3001\u7701\u7565\u53ef\n\nWould you like to define your dependencies (require) interactively [yes]? # \u4f9d\u5b58\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u6307\u5b9a\nWould you like to define your dev dependencies (require-dev) interactively [yes]? # yes\u3068\u7b54\u3048\u308b\u3068\u958b\u767a\u7528\u30c4\u30fc\u30eb\u306a\u3069\u306e\u6307\u5b9a\u3092\u805e\u304b\u308c\u308b\nSearch for a package: # phpunit\u306a\u3069\u3068\u6307\u5b9a\nFound 15 packages matching phpunit\n\n   [0] phpunit\/phpunit\n   [1] phpunit\/php-timer\n   [2] phpunit\/php-text-template\n   [3] phpunit\/php-file-iterator\n(\u7565)\nEnter package # to add, or the complete package name if it is not listed: # \u3053\u306e\u5834\u5408\u306f0\u3092\u5165\u529b\u3059\u308b\u3068phpunit\u3092\u9078\u3076\nEnter the version constraint to require (or leave blank to use the latest version): # phpunit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u3001\u7a7a\u767d\u3067\u6700\u65b0\u7248\nAdd PSR-4 autoload mapping? Maps namespace # \u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u306e\u8d77\u70b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u6307\u5b9a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068src\/\u304c\u6307\u5b9a\u3055\u308c\u308b\nDo you confirm generation [yes]? # yes\u3068\u7b54\u3048\u308b\u3068\u5b9f\u969b\u306bcomposer.json\u304c\u4f5c\u6210\u3055\u308c\u308b\nWould you like to install dependencies now [yes]? # yes\u3068\u7b54\u3048\u308b\u3068\u5148\u307b\u3069\u6307\u5b9a\u3057\u305f\u4f9d\u5b58\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u306eComposer\u304b\u3089\u3064\u304b\u3048\u308b\u5f62 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/398"}],"collection":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398"}],"version-history":[{"count":1,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions"}],"predecessor-version":[{"id":399,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/398\/revisions\/399"}],"wp:attachment":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}