SlideShare a Scribd company logo
1 of 73
Download to read offline
PHP
Visual Studio Code
2016/08/27
他(Shengyou(Fan
Community(Open(Camp
范聖佑
@shengyou
http://shengyoufan.com
https://www.facebook.com/shengyoufan
得寬科技 研究員
Laravel 台灣 傳教士
Laravel 道場 作者
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel
http://www.laravelCdojo.com/
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel 中 ⽣生
2016.03
多
2016.01
在
2015.07
下
2014.12
2015.05
多
2015.12
多
2016.02
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel 中 ⽣生
2016.07
快 ⼤大
2016.08
和分多
事
以能 道
以能 道
…
道
…
道
(′ ‵ )
…
以能 過
( ⼀一 )
以能 …
點 點⽤用 點
PHP Visual Studio CodeMicrosoft Community Open Camp
⼀一 以能
• PHP
- (Syntax Highlight)
- ⼀一 (Code Block/Snippets)
-
- 不
- 會 你
•
- 以
-
PHP Visual Studio CodeMicrosoft Community Open Camp
你
Editor IDE
• Microsoft 以能
• Electron
• 點 你
• ⽤用 點 點
• 微 個 要
也 v1.4
https://code.visualstudio.com/
Visual Studio Code
PHP Visual Studio CodeMicrosoft Community Open Camp
• 2016/05 開
- Visual Studio Code
- wagon +VS Code 時 Windows
PHP/Laravel 就
- wagon +VS Code
PHP Visual Studio CodeMicrosoft Community Open Camp
• 國
• 新
• wagon 可
•
PHP Visual Studio CodeMicrosoft Community Open Camp
2 國
• 吧 Ctrl + P
• 有 Ctrl + Shift + P
…
PHP Visual Studio CodeMicrosoft Community Open Camp
吧
吧 國
Ctrl + P
PHP Visual Studio CodeMicrosoft Community Open Camp
有
國
Ctrl + Shift + P
PHP Visual Studio CodeMicrosoft Community Open Camp
國
PHP Visual Studio CodeMicrosoft Community Open Camp
國
• 國
- https://code.visualstudio.com/docs/customization/keybindings
PHP Visual Studio CodeMicrosoft Community Open Camp
新 VS Code
• 個
- VS Code 對
•
- ⽤用 新
•
- 沒 新
- .vscode 來 這
PHP Visual Studio CodeMicrosoft Community Open Camp
以能 吧
新
PHP Visual Studio CodeMicrosoft Community Open Camp
了吧
• 吧 了吧 Ctrl + S
{(
((((//(Controls(auto(save(of(dirty(files.(Accepted(values:((
"off",("afterDelay",("onFocusChange".(If(set(to("afterDelay"(
you(can(configure(the(delay(in("files.autoSaveDelay".(
(((("files.autoSave":("off",(
((((//(Controls(the(delay(in(ms(after(which(a(dirty(file(is(
saved(automatically.(Only(applies(when("files.autoSave"(is(
set(to("afterDelay"(
(((("files.autoSaveDelay":(1000(
}
onFocusChange
PHP Visual Studio CodeMicrosoft Community Open Camp
以能 成
• 出 麼 以能 ⼈人
{(
((((//(Zoom(the(font(of(the(editor(when(using(mouse(wheel(
and(holding(Ctrl(
(((("editor.mouseWheelZoom":(false,(
} true
VS Code 成 Ctrl + + Ctrl + -
PHP Visual Studio CodeMicrosoft Community Open Camp
⼀一 成
• 事
{(
((((//(Controls(whether(the(editor(should(render(indent(guides(
(((("editor.renderIndentGuides":(false,(
} true
PHP Visual Studio CodeMicrosoft Community Open Camp
VS Code
http://hz.edushi.com/bang/info/4-109-n3038834.html
事
VS Code wagon
PHP Visual Studio CodeMicrosoft Community Open Camp
git.exe php.exe
PHP Visual Studio CodeMicrosoft Community Open Camp
git.exe php.exe
• Laravel 中 ⽣生 只
• Cmder點UwAmp點git點Composer
你
• 就 點port
• 點 點 ⾃自成 事
• 就 事
也 v1.3.0
http://www.laravel-dojo.com/opensource/wagon
wagon
PHP Visual Studio CodeMicrosoft Community Open Camp
就 PATH
PHP Visual Studio CodeMicrosoft Community Open Camp
• VS Code $SHELL %COMSPEC%
Console Git Bash
新 Cmd
{(
//(Integrated(Terminal(
((((//(The(path(of(the(shell(that(the(terminal(uses(on(Windows.(
((("terminal.integrated.shell.windows":("C:Windo...cmd.exe"(
}
wagongitbinbash.exe
PHP Visual Studio CodeMicrosoft Community Open Camp
Terminal
Ctrl + `
PHP Visual Studio CodeMicrosoft Community Open Camp
⼀一
PHP Visual Studio CodeMicrosoft Community Open Camp
https://marketplace.visualstudio.com/VSCode
VS Code PHP 你
PHP Visual Studio CodeMicrosoft Community Open Camp
VS Code PHP 微
• VS Code
•
• ⼀一
•
•
PHP Visual Studio CodeMicrosoft Community Open Camp
微 PHP ⼀一
PHP Visual Studio CodeMicrosoft Community Open Camp
⼀一
微 code block (snippets) ⼀一
PHP Visual Studio CodeMicrosoft Community Open Camp
PHP 的
PHP Visual Studio CodeMicrosoft Community Open Camp
事
PHP Visual Studio CodeMicrosoft Community Open Camp
• 不
• 不 了吧
PHP 不
{(
//(PHP(
((((//(Whether(php(validation(is(enabled(or(not.(
(((("php.validate.enable":(true,(
((((//(Points(to(the(php(executable.(
(((("php.validate.executablePath":(null,(
((((//(Whether(the(linter(is(run(on(save(or(on(type.(
(((("php.validate.run":("onSave"(
} onType
PHP Visual Studio CodeMicrosoft Community Open Camp
Problem
⽤用吧
PHP Visual Studio CodeMicrosoft Community Open Camp
PHP
• 以能
- EditorConfig
- Composer
- PHP Symbols
- Crane
- Search Docsets
PHP Visual Studio CodeMicrosoft Community Open Camp
EditorConfig forVS Code
;(.editorconfig(
root(=(true(
[*](
charset(=(utfC8(
indent_size(=(4(
indent_style(=(space(
end_of_line(=(lf(
insert_final_newline(=(true(
trim_trailing_whitespace(=(true(
[package.json](
indent_size(=(2(
trim_trailing_whitespace(=(true(
[*.md](
trim_trailing_whitespace(=(false
PHP Visual Studio CodeMicrosoft Community Open Camp
Composer
• PATH PHP interpreter
• Composer 是
{(
//(Composer(Dependency(Manager(for(PHP(Configuration(
((((//(Is(composer(enabled.(
(((("composer.enabled":(true,(
((((//(Path(to(the(composer(executable.(
(((("composer.executablePath":(null(
}
"wagoncomposercomposer.bat"
PHP Visual Studio CodeMicrosoft Community Open Camp
Composer
PHP Visual Studio CodeMicrosoft Community Open Camp
Crane
PHP Visual Studio CodeMicrosoft Community Open Camp
PHP Symbols
PHP Visual Studio CodeMicrosoft Community Open Camp
Search Docsets
Shift + F1
Zeal https://zealdocs.org/
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel ⼀一
• Laravel ⼀一 都
- Laravel 5 Snippets
- Laravel Blade Snippets
說 Winnie Lin 事
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel 5 Snippets
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel Blade Snippets
PHP Visual Studio CodeMicrosoft Community Open Camp
PHP
• 上情 發
- echo (!) + exit
- print_r() + exit
- var_dump() + exit
• Laravel 會
- dd() ( SymfonyVarDumper)
PHP Visual Studio CodeMicrosoft Community Open Camp
recca0120/laravelCtracy
• Laravel Recca 讓 Debug
• Nette Framework Tracy
• Laravel
•
- Exception 好
- 的 會
- 以能 URL Handler
- artisan (Laravel 的)
https://github.com/recca0120/laravel-tracy
PHP Visual Studio CodeMicrosoft Community Open Camp
Package
• Composer
• 以能 composer.json
$(composer(require(recca0120/laravelCtracy(
{(
(((("require":({(
(((((((("recca0120/laravelCtracy":("^1.7"(
((((}(
}
$(composer(update
PHP Visual Studio CodeMicrosoft Community Open Camp
//(index.php(
<?php(
require(__DIR__(.('/vendor/autoload.php';(
use(Recca0120LaravelTracyTracy;(
Tracy::instance();
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel
• Service Provider
• 也 config
//(config/app.php(
'providers'(=>([(
((((//(...(
((((Recca0120LaravelTracyServiceProvider::class,(
((((//(...(
];
$([php](artisan(vendor:publish(((
CCprovider="Recca0120LaravelTracyServiceProvider"
PHP Visual Studio CodeMicrosoft Community Open Camp
Laravel
PHP Visual Studio CodeMicrosoft Community Open Camp
editor
//(config/tracy.php(
<?php(
return([(
(((('enabled'(=>(true,(
(((('showBar'(=>(true,(
(((('accepts'(=>([(
(((((((('text/html',(
((((],(
(((('editor'(=>('vscode://open?url=file://%file&line=%line',(
(((('panels'(=>([(
(((((((('{name}'(=>({boolean},(
((((],(
];
PHP Visual Studio CodeMicrosoft Community Open Camp
VS Code URL Handler
https://github.com/shengyou/vscodeChandler
PHP Visual Studio CodeMicrosoft Community Open Camp
點 吧 國 事
breakpoint 道
debug道
- 還 Oomusou
http://oomusou.io/(
PHP Visual Studio CodeMicrosoft Community Open Camp
PHP 到 道
• 不 Debug PHP
• PHP Debug VS Code 微 到 會
PHP Visual Studio CodeMicrosoft Community Open Camp
XDebug
• UwAmp XDebug Remote Auto Start
PHP Visual Studio CodeMicrosoft Community Open Camp
XDebug
• UwAmp XDebug Remote Enable
PHP Visual Studio CodeMicrosoft Community Open Camp
launch.json
{(
(((("version":("0.2.0",(
(((("configurations":([(
(((((((({(
(((((((((((("name":("Listen(for(XDebug",(
(((((((((((("type":("php",(
(((((((((((("request":("launch",(
(((((((((((("port":(9000(
((((((((},(
(((((((({(
(((((((((((("name":("Launch(currently(open(script",(
(((((((((((("type":("php",(
(((((((((((("request":("launch",(
(((((((((((("program":("${file}",(
(((((((((((("cwd":("${fileDirname}",(
(((((((((((("port":(9000(
((((((((}(
((((](
}
PHP Visual Studio CodeMicrosoft Community Open Camp
PHP Visual Studio CodeMicrosoft Community Open Camp
道
http://goo.gl/9Y7yR2
PHP Visual Studio CodeMicrosoft Community Open Camp
Visual Studio Code Settings Sync
• gist 吧了
https://github.com/shengyou/vscodeChandler
vscode-handler 道 事
https://github.com/laravelCdojo/wagon
wagon 道 事
Q & A

More Related Content

What's hot

What's hot (20)

用十分鐘 向jserv學習作業系統設計
用十分鐘  向jserv學習作業系統設計用十分鐘  向jserv學習作業系統設計
用十分鐘 向jserv學習作業系統設計
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
 
Maven基礎
Maven基礎Maven基礎
Maven基礎
 
Docker道場「Dockerの基本概念」0825インフラ勉強会資料
Docker道場「Dockerの基本概念」0825インフラ勉強会資料Docker道場「Dockerの基本概念」0825インフラ勉強会資料
Docker道場「Dockerの基本概念」0825インフラ勉強会資料
 
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
[JCConf 2022] Compose for Desktop - 開發桌面軟體的新選擇
 
Composer 經典食譜
Composer 經典食譜Composer 經典食譜
Composer 經典食譜
 
x86とコンテキストスイッチ
x86とコンテキストスイッチx86とコンテキストスイッチ
x86とコンテキストスイッチ
 
イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化
 
Become A Security Master
Become A Security MasterBecome A Security Master
Become A Security Master
 
PHP と SAPI と ZendEngine3 と
PHP と SAPI と ZendEngine3 とPHP と SAPI と ZendEngine3 と
PHP と SAPI と ZendEngine3 と
 
yieldとreturnの話
yieldとreturnの話yieldとreturnの話
yieldとreturnの話
 
ネットワークOS野郎 ~ インフラ野郎Night 20160414
ネットワークOS野郎 ~ インフラ野郎Night 20160414ネットワークOS野郎 ~ インフラ野郎Night 20160414
ネットワークOS野郎 ~ インフラ野郎Night 20160414
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
 
入門Transducers
入門Transducers入門Transducers
入門Transducers
 
The Usage and Patterns of MagicOnion
The Usage and Patterns of MagicOnionThe Usage and Patterns of MagicOnion
The Usage and Patterns of MagicOnion
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
 
聊聊測試左移
聊聊測試左移聊聊測試左移
聊聊測試左移
 
이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정
 
PHP AST 徹底解説
PHP AST 徹底解説PHP AST 徹底解説
PHP AST 徹底解説
 

Viewers also liked

Viewers also liked (16)

凌波微步:wagon + VS Code 的輕功哲學
凌波微步:wagon + VS Code 的輕功哲學凌波微步:wagon + VS Code 的輕功哲學
凌波微步:wagon + VS Code 的輕功哲學
 
Visual Studio Code 快速上手指南
Visual Studio Code 快速上手指南Visual Studio Code 快速上手指南
Visual Studio Code 快速上手指南
 
Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)
 
Internet of Things With PHP
Internet of Things With PHPInternet of Things With PHP
Internet of Things With PHP
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 
Php
PhpPhp
Php
 
PHP Optimization
PHP OptimizationPHP Optimization
PHP Optimization
 
PHP WTF
PHP WTFPHP WTF
PHP WTF
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPC
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
 
Php 101: PDO
Php 101: PDOPhp 101: PDO
Php 101: PDO
 
LaravelConf Taiwan 2017 開幕
LaravelConf Taiwan 2017 開幕LaravelConf Taiwan 2017 開幕
LaravelConf Taiwan 2017 開幕
 
Route 路由控制
Route 路由控制Route 路由控制
Route 路由控制
 

Similar to [Community Open Camp] 給 PHP 開發者的 VS Code 指南

Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013
Rack Lin
 

Similar to [Community Open Camp] 給 PHP 開發者的 VS Code 指南 (20)

Setting advanced PHP development environment
Setting advanced PHP development environmentSetting advanced PHP development environment
Setting advanced PHP development environment
 
Introduction of laravel framework.
Introduction of laravel framework.Introduction of laravel framework.
Introduction of laravel framework.
 
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
 
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP framework
 
Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$
 
Laravel intallation
Laravel intallationLaravel intallation
Laravel intallation
 
快快樂樂打造自動化開發環境
快快樂樂打造自動化開發環境快快樂樂打造自動化開發環境
快快樂樂打造自動化開發環境
 
徒手打造自己的粉專客服機器人
徒手打造自己的粉專客服機器人 徒手打造自己的粉專客服機器人
徒手打造自己的粉專客服機器人
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009
 
キレイ会議 on Laravel
キレイ会議 on Laravelキレイ会議 on Laravel
キレイ会議 on Laravel
 
Eugene PHP June 2015 - Let's Talk Laravel
Eugene PHP June 2015 - Let's Talk LaravelEugene PHP June 2015 - Let's Talk Laravel
Eugene PHP June 2015 - Let's Talk Laravel
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
PHP Ecosystem and Best Practices
PHP Ecosystem and Best PracticesPHP Ecosystem and Best Practices
PHP Ecosystem and Best Practices
 
Getting started with laravel
Getting started with laravelGetting started with laravel
Getting started with laravel
 
2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently
 

More from Shengyou Fan

[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
Shengyou Fan
 

More from Shengyou Fan (20)

[GDG Kaohsiung DevFest 2023] 以 Compose 及 Kotlin Multiplatform 打造多平台應用程式
[GDG Kaohsiung DevFest 2023] 以 Compose 及 Kotlin Multiplatform 打造多平台應用程式[GDG Kaohsiung DevFest 2023] 以 Compose 及 Kotlin Multiplatform 打造多平台應用程式
[GDG Kaohsiung DevFest 2023] 以 Compose 及 Kotlin Multiplatform 打造多平台應用程式
 
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
 
[Kotlin 讀書會第五梯次] 深入淺出 Kotlin 第一章導讀
[Kotlin 讀書會第五梯次] 深入淺出 Kotlin 第一章導讀[Kotlin 讀書會第五梯次] 深入淺出 Kotlin 第一章導讀
[Kotlin 讀書會第五梯次] 深入淺出 Kotlin 第一章導讀
 
[WebConf Taiwan 2023] 一份 Zend Engine 外帶!透過 Micro 讓一次打包、多處運行變得可能
[WebConf Taiwan 2023] 一份 Zend Engine 外帶!透過 Micro 讓一次打包、多處運行變得可能[WebConf Taiwan 2023] 一份 Zend Engine 外帶!透過 Micro 讓一次打包、多處運行變得可能
[WebConf Taiwan 2023] 一份 Zend Engine 外帶!透過 Micro 讓一次打包、多處運行變得可能
 
How I make a podcast website using serverless technology in 2023
How I make a podcast website using serverless technology in 2023How I make a podcast website using serverless technology in 2023
How I make a podcast website using serverless technology in 2023
 
[Effective Kotlin 讀書會] 第八章 Efficient collection processing 導讀
[Effective Kotlin 讀書會] 第八章 Efficient collection processing 導讀[Effective Kotlin 讀書會] 第八章 Efficient collection processing 導讀
[Effective Kotlin 讀書會] 第八章 Efficient collection processing 導讀
 
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
[MOPCON 2022] 以 Kotlin Multiplatform 制霸全平台
 
Using the Exposed SQL Framework to Manage Your Database
Using the Exposed SQL Framework to Manage Your DatabaseUsing the Exposed SQL Framework to Manage Your Database
Using the Exposed SQL Framework to Manage Your Database
 
[COSCUP 2022] 讓黑畫面再次偉大 - 用 PHP 寫 CLI 工具
[COSCUP 2022] 讓黑畫面再次偉大 - 用 PHP 寫 CLI 工具[COSCUP 2022] 讓黑畫面再次偉大 - 用 PHP 寫 CLI 工具
[COSCUP 2022] 讓黑畫面再次偉大 - 用 PHP 寫 CLI 工具
 
[COSCUP 2022] Kotlin Collection 遊樂園
[COSCUP 2022] Kotlin Collection 遊樂園[COSCUP 2022] Kotlin Collection 遊樂園
[COSCUP 2022] Kotlin Collection 遊樂園
 
初探 Kotlin Multiplatform
初探 Kotlin Multiplatform初探 Kotlin Multiplatform
初探 Kotlin Multiplatform
 
簡化 JVM 上雲 - 透過 Azure Spring Cloud 提升開發、發佈及服務監控效率
簡化 JVM 上雲 - 透過 Azure Spring Cloud 提升開發、發佈及服務監控效率簡化 JVM 上雲 - 透過 Azure Spring Cloud 提升開發、發佈及服務監控效率
簡化 JVM 上雲 - 透過 Azure Spring Cloud 提升開發、發佈及服務監控效率
 
以 Kotlin Multiplatform Mobile (KMM) 開發跨平台行動應用
以 Kotlin Multiplatform Mobile (KMM) 開發跨平台行動應用以 Kotlin Multiplatform Mobile (KMM) 開發跨平台行動應用
以 Kotlin Multiplatform Mobile (KMM) 開發跨平台行動應用
 
老派浪漫:用 Kotlin 寫 Command Line 工具
老派浪漫:用 Kotlin 寫 Command Line 工具老派浪漫:用 Kotlin 寫 Command Line 工具
老派浪漫:用 Kotlin 寫 Command Line 工具
 
[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator
[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator
[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator
 
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
 
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
 
[Kotlin Serverless 工作坊] 單元 1 - 開發環境建置
[Kotlin Serverless 工作坊] 單元 1 - 開發環境建置[Kotlin Serverless 工作坊] 單元 1 - 開發環境建置
[Kotlin Serverless 工作坊] 單元 1 - 開發環境建置
 
用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手用 Kotlin 打造讀書會小幫手
用 Kotlin 打造讀書會小幫手
 
Kotlin 讀書會第三梯次第一章
Kotlin 讀書會第三梯次第一章Kotlin 讀書會第三梯次第一章
Kotlin 讀書會第三梯次第一章
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

[Community Open Camp] 給 PHP 開發者的 VS Code 指南

  • 3. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel http://www.laravelCdojo.com/
  • 4. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel 中 ⽣生 2016.03 多 2016.01 在 2015.07 下 2014.12 2015.05 多 2015.12 多 2016.02
  • 5. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel 中 ⽣生 2016.07 快 ⼤大 2016.08 和分多 事
  • 12. PHP Visual Studio CodeMicrosoft Community Open Camp ⼀一 以能 • PHP - (Syntax Highlight) - ⼀一 (Code Block/Snippets) - - 不 - 會 你 • - 以 -
  • 13. PHP Visual Studio CodeMicrosoft Community Open Camp 你 Editor IDE
  • 14. • Microsoft 以能 • Electron • 點 你 • ⽤用 點 點 • 微 個 要 也 v1.4 https://code.visualstudio.com/ Visual Studio Code
  • 15. PHP Visual Studio CodeMicrosoft Community Open Camp • 2016/05 開 - Visual Studio Code - wagon +VS Code 時 Windows PHP/Laravel 就 - wagon +VS Code
  • 16. PHP Visual Studio CodeMicrosoft Community Open Camp • 國 • 新 • wagon 可 •
  • 17. PHP Visual Studio CodeMicrosoft Community Open Camp 2 國 • 吧 Ctrl + P • 有 Ctrl + Shift + P …
  • 18. PHP Visual Studio CodeMicrosoft Community Open Camp 吧 吧 國 Ctrl + P
  • 19. PHP Visual Studio CodeMicrosoft Community Open Camp 有 國 Ctrl + Shift + P
  • 20. PHP Visual Studio CodeMicrosoft Community Open Camp 國
  • 21. PHP Visual Studio CodeMicrosoft Community Open Camp 國 • 國 - https://code.visualstudio.com/docs/customization/keybindings
  • 22. PHP Visual Studio CodeMicrosoft Community Open Camp 新 VS Code • 個 - VS Code 對 • - ⽤用 新 • - 沒 新 - .vscode 來 這
  • 23. PHP Visual Studio CodeMicrosoft Community Open Camp 以能 吧 新
  • 24. PHP Visual Studio CodeMicrosoft Community Open Camp 了吧 • 吧 了吧 Ctrl + S {( ((((//(Controls(auto(save(of(dirty(files.(Accepted(values:(( "off",("afterDelay",("onFocusChange".(If(set(to("afterDelay"( you(can(configure(the(delay(in("files.autoSaveDelay".( (((("files.autoSave":("off",( ((((//(Controls(the(delay(in(ms(after(which(a(dirty(file(is( saved(automatically.(Only(applies(when("files.autoSave"(is( set(to("afterDelay"( (((("files.autoSaveDelay":(1000( } onFocusChange
  • 25. PHP Visual Studio CodeMicrosoft Community Open Camp 以能 成 • 出 麼 以能 ⼈人 {( ((((//(Zoom(the(font(of(the(editor(when(using(mouse(wheel( and(holding(Ctrl( (((("editor.mouseWheelZoom":(false,( } true VS Code 成 Ctrl + + Ctrl + -
  • 26. PHP Visual Studio CodeMicrosoft Community Open Camp ⼀一 成 • 事 {( ((((//(Controls(whether(the(editor(should(render(indent(guides( (((("editor.renderIndentGuides":(false,( } true
  • 27. PHP Visual Studio CodeMicrosoft Community Open Camp VS Code http://hz.edushi.com/bang/info/4-109-n3038834.html 事 VS Code wagon
  • 28. PHP Visual Studio CodeMicrosoft Community Open Camp git.exe php.exe
  • 29. PHP Visual Studio CodeMicrosoft Community Open Camp git.exe php.exe
  • 30. • Laravel 中 ⽣生 只 • Cmder點UwAmp點git點Composer 你 • 就 點port • 點 點 ⾃自成 事 • 就 事 也 v1.3.0 http://www.laravel-dojo.com/opensource/wagon wagon
  • 31. PHP Visual Studio CodeMicrosoft Community Open Camp 就 PATH
  • 32. PHP Visual Studio CodeMicrosoft Community Open Camp • VS Code $SHELL %COMSPEC% Console Git Bash 新 Cmd {( //(Integrated(Terminal( ((((//(The(path(of(the(shell(that(the(terminal(uses(on(Windows.( ((("terminal.integrated.shell.windows":("C:Windo...cmd.exe"( } wagongitbinbash.exe
  • 33. PHP Visual Studio CodeMicrosoft Community Open Camp Terminal Ctrl + `
  • 34. PHP Visual Studio CodeMicrosoft Community Open Camp ⼀一
  • 35. PHP Visual Studio CodeMicrosoft Community Open Camp https://marketplace.visualstudio.com/VSCode
  • 36. VS Code PHP
  • 37. PHP Visual Studio CodeMicrosoft Community Open Camp VS Code PHP 微 • VS Code • • ⼀一 • •
  • 38. PHP Visual Studio CodeMicrosoft Community Open Camp 微 PHP ⼀一
  • 39. PHP Visual Studio CodeMicrosoft Community Open Camp ⼀一 微 code block (snippets) ⼀一
  • 40. PHP Visual Studio CodeMicrosoft Community Open Camp PHP 的
  • 41. PHP Visual Studio CodeMicrosoft Community Open Camp 事
  • 42. PHP Visual Studio CodeMicrosoft Community Open Camp • 不 • 不 了吧 PHP 不 {( //(PHP( ((((//(Whether(php(validation(is(enabled(or(not.( (((("php.validate.enable":(true,( ((((//(Points(to(the(php(executable.( (((("php.validate.executablePath":(null,( ((((//(Whether(the(linter(is(run(on(save(or(on(type.( (((("php.validate.run":("onSave"( } onType
  • 43. PHP Visual Studio CodeMicrosoft Community Open Camp Problem ⽤用吧
  • 44. PHP Visual Studio CodeMicrosoft Community Open Camp PHP • 以能 - EditorConfig - Composer - PHP Symbols - Crane - Search Docsets
  • 45. PHP Visual Studio CodeMicrosoft Community Open Camp EditorConfig forVS Code ;(.editorconfig( root(=(true( [*]( charset(=(utfC8( indent_size(=(4( indent_style(=(space( end_of_line(=(lf( insert_final_newline(=(true( trim_trailing_whitespace(=(true( [package.json]( indent_size(=(2( trim_trailing_whitespace(=(true( [*.md]( trim_trailing_whitespace(=(false
  • 46. PHP Visual Studio CodeMicrosoft Community Open Camp Composer • PATH PHP interpreter • Composer 是 {( //(Composer(Dependency(Manager(for(PHP(Configuration( ((((//(Is(composer(enabled.( (((("composer.enabled":(true,( ((((//(Path(to(the(composer(executable.( (((("composer.executablePath":(null( } "wagoncomposercomposer.bat"
  • 47. PHP Visual Studio CodeMicrosoft Community Open Camp Composer
  • 48. PHP Visual Studio CodeMicrosoft Community Open Camp Crane
  • 49. PHP Visual Studio CodeMicrosoft Community Open Camp PHP Symbols
  • 50. PHP Visual Studio CodeMicrosoft Community Open Camp Search Docsets Shift + F1 Zeal https://zealdocs.org/
  • 51. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel ⼀一 • Laravel ⼀一 都 - Laravel 5 Snippets - Laravel Blade Snippets 說 Winnie Lin 事
  • 52. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel 5 Snippets
  • 53. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel Blade Snippets
  • 54. PHP Visual Studio CodeMicrosoft Community Open Camp PHP • 上情 發 - echo (!) + exit - print_r() + exit - var_dump() + exit • Laravel 會 - dd() ( SymfonyVarDumper)
  • 55. PHP Visual Studio CodeMicrosoft Community Open Camp recca0120/laravelCtracy • Laravel Recca 讓 Debug • Nette Framework Tracy • Laravel • - Exception 好 - 的 會 - 以能 URL Handler - artisan (Laravel 的) https://github.com/recca0120/laravel-tracy
  • 56. PHP Visual Studio CodeMicrosoft Community Open Camp Package • Composer • 以能 composer.json $(composer(require(recca0120/laravelCtracy( {( (((("require":({( (((((((("recca0120/laravelCtracy":("^1.7"( ((((}( } $(composer(update
  • 57. PHP Visual Studio CodeMicrosoft Community Open Camp //(index.php( <?php( require(__DIR__(.('/vendor/autoload.php';( use(Recca0120LaravelTracyTracy;( Tracy::instance();
  • 58. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel • Service Provider • 也 config //(config/app.php( 'providers'(=>([( ((((//(...( ((((Recca0120LaravelTracyServiceProvider::class,( ((((//(...( ]; $([php](artisan(vendor:publish((( CCprovider="Recca0120LaravelTracyServiceProvider"
  • 59. PHP Visual Studio CodeMicrosoft Community Open Camp Laravel
  • 60. PHP Visual Studio CodeMicrosoft Community Open Camp editor //(config/tracy.php( <?php( return([( (((('enabled'(=>(true,( (((('showBar'(=>(true,( (((('accepts'(=>([( (((((((('text/html',( ((((],( (((('editor'(=>('vscode://open?url=file://%file&line=%line',( (((('panels'(=>([( (((((((('{name}'(=>({boolean},( ((((],( ];
  • 61. PHP Visual Studio CodeMicrosoft Community Open Camp VS Code URL Handler https://github.com/shengyou/vscodeChandler
  • 62. PHP Visual Studio CodeMicrosoft Community Open Camp 點 吧 國 事
  • 63. breakpoint 道 debug道 - 還 Oomusou http://oomusou.io/(
  • 64. PHP Visual Studio CodeMicrosoft Community Open Camp PHP 到 道 • 不 Debug PHP • PHP Debug VS Code 微 到 會
  • 65. PHP Visual Studio CodeMicrosoft Community Open Camp XDebug • UwAmp XDebug Remote Auto Start
  • 66. PHP Visual Studio CodeMicrosoft Community Open Camp XDebug • UwAmp XDebug Remote Enable
  • 67. PHP Visual Studio CodeMicrosoft Community Open Camp launch.json {( (((("version":("0.2.0",( (((("configurations":([( (((((((({( (((((((((((("name":("Listen(for(XDebug",( (((((((((((("type":("php",( (((((((((((("request":("launch",( (((((((((((("port":(9000( ((((((((},( (((((((({( (((((((((((("name":("Launch(currently(open(script",( (((((((((((("type":("php",( (((((((((((("request":("launch",( (((((((((((("program":("${file}",( (((((((((((("cwd":("${fileDirname}",( (((((((((((("port":(9000( ((((((((}( ((((]( }
  • 68. PHP Visual Studio CodeMicrosoft Community Open Camp
  • 69. PHP Visual Studio CodeMicrosoft Community Open Camp 道 http://goo.gl/9Y7yR2
  • 70. PHP Visual Studio CodeMicrosoft Community Open Camp Visual Studio Code Settings Sync • gist 吧了
  • 73. Q & A