vagrant-phpstorm-tunnel 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/data/php +8 -1
- data/lib/vagrant-phpstorm-tunnel/config.rb +7 -2
- data/lib/vagrant-phpstorm-tunnel/configurator.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ce5b93dfae8b36654916c65ecd96d32f6008424
|
4
|
+
data.tar.gz: 787bda93f441242c1fb0851501b9d79c24fd1a9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b25486928d1015ebd66b2fad4b3763b51566627a15274cd14985bf601391f9f94148a672726390612e4fbc0a8651bf5ac43575725003516fdbb5a05ce81cdd18
|
7
|
+
data.tar.gz: 7ce1e3a785a43f5e2c36f48512c6a4fae41a794a9e1526e68fa14068012ba1d581403710a4f26e5c7eb2ab7e001c8c3b1d22f5dd0f7692d3ed10d463526d6e35
|
data/README.md
CHANGED
@@ -14,13 +14,17 @@ vagrant plugin install vagrant-phpstorm-tunnel
|
|
14
14
|
Vagrantfile
|
15
15
|
-----------
|
16
16
|
You can configure your `project_home` path within `vagrant` machine. This is needed for proper paths mapping from `PhpStorm` during debugging (please have a look also section below).
|
17
|
+
Also you can configure prefix for each command executed into VM. For example you can prefix command with extra `sudo` permissions like in example below.
|
17
18
|
```ruby
|
18
19
|
Vagrant.configure('2') do |config|
|
19
20
|
(...)
|
20
21
|
config.phpstorm_tunnel.project_home = '/home/vagrant/fuboo'
|
22
|
+
config.phpstorm_tunnel.command_prefix = 'sudo'
|
21
23
|
end
|
22
24
|
```
|
23
25
|
|
26
|
+
By default the plugin assumes that your project is shared as `/vagrant` in the VM. It will copy PhpStorm's helper-scripts into `.idea/vagrant/tmp/` to make them accessible from within the VM.
|
27
|
+
|
24
28
|
PhpStorm
|
25
29
|
--------
|
26
30
|
`vagrant-phpstorm-tunnel` will create a file `.idea/vagrant/php` in your vagrant-project.
|
@@ -38,9 +42,3 @@ You should also export `PHP_IDE_CONFIG` parameter into `VM` environment with the
|
|
38
42
|
export PHP_IDE_CONFIG='serverName=www.fuboo.dev'
|
39
43
|
```
|
40
44
|
This is recommended to append above line to `~/.profile` file of your `VM`
|
41
|
-
|
42
|
-
|
43
|
-
Limitations
|
44
|
-
-----------
|
45
|
-
The plugin assumes your project is shared as `/vagrant` in the VM.
|
46
|
-
It will copy PhpStorm's helper-scripts into `.idea/vagrant/tmp/` to make them accessible from within the VM.
|
data/data/php
CHANGED
@@ -5,6 +5,7 @@ $projectDirHost = dirname(dirname(dirname($_SERVER['PHP_SELF'])));
|
|
5
5
|
$projectDirGuest = '/vagrant';
|
6
6
|
$homeDirHost = $projectDirHost . '/.idea/vagrant';
|
7
7
|
$pipe = 'vagrant ssh -c ';
|
8
|
+
$commandPrefix = '';
|
8
9
|
|
9
10
|
chdir($projectDirHost);
|
10
11
|
|
@@ -26,6 +27,12 @@ if (file_exists($projectDirGuestFile)) {
|
|
26
27
|
}
|
27
28
|
$homeDirGuest = $projectDirGuest . '/.idea/vagrant';
|
28
29
|
|
30
|
+
// Detect Command Prefix
|
31
|
+
$commandPrefixFile = $homeDirHost . '/vm_command_prefix';
|
32
|
+
if (file_exists($commandPrefixFile)) {
|
33
|
+
$commandPrefix = trim(file_get_contents($commandPrefixFile));
|
34
|
+
}
|
35
|
+
|
29
36
|
$arguments = $argv;
|
30
37
|
array_shift($arguments);
|
31
38
|
foreach ($arguments as $index => &$argument) {
|
@@ -61,4 +68,4 @@ if (isset($_SERVER['XDEBUG_CONFIG'])) {
|
|
61
68
|
$includePaths = array('.', $projectDirGuest . '/vendor/phpunit/phpunit');
|
62
69
|
$arguments = array_merge(array('-d', 'include_path=' . implode(':', $includePaths)), $arguments);
|
63
70
|
|
64
|
-
passthru($pipe . '"' . $env . ' php ' . implode(' ', $arguments) . '"');
|
71
|
+
passthru($pipe . '"' .$commandPrefix. ' ' . $env . ' php ' . implode(' ', $arguments) . '"');
|
@@ -1,15 +1,20 @@
|
|
1
1
|
module VagrantPhpstormTunnel
|
2
2
|
class Config < Vagrant.plugin(2, :config)
|
3
3
|
|
4
|
-
attr_accessor :project_home
|
4
|
+
attr_accessor :project_home, :command_prefix
|
5
5
|
|
6
6
|
def project_home=(path)
|
7
7
|
@project_home = path
|
8
8
|
end
|
9
9
|
|
10
|
+
def command_prefix=(command)
|
11
|
+
@command_prefix = command
|
12
|
+
end
|
13
|
+
|
10
14
|
def to_hash
|
11
15
|
{
|
12
|
-
:project_home => project_home
|
16
|
+
:project_home => project_home,
|
17
|
+
:command_prefix => command_prefix
|
13
18
|
}
|
14
19
|
end
|
15
20
|
end
|
@@ -31,6 +31,11 @@ module VagrantPhpstormTunnel
|
|
31
31
|
destination_path = File.join(@home_path, 'vm_project_dir')
|
32
32
|
File.write(destination_path, tunnel_options[:project_home].to_s, mode: 'a')
|
33
33
|
end
|
34
|
+
|
35
|
+
if tunnel_options[:command_prefix]
|
36
|
+
destination_path = File.join(@home_path, 'vm_command_prefix')
|
37
|
+
File.write(destination_path, tunnel_options[:command_prefix].to_s, mode: 'a')
|
38
|
+
end
|
34
39
|
end
|
35
40
|
|
36
41
|
def tunnel_options
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-phpstorm-tunnel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cargo Media
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-03-
|
13
|
+
date: 2014-03-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|