PHP Storm: how to remove project without deleting files - phpstorm

I accidentally made the entire PHPstormProjects folder, which contains all of my projects, and turned it into a project. When I realized my mistake, I deleted all the files which I had uploaded into the project, but it still lists it as a PHPStorm Project.
I don't want to simply delete the project, as it contains all of my other projects. Is there any way to 'unset' a PHP project?

On "Welcome" screen (when all projects are closed) just select unwanted project and press Del key.
To make sure that IDE will not treat this folder as a Project -- just delete project settings (.idea subfolder) when that project is closed.

Related

PhpStorm set all files / folders to brown background and weird structure

So I just noticed that my PhpStorm has set a background color to my project and also the structure is weird. All best explained by some screenshots.
This is how it is looking now, I cannot even see my App folder etc here:
After I click on Project in the top and then select Project Files, I can see my structure again like normal:
My question is, what does this mean and how can I set it "back to normal"? As for me, "normal" means the following:
I can see all my files in Project and also there is no brown background color.
What I have done so far, as suggested from Google searches, is:
Close the project, remove it from recent projects and opening it again in PhpStorm.
Removing the .idea folder and opening my project again.
Reload All From Disk.
Invalidate Caches.
P.S. This is a new Laravel project, with only some minor changes and all files added to git, and also just did one last commit. Nothing "fixes" this.
This "yellowish" background means that the IDE treats those files/folders as excluded or not part of the project (i.e. outside of the project). This can be caused by some broken/out-of-sync project config file (for whatever reason, e.g. when making a project and there is incomplete .idea folder already / merge conflict etc).
Deleting .idea subfolder while IDE is closed and then reopening the project is enough to fix it (use "Open" and point to the project root folder and PhpStorm will make a new project from existing files).
Related forum thread/tickets:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/4404912351506/comments/4404921897746
https://youtrack.jetbrains.com/issue/IDEA-271728
https://youtrack.jetbrains.com/issue/IDEA-296960

PhpStorm: multiple projects with common core

Due to security reasons, I have to split one project to divisions (client, admin, ...), and deploy them to different web servers. These divisions have one common script base, but each division has its own functions. As an IDE I use PhpStorm.
The question: what is the best way to organize project's structure and settings, so the common core part will be visible for IDE indexing in all project's divisions, but at the same time, being maintained from a single project (perhaps, standalone)?
In Java you can do lib jar files for further linking in various projects.
But how it can be done in PHP?
There are multiple ways of how to reference extra PHP code in a project.
If you plan to actively edit such extra code in the same project (and want to see their TODOs, code inspection warnings, include references in code refactoring etc):
You can just add it as an additional Content Root: Settings/Preferences | Directories. Folder added this way will be treated as a part of the project itself and will be shown as a separate node in the Project View panel (just as the main code, which is a Content Root as well).
Or you can open 2nd project while 1st one is already opened and when asked, just chose "Attach":
It's not going to be full 2 projects in one frame, more like something in between attaching Content Root and having 2 projects opened in separate frames.
https://www.jetbrains.com/help/phpstorm/opening-multiple-projects.html
Simple symlink will also do the job (but you need to place it somewhere in a project, e.g. PROJECT_ROOT/libs/my_symlinked_code). You then will need to provide a path mapping for that folder for debugger (if you will debug it of course) as PHP/Xdebug works with "final/resolved path" while IDE works with the path as is.
If you do not need to actively edit that extra code in the same window (and ignore any TODOs, code inspection warnings and other inspection results etc):
Do it as a composer package then? Composer can use custom sources (e.g. GitHub repo or a folder on a local filesystem).
Just add the path to that folder as a "Include Path" at Settings/Preferences | Languages & Frameworks | PHP --> Include Path tab. Code referenced this way is meant for 3rd party libraries (the code that you just use but not edit, e.g. framework code, your send mail/ORM library etc). Composer packages will also be included here by default.
https://www.jetbrains.com/help/phpstorm/php.html#include-path-tab

How can I configure sublime to always open to the same folder?

I have a folder that I want Sublime to always open to ...
my_folder
Is there somewhere I can set this so that when ever I click on the Sublime Icon it opens to this folder?
For some reason if I manually quit sublime text through the menu it will open my last folder on re-opening.
However, if I just click the close X button, it will not ... it will open a blank window.
Is there somewhere I can set this correctly in the JSON file?
Well not sure if you are aware of it, but ST has a quick switch project (usually ctrl+alt+p) that will show you your recently opened projects.
Of course it has its own drawbacks:
Unable to remove one instance from it without removing all (clear recent projects cache)Can’t open the project in a new window… instead it only replaces the current project
But AFAIK this would be the most optimal way to work with multiple projects. you just need to go to the folder of the desired project and open it once and it will be available as recent project in the future…
The point of having to choose where to save the project file, IMO is because you may want to share the same file with other people or just have them wherever you want… maybe having all in one place is good for you (it is for me as well) but other people might like to have it in separate folders. 
I usually work with the project replace window… or just go in “Project -> Open recent -> …” which opens a new ST window for me!
Hope this helps you

PhpStorm, recent projects only show folder names instead of project name

Some time ago PhpStorm started to only show the foldernames of my projects instead of the project name. This is very annoying since all my projects follow the same folder structure:
C:\webserver\ [Client] \ [Project] \ htdocs
See this screenshot:
I tried:
Renaming the Project inside PhpStorm
Editing the .iml and .name Files inside the .idea folder
Both did not solve my problem.
I am using PhpStorm 2016.2 EAP. Project name does show up correctly in the title bar of PhpStorm itself.
It is a regression in 2016.2 version that quite few people have faced.
https://youtrack.jetbrains.com/issue/IDEA-156993 -- watch this ticket (star/vote/comment) to get notified on any progress.
UPDATE: (21-July-2016)
This issue is resolved in 2016.2.1 (EAP build 162.1447.5 from 20/07/2016).
Is there any reason why you cannot create a project 1 folder up (which would usually be named after actual project name/domain name)? This would solve your problem (at least in your case).

How do you collaborate on Flash Builder projects?

Flash builder project files can't be opened on another computer even if the files were copied, for e.g. through version control like git or svn.
Importing and Exporting fxp projects is not possible as we do not want to overwrite files for git or svn unnecessarily.
How do people collaborate on Flash Builder projects without creating new project in Flash Builder and having to set up all the settings for the project again and again for multiple collaborators?
If you import the project using its folder location as per #Sean Fujiwara answer then:
One useful way to collaborate in Flash Builder projects is to utilise environment variables. You can access these using - Window > Preferences > General > Workspace > Linked Resources:
From here you can add a new variable or edit an existing one, from the example above you can see that we use a FRAMEWORK_SOURCE variable which points to the source for our shared framework code, we use a swc but this is handy for debugging errors.
We also have another variable called OUTPUT_FOLDER which in our case points to a folder where we run our project over localhost see example below, to use this in a project, you go to right click project name > Properties > ActionScript Build Path, here you enter the folder name you want creating inside the folder that OUTPUT_FOLDER points to:
When you do a Project > Clean from the menu, all resources from your html-template folder will be copied across to this folder and it should open in a browser.
Now we have been able to check in to SVN our .project and .actionScriptProperities files with few issues. When someone new to the project checks them out, they will get an Error in the Problems panel telling them they don't have for example - OUTPUT_FOLDER\MyProjectName, therefore the project leader should have a document listing all the required variables to be setup in your environment.
Other things you can share are paths to raw font files etc.
The only problem I've had with this approach is sometimes it asks for the path to the SDK if it is different from your location, not had chance to figure this one out yet.
Flash builder project files can't be opened on another computer even
if the files were copied, for e.g. through version control like git or
svn.
Flash builder projects can be imported into the workspace just like other Eclipse projects.
Once you copy them to another computer:
Right click in package explorer and go to Import....
Select General/Existing Projects into Workspace.
Select the folder containing the .project directory.
If you make sure Copy projects into workspaces is deselected, you can commit the files directly from wherever you checked the code out.
This is now solved in Flash Builder 4.7 where you can actually import the project folder as is.