Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ If `php` is not in your system PATH you will need to put in the full path to you
## Commands

* `php-server:start` — Start / Restart PHP server from project path
* `php-server:start-public` — Start / Restart PHP server from folder public in project path
* `php-server:start-tree` — Start / Restart PHP server from folder/file selected in tree
* `php-server:start-document` — Start / Restart PHP server from currently open file
* `php-server:stop` — Stop running PHP server
Expand Down
5 changes: 5 additions & 0 deletions lib/php-server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports =

activate: ->
atom.commands.add 'atom-workspace', "php-server:start", => @start()
atom.commands.add 'atom-workspace', "php-server:start-public", => @startPublic()
atom.commands.add 'atom-workspace', "php-server:start-tree", => @startTree()
atom.commands.add 'atom-workspace', "php-server:start-tree-route", => @startTreeRoute()
atom.commands.add 'atom-workspace', "php-server:start-document", => @startDocument()
Expand All @@ -59,6 +60,10 @@ module.exports =
@stop()


startPublic: ->
documentroot = atom.project.getPaths()[0]+"/public"
@start documentroot

startTree: ->
@start atom.packages.getLoadedPackage('tree-view').mainModule.treeView.selectedPath

Expand Down
1 change: 1 addition & 0 deletions menus/php-server.cson
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
label: 'PHP Server',
submenu: [
{ label: 'Start in project root', command: 'php-server:start' }
{ label: 'Start in folder public in project root', command: 'php-server:start-public' }
{ label: 'Start in folder selected in tree', command: 'php-server:start-tree' }
{ label: 'Start in folder of current file', command: 'php-server:start-document' }
]
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"version": "0.8.0",
"description": "Run a local PHP server from within Atom, displaying the log in a bottom panel",
"activationCommands": {
"atom-workspace": "php-server:start",
"atom-workspace": [
"php-server:start",
"php-server:start-public"
],
".tree-view": [
"php-server:start-tree",
"php-server:start-tree-route"
Expand Down