Upgrade to Pro — share decks privately, control downloads, hide ads and more …

開發環境建置

 開發環境建置

Shengyou Fan

December 06, 2014
Tweet

More Decks by Shengyou Fan

Other Decks in Programming

Transcript

  1. ఔࣜӡ࡞ݪཧٴྲྀఔ HTTP ࢕෰ث (apache / nginx) ࢿྉݿ (MySQL) PHP ௚ᩄث

    (໢࿏ጯ༻ఔࣜ) ໢࿏ओػ࡞ۀܥ౷ ࢖༻ऀᖣ᧸
  2. ໢᜾༬᧸ ӡߦ؀ڥ 䆋ॺฏ୆ ൛ຊ߇੍ ։ᚙྲྀఔٴ޻۩ SourceTree pagoda box google chrome

    UwAmp cmder ࢦྩࣥߦ ݪ࢝ᛰḤሜٴܥ౷։ᚙ Netbeans ݪ࢝ᛰḤሜ composer ౟݅؅ཧ phpMyAdmin ࢿྉݿૢ࡞
  3. ։ᚙ޻۩Ұ᧸ද • ध҆᧋తೈᱪ - Cmder (⃧ڧܕ໋ྩఏࣔࣈݩ) - Composer (PHP ౟݅؅ཧ)

    - Netbeans (ฤाث) - Source Tree (൛ຊ߇੍) - Google Chrome (ᖣ᧸ث)
  4. ҆᧋ cmder • ղᆫॖ cmder.zip ੒ cmder ࢿྉᇄଈՄ • ೺

    cmder ࢿྉᇄ์౸ C:\ ఈԼ • ೺ cmder ࢿྉᇄ㚎త cmder.exe ੡࡞Ұݸ ডኸ౸䖂໘্ ˒ ԼࡌҐᅿɿhttp://bliker.github.io/cmder/
  5. ઃఆ cmder • ༻ܥ౷؅ཧһత਎㟨։啟 ໋ྩఏࣔࣈݩ • ੾׵౸ C:\cmder ࢿྉᇄ㚎 •

    ઃఆޭೳදࢦྩ (ࢹت޷બᎩੑ҆᧋) $  cd  C:\cmder //  ੥ઌ༻ʮܥ౷؅ཧһʯ਎㟨ࣥߦ  cmder.exe  ޙ࠶ࣥߦ $  .\cmder.exe  /REGISTER  ALL
  6. ઃఆ cmder • ղܾதจࣈॏᙟɿࡏઃఆཫࣈᱪ Monospace औফޯબଈՄ • ઃఆ aliases •

    ઃఆ prompt.lua • ҆᧋ laravel ૬᮫ completion ֎ֻ ˒ Լࡌ completion ֎ֻɿhttps://github.com/laravel-dojo/cmder-plugins
  7. ҆᧋ UwAmp • ࣥߦ UwAmp.exe (۰҆શੑܯࠂ੥҈֬ೝ ࣥߦ) • ੥֬ೝ҆᧋࿏ኸࢸ C:\UwAmp

    • ҆᧋աఔத੥౎࢖༻༬ઃઃఆ (Next౸ఈ) • ҆᧋ޙՄࡏ䖂໘্؃౸ UwAmp త啟ಈড ኸ ˒ ԼࡌҐᅿɿhttp://www.uwamp.com/en/?page=download
  8. ᱛᨽ UwAmp ҆᧋ • 啟ಈ UwAmp • ᴍબ www Site

    ҈ᭃ - ଌࢼᖣ᧸ start page - ଌࢼ࢖༻ phpMyAdmin
  9. ҆᧋ Composer • ੥ઌሡ C:\UwAmp\bin\php\php5.5.15\php_uwamp.ini ෳ੡Ұ㟨ฒॏ৽໋໊ҝ php.iniɼฒमվ extension_dir = “ext”

    • ࣥߦ Composer-Setup.exe • ҆᧋աఔத੥౎࢖༻༬ઃઃఆ (Next౸ఈ) ˒ ԼࡌҐᅿɿhttps://getcomposer.org/Composer-Setup.exe ઃఆ Install Shell Menus (ґت޷બᎩ) ਘ໰ php.exe ࡏ䬟ཫ࣌ɼ੥ࢦ޲ C:\UwAmp\bin\php\php5.5.15\php.exe Composer ။ࣗಈ೺ C:\UwAmp\bin\php\php5.5.15\ Ճ౸ܥ౷؀ڥᏓᏐ㚎 Composer ။ࣗಈ೺ C:\ProgramData\ComposerSetup\bin Ճ౸ܥ౷؀ڥᏓᏐ㚎
  10. ҆᧋ SourceTree • ੥ࣥߦ SourceTreeSetup_1.6.11.exe • ҆᧋աఔத੥౎࢖༻༬ઃઃఆ (Next౸ఈ) ˒ ԼࡌҐᅿɿhttp://www.sourcetreeapp.com/

    ҆᧋աఔத။ࣗಈԼࡌ git ఔࣜ֩৺ɼ੥ࡏԼࡌ׬੒ޙ҈ Next ៺᠃ ҆᧋׬੒ޙɼ။ᨑ໰ੋ൱ࣗಈઃఆ global gitignoreʁ҈ Yes ଈՄ ઀ஶ။ᨑ໰ੋ൱ཁઃఆாᥒʁ௚઀҈ Skip ઌ௓ա ࠷ޙ။ᨑ໰ੋ൱ቮៃ༗ SSH Key ཁაೖʁઌ҈ No ଈՄ
  11. ઃఆ SourceTree • ࡏ࢖༻ SourceTree લɼઌઃఆ git తࣝผ ࢿྉɼṜᒬ೔ޙࡏṶଘ൛ຊ࣌ɼgit ࠽༗㭎

    ๏ل㑚ੋ䬟ݸ࢖༻ऀṶଘత $ git config --global user.name "{੥ሜࣗݾత໊ࣈ}" $ git config --global user.email "{੥վ੒ࣗݾత email }" ˒ ࢦྩჩߟɿhttp://git-scm.com/book/zh-tw/v1/։࢝-ॳ࣍ઃఆGit
  12. ҆᧋ Virtual box • ੥ࣥߦ VirtualBox-4.3.18-96516-Win.exe • ҆᧋աఔத੥౎࢖༻༬ઃઃఆ (Next౸ఈ) ҆᧋աఔఏࣔ҆᧋৽ߗᱪ౎҈

    ҆᧋ ଈՄ ҆᧋׬੒ޙɼ੥ґࢦྩॏ৽։ػ ˒ ԼࡌҐᅿɿhttps://www.virtualbox.org/wiki/Downloads
  13. ҆᧋ homestead • ଧ։ cmder.exe ༌ೖҎԼࢦྩ • ሡ C:\Users\{username}\AppData\Roaming \Composer\vendor\bin

    Ճ౸ܥ౷؀ڥᏓᏐ 㚎 $  composer  global  require  "laravel/homestead=~2.0" զతిᡵ > ӈ伴બ㚎༰ > ਐ֊ܥ౷ઃఆ > ਐ֊෼ท > ؀ڥᏓᏐ > ܥ౷ᏓᏐ > Path > ฤा
  14. ઃఆ homestead • ଧ։ cmder.exe ༌ೖҎԼࢦྩ • ઃఆ SSH ૬᮫ઃఆ

    • ฤा Homestead.yamlɺઃఆ hosts $  homestead  init $  homestead  edit ༻ܥ౷؅ཧһ਎㟨ଧ։  C:\Windows\System32/drivers/etc/hosts 127.0.0.1      blog.app $  ssh-­‐keygen  -­‐t  rsa  -­‐C  "[email protected]" ˒ SSH ઃఆჩߟɿhttp://help.pagodabox.com/customer/portal/articles/202068
  15. 啟ಈ homestead • ଧ։ cmder.exe ༌ೖҎԼࢦྩ • ࢑ఀ/᮫ػ homestead •

    ႟আ homestead $  homestead  up $  homestead  destroy $  homestead  suspend $  homestead  halt
  16. ֊ஈᒾ查ද • ֬ೝ cmder ҆᧋ɺphp ٴ composer Մ༻ • ֬ೝ

    UwAmp ҆᧋ • ֬ೝ phpmyadmin Մ࢖༻ • ֬ೝ Netbeans ҆᧋ • ֬ೝ SourceTree ҆᧋
  17. ҆᧋ MAMP • ࣥߦ setup_MAMP_3_0_1.exe (۰҆શੑܯ ࠂ੥҈֬ೝࣥߦ) • ੥֬ೝ҆᧋࿏ኸࢸ C:\MAMP

    • ҆᧋աఔத੥౎࢖༻༬ઃઃఆ (Next౸ఈ) • ҆᧋ޙՄࡏ䖂໘্؃౸ MAMP త啟ಈডኸ ˒ ԼࡌҐᅿɿhttp://www.mamp.info/en/mamp_windows.html ҆᧋աఔதएधֹ֎҆᧋ Visual C++ 2008 Մ᫚ࢄᚙ౟݅ɼ੥ґఏࣔ׬੒҆᧋ ҆᧋աఔதएधֹ֎҆᧋ Visual C++ 2012 Մ᫚ࢄᚙ౟݅ɼ੥ґఏࣔ׬੒҆᧋
  18. ᱛᨽ MAMP ҆᧋ • 啟ಈ MAMP • ᴍબ Open start

    page • ଌࢼᖣ᧸ start page • ଌࢼ࢖༻ phpMyAdmin
  19. ҆᧋ Composer • ੥ઌሡ C:\MAMP\conf\php5.6.0\php.ini ෳ੡ ౸ C:\MAMP\bin\php\php5.6.0\ ఈԼ •

    ࣥߦ Composer-Setup.exe • ҆᧋աఔத੥౎࢖༻༬ઃઃఆ (Next౸ఈ) ˒ ԼࡌҐᅿɿhttps://getcomposer.org/Composer-Setup.exe ੥ઃఆ Install Shell Menus Composer ਘ໰ php.exe ࡏ䬟ཫ࣌ɼ੥ࢦ޲ C:\MAMP\bin\php\php5.6.0\php.exe Composer ။ࣗಈ೺ C:\MAMP\bin\php\php5.6.0\php.exe Ճ౸ܥ౷؀ڥᏓᏐ㚎 Composer ။ࣗಈ೺ C:\ProgramData\ComposerSetup\bin Ճ౸ܥ౷؀ڥᏓᏐ㚎