How to open a project in PhpStorm using command line - phpstorm

I am using Git Command Line, Homestead, Windows 10, PhpStorm 2017.3.
I want to open any project in PhpStorm using git bash /command line.

Just pass FULL path to the project root folder as parameter to PhpStorm executable file -- IDE will either open existing project (if .idea subfolder exist) or will create brand new project from those files.
It works the same as if you would use Open from within PhpStorm and point to such folder.
An example:
"C:\Program Files\JetBrains\PhpStorm\bin\phpstorm64.exe" "C:\Projects\MyProject"
phpstorm64.exe is for 64-bit Java
For 32-bit Java you should use phpstorm.exe
You can add path to PhpStorm executable into system's PATH variable so there will be no need to use the full path. But then you have to install new versions into the same folder or update PATH as needed. The you could just use phpstorm64.exe "C:\Projects\MyProject".
You can also create some alias/batch file (similar idea to what Mac/Linux user have -- there IDE creates that for them) so it's easier to use. It's a bit more initial work but easier to keep the path up to date.

You may want to specify another path for your program but if nothing else just use this I guess.

Related

How to open a project in PhpStorm from command line on Windows

How to open a project in PhpStorm from command line on Windows?
I tired this:
How to open a directory in PHPStorm or IntelliJ (or any JetBrains IDE) from the command line? but can't find Tools -> Create command line launcher on Windows.
I am using latest PhpStorm.
To open the current directory just run:
phpstorm64 .
If you are using git bash on Windows run:
cmd "/C phpstorm64 ."
Make sure that C:\Program Files\JetBrains\PhpStorm 2018.3.3\bin is in your environment variable PATH (it is by default after the installation)
Edit 2021:
Install Jetbrains Toolbox
Go to settings
Enable "Shell Scripts" and follow the instructions
Now you can use "phpstorm ." to open the current directory.
On macOS ( I assume on windows too) there is option to "Create Command-line Launcher". Just click that and you are good to go next time you open a terminal.
You can even specify how you would like to start "pstorm" / "phpstorm" / "ps" etc.. up to you.
Command-line launcher is currently only available fo UNIX; there is a feature request for providing it on Windows, IDEA-114307, please feel free to vote for it.
If you like to start PhpStorm from command prompt, open cmd console, cd to %PS_install_dir%/bin and run either phpstorm64.exe or phpstorm.bat, passing a path to project folder to it, like it's described in https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html. If you like to start it from any directory, add %PS_install_dir%/bin to your system %PATH%
I know this is too late, but it will help others if they need it:
if you want to open phpStorm in the current directory via cmd/Powershell, just use this command:
phpstorm64.exe .
Or if you want to open it in another directory, just use:
phpstorm64.exe YOUR_DIRECTORY_PATH
as simple as that!
go to your project using terminal
Cd myproject
and write
phpstorm64.exe
then hit enter
I see this is a little old but I wanted to supply my answer as I was grappling with this yesterday. My solution was to use cygwin.
Track down the phpstorm bin folder called something like C:\Users\UserName\AppData\Local\JetBrains\Toolbox\apps\PhpStorm\ch-0\201.7223.96\bin and add it to your windows system Path environment variable.
Next fire up a cygwin terminal and navigate into your project directory. I'm not a bash expert so I struggled to sort out the code as an alias but if you run:
crntproj=$(cygpath -w $PWD)
phpstorm.bat $crntproj
You need cygpath because simply running phpstorm.bat $PWD doesn't work as PHPStorm tries to open a folder called $PWD. I tried a bunch of variations trying to get it to open and none seemed to work.
It will fire up phpstorm with the current folder as the project path. And you now have a terminal feed from your project too.

add a existing javascript file to netbeans project, is it possible

I want to try netbeans for web development. I created a new local project. I have my remote server files (javascript, php etc) accessible locally on my computer using sftp in linux, now I just want to add these files to the project but there is no 'add files' possibility. Have Oracle forgotten something so obvious as add existing files? I can't believe it.
To add an external file to your NetBeans project:
Select the file in the file system that you want to add to your NetBeans project using a file manager (such as File Explorer on Windows).
Right-click and select Copy from the popup menu.
Within NetBeans go to your project and position the mouse over the target directory to which you want to copy the file. You can do this in the Projects panel or the Files panel as appropriate.
Right-click and select Paste.
That's all there is to it. This works on Linux and Windows. You can also do drag and drop, though on Linux the file is copied whereas on Windows the file is moved.
There is no menu option in NetBeans such as File -> Import existing file to do this. Just use an external file manager.
Update/clarification:
The instructions above only specify how to copy an existing file into an existing project.
There is no way to include an individual file that is external to the structure of a NetBeans project.
However, it is possible to create a symbolic link (junction) from a NetBeans project directory to an external directory. To do that open a Command Prompt window as an administrator and enter a command similar to this:
mklink /J D:\NetBeansProjects\HTML5DemoCss\nbProject\MyLink2 C:\sftp
That will create a new directory in your NetBeans project named MyLink2 which maps to an external directory named c:\sftp. You can then process files in that external directory C:\sftp as though they were within your project directory MyLink.

PhpStorm: how to use project root variable or relative path in PhpUnit configuration?

I would like to setup PhpUnit in PhpStorm. I press 1. Edit Configurations... and would like to enter this parameter in field 2.
I am using phpunit.xml as configuration file and all want to use a relative path like:
phpunit.xml
or use project root variable like
$PROJECT_ROOT/phpunit.xml
But both options are not working for me.
Based on your screenshot (the place where you want to use it): use full path -- in project settings such path is stored relative to the project root anyway (unless you specify some file which is outside of the project, of course) and the full path then reconstructed when needed (e.g. when shown to you or when used as a parameter during tests execution).
I don't think you'll be able to achieve what you want via the project's Run/Debug configurations. What might help you is the Default configuration file setting in your default project settings, which can be used to define the PHPUnit configuration file to use by default, so you don't need to specify it via the Use alternative configuration file option in your Run/Debug configuration.
To set this, open your Default Settings window, then navigate to Languages & Frameworks -> PHP -> PHPUnit. In the Test Runner section tick the Default configuration file checkbox and specify the location where you keep your configuration file. If this file will always be in the same path relative to your project root, you can use the $PROJECT_DIR$ variable to define the project root. So if your PHPUnit configuration file is always in the root of your project, you might set this to something like $PROJECT_DIR$/phpunit.xml. When you create a new project, its Default configuration file variable will be set to the file offset from your project root, and you won't need to use the Use alternative configuration file option in your Run/Debug configuration.
If you're opening the same project in different locations on the same machine this should work for new projects without any problem, if you want to share this configuration across machines, you might need to try PHPStorm's Exporting and Importing Settings functionality.
I'm not sure if this directly solves your problem, and it's a few months late anyway, but maybe this will be useful for someone else who stumbles across this question... The above instructions were correct for my 8.0.3 installation on Linux.

How do I extend the $PATH that Sublime Text 2 uses?

I just installed Sublime-jshint (and the requisite node.js + jshint) but get this error when I try to invoke JSHint from within ST2:
[Errno 2] No such file or directory
[cmd: [u'jshint', u'PATH-TO-THE-JS-FILE-I-AM-LINTING', u'--reporter', u'/home/cmg/.config/sublime-text-2/Packages/JSHint/reporter.js']]
[dir: DIR-MY-JS-FILE-IS-IN]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cmg/bin]
[Finished]
The final item in the given path is in the home dir of my user (cmg), so it's been customized somehow... but I don't recall how, so I don't know how to add the dir I need (~/node_modules/.bin).
I've added it to $PATH in my shell (via both .bashrc and .bash_profile) but ST2 doesn't pick it up.
(I'm on Ubuntu 14.04. All the usable stuff I've found via Google on this subject has been either OS X specific or related to ST's build system).
Basically, the exec command, which the jshint package uses internally, allows you to set/extend the PATH of the spawned subprocess. (docs)
The package actually uses this path argument on OSX, but has it hardcoded (I am partly guilty of that as I rewrote the command because it was just horrible before). It should allow for a setting to specify the path to your jshint executable, so I suggest you create an issue for that.
I don't know why ST dosn't pick up your PATH from somewhere else since I have very little experience with that.
Open /etc/profile in Sublime (using sudo) and add the following line at the very bottom:
export PATH=/home/cmg/node_modules/.bin:$PATH
and save the file. Restart completely, and your PATH should be updated.

What is the method or class or whatever that show me the configurations files of JRuby?

I'm new to JRuby, I installed it on windows 8, and I'm following it's wiki. When the wiki said to change a configuration option, it dose not say exactally where I can find the file where the option resides, it gives only its name but not the full path.
So is their a method that I can run on jirb to find the path to any configuration path.
thanks.
The .jrubyrc file is searched in your current directory (user.dir Java property), your home directory (user.home), and since you're on Windows, also in HOMEDRIVE\HOMEPATH, in this order (and the first one wins).