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"
}
```


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資料夾)

2. 開始右鍵 => 系統 => 進階系統設定 => 環境變數

3. 新增變數
變數名稱: PHP_HOME
變數值: PHP路徑(範例為C:\PHP)

4. 新增變數
變數名稱: COMPOSER_HOME
變數值: C:\ProgramData\ComposerSetup

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即可

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)

2. 點擊兩下解壓縮

3. 進入UniServerZ資料夾

4. 點擊UniController.exe(用系統管理員身份執行才能設定開機後自動執行wamp)

5. 允許防火牆

6. 更改mysql root預設密碼,不更改可直接點選cancel(預設密碼為 root)

7. 啟動apache及mysql

8. 設定開機執行apache及mysql


9. 這樣就設定完成了
![Alt text]()
其他比較常用到的apache及php設定
1.設定apache rewrite
2.設定php curl
要更改apache及php的設得先停止apache
設定rewrite的方法


設定php curl


訂閱:
文章 (Atom)