Phpstorm

De Banane Atomic
Révision datée du 7 avril 2018 à 23:06 par Nicolas (discussion | contributions) (→‎Erreurs)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à la navigationAller à la recherche

Settings

File → Settings

Font Editor → Font
Themes Appearence & Behaviour → Appearence → UI Options → Theme

Commandes

Formatter le code Code → Reformat Code Ctrl + Alt + L

Log

~/.PhpStorm2017.3/system/log

Laravel Development using PhpStorm

  1. Installer le plugin Laravel: File → Settings → Plugins → Browse Repositories → Laravel Plugin
  2. Configurer le plugin Laravel: File → Settings → Languages & Framework → PHP → Laravel

Creating a Local Server Configuration

  1. Tools → Deployment → Configuration
  2. +
  3. Type: In place
  4. Web server root url: http://mylocalhost
  5. Mapping
    1. Local path: /usr/share/nginx/myproject
    2. Web path: /

Debug

xdebug

Bash.svg
# installer xdebug
pacman -S xdebug
/etc/php/conf.d/xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

; every time you reload the page xDebug tries to debug the script
; remplace l'extension Xdebug Helper for Firefox
xdebug.remote_autostart=on

Xdebug Helper for Firefox

Cliquer sur le petit insecte à droite de la barre d'adresse pour le passer au vert.

Start Listening for PHP Debug Connections

PhpStorm → Run → Start Listening for PHP Debug Connections

Validating Your Debugging Configuration

Run → Web Server Debug Validation

Le dossier racine doit être accessible en écriture pour l'utilisateur courant. _intellij_phpdebug_validator.php

Run/Debug Configuration

  1. Run → Edit Configurations
  2. + → PHP Web Page
  3. Server → ... → Use path mapping

Zero-configuration Web Application Debugging with Xdebug and PhpStorm

Doesn't hit breakpoints except those in index.php

Utiliser xdebug_break(); au lieu des breakpoints fonctionne.

Debug avec WAMP

PHP Settings

  1. File → Settings → Languages & Frameworks → PHP → CLI Interpreter → ...
  2. +
  3. PHP executable: C:\wamp64\bin\php\php7.1.9\php.exe

Git

  • File → Settings → Version Control
  • View → Tool Windows → Version Control

Erreurs

Inotify Watches Limit

Bash.svg
sysctl fs.inotify.max_user_watches=524288
/usr/lib/sysctl.d/50-default.conf
# increase watch limit from 8192
fs.inotify.max_user_watches = 524288