Symfony 3 on MAMP with Mercurial VCS and Eclipse IDE - part 2

Part 1 http://blog.jaumesola.com/symfony-3-on-mamp-with-mercurial-vcs-and-eclipse-ide-part-1

As it already "does something" we will continue with the demo app.

Mercurial

  • Next step: mercurial repository. Initialize:
cd /Users/MyUser/Workspace/symfony_demo_01
hg init
  • set at least user name parameter for Mercurial
vi .hg/hgrc

[ui]
username = myself
  • Define files to be ignored -- Mercurial similar format than git, just remove trailing slash "/" on every line
cp .gitignore .hgignore
vi .hgignore
  • initialize repository
hg addremove
hg commit

Eclipse & debugger

Create Project

  • File - Import... - Mercurial - Projects from local Mercurial repository

You may now commit the newly created .project file

XDebug

MAMP already comes with xdebug but it has to be enabled:
  • activate it in the currently used MAMP php-ini file: uncomment the loading of the extension and enable remote debugging
vi /Applications/MAMP/bin/php/php5.6.7/conf/php.ini

[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.6.7/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"
xdebug.remote_enable = On
  • Now you can create a debug configuration in Eclipse. In my case it worked with the following settings
    • server - Base URL: http://symfony_demo_01.loc:8888
    • server - Path Mapping: / -> /Users/MyUser/Workspace/symfony_demo_01
    • file: app.php

YAML files

The default installation uses YAML files for configuration options. There's an Eclipse YAML editor called Yedit, but I couldn't make it work so I just associated the .yml extension to the default text editor.