1. 安裝[nodejs](https://nodejs.org/)
2. 開啟cmd,並執行
```bash
npm install -j less
```
3. sublime安裝 LESS, smart less build
4. 修改smart less build設定檔
```json
{
"source_map": false
"custom_args": "--clean-css=\"--s1 --advanced --compatibility=ie8\""
}
```
2015年4月12日 星期日
sublime 安裝 coffeescript
1. 安裝[nodejs](https://nodejs.org/)
2. 開啟cmd,並執行
```bash
npm install -j coffee-script
```
3. sublime安裝 Better CoffeeScript
4. 修改coffeescript設定檔
```json
{
"checkSyntaxOnSave": true
"lintOnSave": true
"lintConfFile": true
}
```
sublime syncing
windows內如何同步sublime的設定檔至多台電腦呢?
我們可以利用Dropbox加mklink的方式來做設定喔
請使用系統管理者權限開啟cmd
1.將已設定好的sublime的設定檔移至dropbox內
```bash
mkdir %USERPROFILE%\Dropbox\Sublime
cd %APPDATA%\"Sublime Text 3\Packages"
copy /Y User\* %USERPROFILE%\Dropbox\Sublime
```
2.同步所有資料夾
```bash
cd %APPDATA%\"Sublime Text 3\Packages"
rmdir /S /Q User
mklink /D User %USERPROFILE%\Dropbox\Sublime
```
sublime terminail套件使用git bash
1.安裝 [git](http://git-scm.com/download/win)
2.sublime安裝Terminal
3.將Terminal => Settings - Default的內容複製到Terminal => Settings - User
4.修改
```json
{
"terminal": C:\\Program Files\\Git\\git-bash"
}
```
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9raJknXL-st6xur1NB_oFc1eae_gr5l2JrjQ7DfCFgoN1pzblcEMPztphGxZIiWK9RjAjCE1IhZRHkW8I9fWRUNfaBTIC6xn2AH1eYzGLnbN8Bhg-q0XIBPhE0FV3bLDH8uGAlGItmwAz/s1600/Image+2.png)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2_y8Z-a_Xi6csjteuzvpFnLyhG_z5yimOO14uIVHYDNb3-GlHs8vsWtvtNF4Yj4NHigRP43FbJKpYbWLa8yc4bufrqgofcu40Wu0D8sOhlxm-zRzkNBI_3KgGrXJgj7fUcLETyr7_LFGS/s1600/Image+3.png)
sublime安裝phpcs windows版
1.安裝sublime並安裝好package control
2.安裝phpcs
3.打開command並利用composer安裝
[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
[PHPMD](https://github.com/phpmd/phpmd)
```bash
composer global require squizlabs/php_codesniffer fabpot/php-cs-fixer phpmd/phpmd
```
4.將PHP Code Sniffer => Settings - Default的內容複製到 PHP Code Sniffer => Settings - User
5.修改Settings - User
```json
{
"phpcs_executable_path": "phpcs.bat",
"php_cs_fixer_on_save": true,
"php_cs_fixer_executable_path": "php-cs-fixer.bat",
"phpcbf_on_save": true,
"phpcbf_executable_path": "phpcbf.bat",
"phpmd_run": true,
"phpmd_executable_path": "phpmd.bat"
}
```
如果進行存檔時還是會提示錯誤訊息修改下列參數即可
```json
{
"phpcs_php_prefix_path": "php路徑\\php.exe"
}
```
參考
[wamp安裝](http://phpwrite.blogspot.tw/2015/04/uniform.html)
[composer安裝](http://phpwrite.blogspot.tw/2015/04/windowscomposer.html)
如何在windows下安裝composer
[composer](https://getcomposer.org/)是目前最多人使用的php套件管理單,
只要下一個指令,
就可以將所有套件相依性的軟體下載,
並只要require一隻autoload.php即可
不過要安裝composer有些步驟得進行,
說明一下如何安裝composer
1.下載windows版composer[下載](https://getcomposer.org/Composer-Setup.exe) 並安裝(安裝過程中,會要求指定php.exe資料夾)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCJLUmc3y6Q5MazY7kyTzHHyHkSphJ-OHFL0-VvM5BMShknPvoce5rEZw65bJVmifgi4xNdhEkkY5YPJ8ygJCarmsRVxa0mQdme9Z8oPJJklhrkcJA3NSNQTpCRqNHt2k1ClfryhhcReBY/s1600/Image+26.png)
2. 開始右鍵 => 系統 => 進階系統設定 => 環境變數
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2k6hfBqgv0RlBGd6DG5y8f71seI33xlYh8tAaby8AIYDoA2yKiGzzDNH39Blbqm5beEBlrvkBssXYLAWWkt2Dj9Qj_UnjS5rGkDKcg972fCFOcuj9goa5kvWu67KQr3QqjSBl7UBn1u0v/s1600/Image+21.png)
3. 新增變數
變數名稱: PHP_HOME
變數值: PHP路徑(範例為C:\PHP)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAU0l5C5paiYe8DTWgQ-uxW1u7EdqM3ILgjPA1KblmBu-L5fFBGFBTf58yNc07_XjFfQ8fKDCTq4a9p7bcOnrsQ4WZlipPBjBMD0DxmwzzJ4c0zkgzCnrAgDadtWfM2R-qq6nyTdGKnGXT/s1600/Image+24.png)
4. 新增變數
變數名稱: COMPOSER_HOME
變數值: C:\ProgramData\ComposerSetup
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGLdjNYUgYAS5EgGiuiJdSjKb14iQpDyUUeAKVv3IB656jfUBArkFeBRmO9ZpR6ZHY0ftxzfY9WIcq2-K10hE2WIHS1qp_YLzLGkQHVI-ybzoARguulnrmWruDFfq1NOIVUtriasaJb6Pm/s1600/Image+27.png)
5. 修改path
在原本的path後面新增
;%PHP_HOME%;%COMPOSER_HOME%\bin;%COMPOSER_HOME%\vendor\bin
※由於已經設定%COMPOSER_HOME%所以往後利用 composer global require 套件
都會安裝至%COMPOSER_HOME%\vendor
如果套件內有執行檔則會自動安裝至%COMPOSER_HOME%\vendor\bin
所以%COMPOSER_HOME%\vendor\bin也要加入path變數之中
6. 打開command模式,直接執行composer即可
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGeIdIBzh740FFfx_vK-zOyAga0_4rBeaD9wiPut0MqvGghSl2uR0xfsGtWw1UT95tkC38lYZUpJWmDfCtBbztVYYfPTXPV9tsNWotAZoLD1qiRWkRNEi0b7Y8tul7GBlAj_3-RBL7BG0v/s1600/Image+28.png)
uniform server 在windows下體積小快速安裝的wamp server
在Windows裡安裝wamp server
除了常見到的[xampp](https://www.apachefriends.org/zh_tw/index.html)、[wampserver](http://www.wampserver.com/en/)之外
還有這一套『[uniform server](http://www.uniformserver.com/)』
uniform server標榜的是體積小
主程式安裝檔案也才27M
不過相對功能就比較少
安裝程式只包含了apache、php5.4、mysql
其他的phpmyadmin、mariadb等等都可以利用plugin的方式來進行安裝
至於安裝的方法,只要將[檔案](http://sourceforge.net/projects/miniserver/files/latest/download?source=files)下載後,解壓縮到任一資料夾就可以使用了
以下為安裝步驟
1. 下載檔案(只有27M)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGSMZIWZYVqVwXtgsKk82q4q3qMkk-wu7VTtbCXYvf5CC4RnJ9JyYXEWa_yvRHSIIEjN-gQaclVmjebZPrw_BtV20O5peIy0VaMWxLQtw6ZMbyB_Z0L5ENk9fGElAMlMwGcH8Usl8IReXr/s1600/Image+2.png)
2. 點擊兩下解壓縮
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_iseZ0LLaI6G0Sn436leWTYHEpqWk5VlO_4HAqe66Q-MAZMbEo7qlvbEMZBRR9rBOYKh5fB_OVvL6dOJfdhrxRbqLvQ_ngTKS5goFDss3iwxT2UuZEMOfWoB01srNd9MZTnT-UrceDgh0/s1600/Image+4.png)
3. 進入UniServerZ資料夾
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGRBqRr6ZqJfp-Oq0P8pOnSpOiI6_kW-HAljC7Il6Lkrz0HElJNLrF8NinHP3ZQ-qj0SswbBpFOfmao_mPaHcXdAcwJT_qu6REP9I3DRVFBnFtGNTIJsTJfkrfeMpdy_xMswcbDBf9MsN1/s1600/Image+6.png)
4. 點擊UniController.exe(用系統管理員身份執行才能設定開機後自動執行wamp)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAtpKZskDbmo1NgqmVADAfBdGOBoktmuO5mXtpVEe8b02Ib04sh4BzoJnb8Ezu3XHBqlBxK-r48iHcVoz9DIa8I2OWkh1GWkuChrETvZZzHPn4UFAZXlWFJEgmYpN2DjEg5IrYvaQyWGQR/s1600/Image+8.png)
5. 允許防火牆
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAxbCelBqSOGgDcc5-Wqk7XOZWaY1lkbr4UZ-3QKqIT-6XuuyUDkN9BFqTyO6Dimh-JqIgx4pBO1pE-XMZHblI3H3kKDAYF6CopyCYVlVn3FUy7wSCjfEgwD-MBbbQjWnJE5ziYXyawHFa/s1600/Image+9.png)
6. 更改mysql root預設密碼,不更改可直接點選cancel(預設密碼為 root)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgniAC1VXppDyDwfibU7UGA2Nuz_D2DFyrxTf7VWrk_244cd2IKqhtz3XI5rs1SRKO2eTUth75Y80OnWgNbBfI6Olf3ileEeOMETHP4GUJS-YlFjFn9sLCyFa3n0tpS3Jp5EauPDaHxYAK3/s1600/Image+10.png)
7. 啟動apache及mysql
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghzDrxzzuv6Pj9PdJuWKFqe2H_Rm3VBkYm703-4P-vvPaUzpBPcmtFMeN2Sz93wxT63-0FfUVa8VHJ7Tt0BefMmUj-aW35lBzFz_eiHpXIpYHVwSeOqtdym7D7nCP5EeSDBO6kIK3ByO99/s1600/Image+14.png)
8. 設定開機執行apache及mysql
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVy_G0mWWtxBwkb_LLXpsGJwf_FOF6xxuFxQO3SaxwmiJqqBrQSLIETbpRl0Y50OdgMnn6zy753ZlbkgMXYNdmKCy2wBUCF8-5_PmHN5n0g5gZJWnNjpPH0Z77hHNqRyUZyuL9HcxBSZdn/s1600/Image+15.png)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio_nddjp6pVCPep37Smjvq_Z2J2IdeK4ggN6IUIq8msqC322odhViqqe7KFCrUcQnq-jlh_sB3Qu5H-hWRMigL1Pc9r8cctCvZU6EkxHjJwN2iJTK2L_SUV-GC4BYK92pXh-ZRR5saEk3Z/s1600/Image+16.png)
9. 這樣就設定完成了
![Alt text]()
其他比較常用到的apache及php設定
1.設定apache rewrite
2.設定php curl
要更改apache及php的設得先停止apache
設定rewrite的方法
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXsFIWK3aNI15VN_bwMuMA3T71_1IxwO7g_T6LhpEC76ZolQeNh4XSJ6Ez4r4Sgk8Bq4dHp39QVv8T6eHSv5gcVid_FoObbQDHxvVz97c1mdesmd6ATI_ZT-N0azzHyWHQnmiLMKKp6Emb/s1600/Image+17.png)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-YAcghp3EdqavoEhO9oJXzgFUYyDowhNWtSQhoFNQL0yklDeVGek2xsySNaMDta2AoPferkDNmc11naMNonlTJetGuF51tQuNN8ysEsBjSmC0hEwQ_cOtyw4VrI_XTLC4wlAo-WNKdnnV/s1600/Image+18.png)
設定php curl
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZIfNM56k7l1SyObNnrniKI00sRSXVVWiTbL6MhEHX3Fy4VeJOJWx6pqiRqt8pwsVkAZbI42ZjV-77bpsCwrbZf3Ze-MqE2HfRKE-4DUFuCg_zaHyCLER9mUsX4uuaSB6kIoyrWldIRAUC/s1600/Image+19.png)
![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb-SAYNPXW6r0hyphenhyphen5R0R3tij_EsBZ2dG-raaT02vRidtitVH-4S89_FJ5cxz4F-9ylMWp-oBU2Qjv57ICl3AnQmmTSFSV20FfagOJjRl7KzLuRSOMCwJl2G58gd7cZz1sqnvECDktWefGNd/s1600/Image+20.png)
訂閱:
文章 (Atom)