{"id":53,"date":"2015-06-17T11:32:00","date_gmt":"2015-06-17T02:32:00","guid":{"rendered":"https:\/\/jikoman.sin-cos.com\/blog\/?p=53"},"modified":"2015-06-17T11:32:00","modified_gmt":"2015-06-17T02:32:00","slug":"14-yii2-windows","status":"publish","type":"post","link":"https:\/\/jikoman.sin-cos.com\/blog\/2015\/06\/14-yii2-windows\/","title":{"rendered":"\u30b5\u30a4\u30c8\u6539\u88c5\u3078\u306e\u9053(14) \u300cYii2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb Windows\u7de8\u300d"},"content":{"rendered":"<div class=\"tr_bq\">\n<a href=\"\/blog\/2015\/06\/13-windowsgulp.html\">Windows\u306bgulp\u3092\u5165\u308c\u3066\u307f\u305f<\/a>\u306e\u3067\u3001\u305d\u306e\u307e\u307eyii2\u3082\u5165\u308c\u3066\u3057\u307e\u304a\u3046\u3002<\/div>\n<p>GitBash\u3092\u8d77\u52d5\u3057\u3066\u3001\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092xampp\u306ehtdocs\u306b\u79fb\u52d5\u3002<\/p>\n<p>$ cd c:\/xampp\/htdocs<br \/>\n\u305d\u3057\u3066\u3001yii2\u306e\u4e0a\u7d1a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3002<\/p>\n<p>$ composer create-project &#8211;prefer-dist yiisoft\/yii2-app-advanced<br \/>Installing yiisoft\/yii2-app-advanced (2.0.4)<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-app-advanced (2.0.4)<br \/>&nbsp; &nbsp; Downloading: 100%<br \/>Created project in C:xampphtdocsyii2-app-advanced<br \/>Loading composer repositories with package information<br \/>Installing dependencies (including require-dev)<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-composer (2.0.3)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing ezyang\/htmlpurifier (v4.6.0)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing cebe\/markdown (1.1.0)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing bower-asset\/jquery (2.1.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing bower-asset\/jquery.inputmask (3.1.63)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing bower-asset\/punycode (v1.3.2)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing bower-asset\/yii2-pjax (v2.0.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing yiisoft\/yii2 (2.0.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing swiftmailer\/swiftmailer (v5.4.1)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-swiftmailer (2.0.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-codeception (2.0.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing bower-asset\/bootstrap (v3.3.5)<br \/>&nbsp; &nbsp; Downloading: 100%<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-bootstrap (2.0.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-debug (2.0.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing bower-asset\/typeahead.js (v0.10.5)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing phpspec\/php-diff (v1.0.2)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-gii (2.0.4)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing fzaninotto\/faker (v1.5.0)<br \/>&nbsp; &nbsp; Loading from cache<br \/>&nbsp; &#8211; Installing yiisoft\/yii2-faker (2.0.3)<br \/>&nbsp; &nbsp; Loading from cache<br \/>fzaninotto\/faker suggests installing ext-intl (*)<br \/>Writing lock file<br \/>Generating autoload files<br \/>\n\u3042\u308c\u3001\u3082\u3046\u7d42\u308f\u308a\uff1f<\/p>\n<p>\u4e0a\u7d1a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306a\u306e\u3067\u3001\u3042\u3068\u306f\u521d\u671f\u5316\u3057\u3066\u3001<\/p>\n<p>$ php yii2-app-advanced\/initYii Application Initialization Tool v1.0<br \/>Which environment do you want the application to be initialized in?<br \/>&nbsp; [0] Development<br \/>&nbsp; [1] Production<br \/>&nbsp; Your choice [0-1, or &#8220;q&#8221; to quit] 0<br \/>&nbsp; Initialize the application under &#8216;Development&#8217; environment? [yes|no] yes<br \/>&nbsp; Start initialization &#8230;<br \/>&nbsp; &nbsp;generate backend\/config\/main-local.php<br \/>&nbsp; &nbsp;generate backend\/config\/params-local.php<br \/>&nbsp; &nbsp;generate backend\/web\/index-test.php<br \/>&nbsp; &nbsp;generate backend\/web\/index.php<br \/>&nbsp; &nbsp;generate common\/config\/main-local.php<br \/>&nbsp; &nbsp;generate common\/config\/params-local.php<br \/>&nbsp; &nbsp;generate console\/config\/main-local.php<br \/>&nbsp; &nbsp;generate console\/config\/params-local.php<br \/>&nbsp; &nbsp;generate frontend\/config\/main-local.php<br \/>&nbsp; &nbsp;generate frontend\/config\/params-local.php<br \/>&nbsp; &nbsp;generate frontend\/web\/index-test.php<br \/>&nbsp; &nbsp;generate frontend\/web\/index.php<br \/>&nbsp; &nbsp;generate yii<br \/>&nbsp; &nbsp;generate cookie validation key in backend\/config\/main-local.php<br \/>&nbsp; &nbsp;generate cookie validation key in frontend\/config\/main-local.php<br \/>&nbsp; &nbsp; &nbsp; chmod 0777 backend\/runtime<br \/>&nbsp; &nbsp; &nbsp; chmod 0777 backend\/web\/assets<br \/>&nbsp; &nbsp; &nbsp; chmod 0777 frontend\/runtime<br \/>&nbsp; &nbsp; &nbsp; chmod 0777 frontend\/web\/assets<br \/>&nbsp; &nbsp; &nbsp; chmod 0755 yii<br \/>&nbsp; &nbsp; &nbsp; chmod 0755 tests\/codeception\/bin\/yii<br \/>&nbsp; &#8230; initialization completed.<br \/>\n\u3061\u306a\u307f\u306b\u958b\u767a\u74b0\u5883\u3068\u3057\u3066\u306e\u521d\u671f\u5316\u306d\u3002<\/p>\n<p>\u6b21\u306b\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e0a\u306b\u3001\u30e6\u30fc\u30b6\u30fc\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u3001\u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30e6\u30fc\u30b6\u540d\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u306b\u5408\u308f\u305b\u3066\u7de8\u96c6\u3002<br \/>\nc:\/xampp\/htdocs\/yii2-app-advanced\/common\/config\/main-local.php<\/p>\n<p>return [<br \/>&nbsp; &nbsp; &#8216;components&#8217; =&gt; [<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8216;db&#8217; =&gt; [<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;class&#8217; =&gt; &#8216;yiidbConnection&#8217;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;dsn&#8217; =&gt; &#8216;mysql:host=localhost;dbname=yii&#8217;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;username&#8217; =&gt; &#8216;yii&#8217;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;password&#8217; =&gt; &#8216;yii&#8217;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;charset&#8217; =&gt; &#8216;utf8&#8217;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; ],<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &#8216;mailer&#8217; =&gt; [<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;class&#8217; =&gt; &#8216;yiiswiftmailerMailer&#8217;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;viewPath&#8217; =&gt; &#8216;@common\/mail&#8217;,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ send all mails to a file by default. You have to set<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &#8216;useFileTransport&#8217; to false and configure a transport<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ for the mailer to send real emails.<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;useFileTransport&#8217; =&gt; true,<br \/>&nbsp; &nbsp; &nbsp; &nbsp; ],<br \/>&nbsp; &nbsp; ],<br \/>];<\/p>\n<div>\n<div>\n\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u521d\u671f\u5316\uff01<\/div>\n<p>$ php yii2-app-advanced\/yii migrate<br \/>Yii Migration Tool (based on Yii v2.0.4)<br \/>Creating migration history table &#8220;migration&#8221;&#8230;Done.<br \/>Total 1 new migration to be applied:<br \/>&nbsp; &nbsp; &nbsp; &nbsp; m130524_201442_init<br \/>Apply the above migration? (yes|no) [no]:yes<br \/>*** applying m130524_201442_init<br \/>&nbsp; &nbsp; &gt; create table {{%user}} &#8230; done (time: 0.313s)<br \/>*** applied m130524_201442_init (time: 0.348s)<\/p>\n<p>Migrated up successfully.\n<\/p><\/div>\n<div>\n\u3055\u3042\u3001\u4e0a\u7d1a\u306e\u4e16\u754c\u306b\u3002<\/div>\n<div>\n<\/div>\n<div>\n<a href=\"http:\/\/localhost\/yii2-app-advanced\/frontend\/web\/index.php\">http:\/\/localhost\/yii2-app-advanced\/frontend\/web\/index.php<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Windows\u306bgulp\u3092\u5165\u308c\u3066\u307f\u305f\u306e\u3067\u3001\u305d\u306e\u307e\u307eyii2\u3082\u5165\u308c\u3066\u3057\u307e\u304a\u3046\u3002 GitBash\u3092\u8d77\u52d5\u3057\u3066\u3001\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092xampp\u306ehtdocs\u306b\u79fb\u52d5\u3002 $ cd c:\/xampp\/htdocs \u305d\u3057\u3066\u3001yii2\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-130"],"_links":{"self":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":0,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}