How to set tool path relative to current project in PhpStorm's Command Line Tool Support - phpstorm

I'm using PhpStorm's Command Line Tool Support for using Laravel's artisan as a "Tool based on Symfony console" as shown below:
Problem is I want to share this across all my projects (global scope). But if I hard code the path to /home/user/project/artisan in Tool path then it runs the that project's directory (not my currently open one). If I just put artisan it doesn't run.
Is there a template variable like $ProjectDir$ or something I can add in the Tool path?

Related

How to open a project in PhpStorm using command line

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.

PhpStorm namespace to Laravel's app directory

I seem to be having an issue with PhpStorm and Laravel, where for some strange reason, every time that I manually create a new class file it uses the app for the beginning of the namespace - even though I've set the app name with artisan. When generating files via artisan - namespace is correct - it's just when I create files manually from within the PhpStorm.
I'm sure it's an easy fix - I just don't quite know where in the settings is the option to update it.
Right click on directory -> Mark directory As -> Sources Root

How to open a window in Vivado using Tcl script?

I'd like to open a .vhd and .vhi file in window for editing in Vivado from Tcl Console, but I can't find any command for that.
As of at least Vivado 2014.2 any unrecognized Tcl command will be sent to the OS shell for execution, so you can simply open whatever editor you like as if you were not in the Tcl shell. It basically automatically runs exec for you. Older versions you may have to run exec yourself.
eg
nedit file.vhd
Vivado being a design tool works on projects instead of individual files. So to edit a file, say xyz.vhd, the file needs to be part of a project. This can be done through Tcl console by creating a new project, adding xyz.vhd file to it and then loading the project.
Create a new project using the following command:
project -new
Add files:
add_file -vhd "xyz.vhd"
Save the project and run.
project -save
project -run
You can find further resources at this link.

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.

In monodevelop, how to set the working directory when running your code

does anyone know if it is possible to set the working directory for running the application you create in monodevelop?
The app is written to the bin/Debug directory and that seems to be the working directory when you debug the application. For my application (which I am porting from Windows) it takes an XML configuration file which references other XML files, the paths (in the configuration xml) I use are relative paths (which is sensible imo).
IIRC Visual Studio lets you set the working directory when you are debugging, does monodevelop? I had a good look around the options and tried to search for an answer, but no luck.
thanks
Dave
As far as I'm aware "Run" and "Debug" mode use the same working directory.
Have a look at the following post