User Tools

Site Tools


php:phpstorm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
php:phpstorm [2022/04/21 17:24] Wulf Rajekphp:phpstorm [2025/03/18 14:27] (current) – [Remote Tools and Custom Menu] Wulf Rajek
Line 1: Line 1:
 ====== PhpStorm ====== ====== PhpStorm ======
 +
 +https://www.jetbrains.com/phpstorm/download/other.html
 +<code>
 +wget https://download.jetbrains.com/webide/PhpStorm-2023.3.3.tar.gz
 +tar -xvzf PhpStorm-2023.3.3.tar.gz
 +sudo mv sudo mv PhpStorm-233* /opt/phpstorm
 +/opt/phpstorm/bin/phpstorm
 +</code>
 +
 +Add to menu and cinnamon panel launcher
 +<code>
 +cat > ~/.local/share/applications/phpstorm.desktop << EOD
 +[Desktop Entry]
 +Name=PhpStorm
 +Exec=/opt/phpstorm/bin/phpstorm
 +Comment=
 +Terminal=false
 +Icon=/opt/phpstorm/bin/phpstorm.png
 +Type=Application
 +EOD
 +</code>
 +
  
 https://www.jetbrains.com/resources/eap/ https://www.jetbrains.com/resources/eap/
Line 12: Line 34:
 Useful settings: Useful settings:
   - Settings > Languages & Frameworks > SQL Dialects and set it for the whole project.   - Settings > Languages & Frameworks > SQL Dialects and set it for the whole project.
-  - variables defined in included/required files are marked as undefined. Solved by adding global $x to top of file.+  - Enable Settings > Editor > Inspections > PHP > Undefined symbols > Undefined variable > Search for variable's definition outside the current file for project (alternative: variables defined in included/required files are marked as undefined. Solved by adding global $x to top of file.)
   - set database per project folder or file in settings > Languages & Frameworks > SQL Resolution Scopes   - set database per project folder or file in settings > Languages & Frameworks > SQL Resolution Scopes
 +  - open project selection instead of reopening last project in  File > Settings > System Settings > uncheck "Reopen projects on startup"
 +  - Disable AI, Quodana and Space plugins
 +  
 +
 +Deployment settings:
 +File -> Settings -> Build, Execution, Deployment -> Deployment -> +
 +SFTP
 +Enter server name
 +select ssh configuration for the server
 +set remote and local paths
 +
 +
 +
 +
  
 <code - phpstorm_update.sh> <code - phpstorm_update.sh>
Line 64: Line 100:
 - Settings > Editor > Inspections > PHP > Composer - Settings > Editor > Inspections > PHP > Composer
 - Settings > Editor > Inspections > Proofreading > Typo - Settings > Editor > Inspections > Proofreading > Typo
-- Settings > Languages & Framework > Javascript > "JavaScript language version" to EcmaScript 5.1+- Settings > Languages & Framework > Javascript > "JavaScript language version" to "EcmaScript 5.1
 +- Settings > Appearance & Behaviour > System Settings > Updates > "Check IDE updates for" to "Stable Releases" 
 +- Settings > Editor > Inspections > PHP > Undefined symbols > "Undefined variable" set "Search for variable's definition outside the current file" 
 +- Code style -> php -> wrapping and braces -> braces placement -> in function declaration: end of line 
 + 
 +To remove error message "Failed to push to [apps-repo] remote: bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)" on failed mercurial pushes, generate the en_US.UTF-8 locale on the systems:  
 +<code> 
 +sudo sed -i 's/# en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen 
 +sudo locale-gen en_US.UTF-8 
 +</code> 
 + 
 + 
 +Error: Unable to save settings: Failed to save settings. Please restart PhpStorm. 
 +Solution: Could you please check that the radio button Settings | PHP | Composer | Execution actually has a value specified? And if it doesn't, please choose one and then check how it goes. 
 + 
 + 
 +Deployment 
 +https://www.jetbrains.com/help/phpstorm/tutorial-deployment-in-product.html#config 
 + 
 + 
 +====== Remote Tools and Custom Menu ====== 
 + 
 +Example custom main menu with remote tools and icons, store in ''~/.local/share/icons/''
 + 
 +{{php:changelog-white.png?50}} {{php:sync-white.png?50}}\\  
 +{{php:sync-black.png?50}}{{php:changelog-black.png?50}} 
 + 
 +<code - ~/.config/PhpStorm2024.2/remoteTools/Remote Tools.xml> 
 +<toolSet name="Remote Tools"> 
 +  <tool name="Show changeset of remote system" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="false" CONNECTION_TYPE="SSH_CONFIG" CONNECTION_ID="root@remotesystem:22 agent"> 
 +    <exec> 
 +      <option name="COMMAND" value="/root/hgchangeset.sh" /> 
 +      <option name="PARAMETERS" /> 
 +      <option name="WORKING_DIRECTORY" value="/var/www/htdocs/" /> 
 +    </exec> 
 +  </tool> 
 +  <tool name="sync remote system to remote system" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true" CONNECTION_TYPE="SSH_CONFIG" CONNECTION_ID="root@remotesystem:22 agent"> 
 +    <exec> 
 +      <option name="COMMAND" value="/root/_rsyncwrapper.sh" /> 
 +      <option name="PARAMETERS" /> 
 +      <option name="WORKING_DIRECTORY" value="/root" /> 
 +    </exec> 
 +  </tool> 
 +</toolSet> 
 +</code> 
 + 
 +<code - ~/.config/PhpStorm2024.2/options/customization.xml> 
 +<application> 
 +  <component name="com.intellij.ide.ui.customization.CustomActionsSchema"> 
 +    <group value="Vcs.Operations.Popup" is_group="true" forse_popup="false" action_type="-1" position="23"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="Vcs.Log.Toolbar.RightCorner" is_group="true" forse_popup="false" action_type="-1" position="22"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="Vcs.Log.ChangesBrowser.Toolbar" is_group="true" forse_popup="false" action_type="-1" position="21"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="ChangesViewToolbar" is_group="true" forse_popup="false" action_type="-1" position="20"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="StringManipulation.Group.SwitchCase" is_group="true" forse_popup="false" action_type="-1" position="19"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="StringManipulation.Group.Main" is_group="true" forse_popup="false" action_type="-1" position="18"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="RunTab.TopToolbar" is_group="true" forse_popup="false" action_type="-1" position="17"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="RunTab.TopToolbar.More" is_group="true" forse_popup="false" action_type="-1" position="16"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="Markdown.Toolbar.Floating" is_group="true" forse_popup="false" action_type="-1" position="15"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="Console.TableResult.FloatingToolbarGroup" is_group="true" forse_popup="false" action_type="-1" position="14"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="Floating.CodeToolbar" is_group="true" forse_popup="false" action_type="-1" position="13"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="Vcs.FileHistory.Toolbar" is_group="true" forse_popup="false" action_type="-1" position="12"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="XDebugger.Watches.Tree.Toolbar" is_group="true" forse_popup="false" action_type="-1" position="11"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="XDebugger.ToolWindow.TopToolbar3" is_group="true" forse_popup="false" action_type="-1" position="10"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="XDebugger.ToolWindow.TopToolbar3.Extra" is_group="true" forse_popup="false" action_type="-1" position="9"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="NavBarToolBar" is_group="true" forse_popup="false" action_type="-1" position="8"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="NavbarPopupMenu" is_group="true" forse_popup="false" action_type="-1" position="7"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="ScopeViewPopupMenu" is_group="true" forse_popup="false" action_type="-1" position="6"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="ProjectViewPopupMenu" is_group="true" forse_popup="false" action_type="-1" position="5"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="EditorTabPopupMenu" is_group="true" forse_popup="false" action_type="-1" position="4"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="EditorGutterPopupMenu" is_group="true" forse_popup="false" action_type="-1" position="3"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="EditorPopupMenu" is_group="true" forse_popup="false" action_type="-1" position="2"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="NewUiRunWidget" is_action="true" action_type="-1" position="2"> 
 +      <path value="root" /> 
 +      <path value="Main Toolbar" /> 
 +      <path value="Right" /> 
 +    </group> 
 +    <group value="PhpListenDebugAction" is_action="true" action_type="-1" position="1"> 
 +      <path value="root" /> 
 +      <path value="Main Toolbar" /> 
 +      <path value="Right" /> 
 +    </group> 
 +    <group value="MainMenu" is_group="true" forse_popup="false" action_type="-1" position="0"> 
 +      <path value="root" /> 
 +    </group> 
 +    <group value="Vcs.UpdateProject" is_action="true" action_type="1" position="2"> 
 +      <path value="root" /> 
 +      <path value="Main Toolbar" /> 
 +      <path value="Left" /> 
 +      <path value="VCS Group" /> 
 +    </group> 
 +    <group value="Vcs.Push" is_action="true" action_type="1" position="3"> 
 +      <path value="root" /> 
 +      <path value="Main Toolbar" /> 
 +      <path value="Left" /> 
 +      <path value="VCS Group" /> 
 +    </group> 
 +    <group value="RemoteTool_Remote Tools_Show changeset of remote system" is_action="true" action_type="1" position="5"> 
 +      <path value="root" /> 
 +      <path value="Main Toolbar" /> 
 +      <path value="Left" /> 
 +    </group> 
 +    <group value="RemoteTool_Remote Tools_sync remote system to remote system" is_action="true" action_type="1" position="6"> 
 +      <path value="root" /> 
 +      <path value="Main Toolbar" /> 
 +      <path value="Left" /> 
 +    </group> 
 +    <action id="RemoteTool_Remote Tools_Show changeset of remote system" icon="/home/user/.local/share/icons/changelog-white.png" /> 
 +    <action id="RemoteTool_Remote Tools_sync remote system to remote system" icon="/home/user/.local/share/icons/sync-white.png" /> 
 +  </component> 
 +</application> 
 + 
 +</code>
  
php/phpstorm.1650558244.txt.gz · Last modified: 2023/05/29 11:53 (external edit)