diff --git a/README.md b/README.md index 14effdc..5b6ceb1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/php-server.coffee b/lib/php-server.coffee index e851a62..6819156 100644 --- a/lib/php-server.coffee +++ b/lib/php-server.coffee @@ -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() @@ -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 diff --git a/menus/php-server.cson b/menus/php-server.cson index f35a3e0..5b7d467 100644 --- a/menus/php-server.cson +++ b/menus/php-server.cson @@ -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' } ] diff --git a/package.json b/package.json index 8fa3231..028e612 100644 --- a/package.json +++ b/package.json @@ -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"