SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
Bastian Feder, Papaya Software GmbH
Nils Langner, Gruner + Jahr
Sven Kiera, TWT Interactive GmbH

Advanced Eclipse Workshop

                                      IPC spring edition 2010
                                                  30.06.2010
Who are we?

    Bastian Feder              Nils Langner

    Application developer     Qualitätsmanagement
    PHP since 2001            PHP since 2002
    Open Source addict        Founder
                                 www.phphatesme.com



    Sven Kiera

    Web developer
    PHP and Java since 1998
    Author of PHP Tool
      Integration (PTI)
Who are you?
Installation
Start the engines
Set current language
       System -> Systemverwaltung -> Sprachunterstützung



Open
       Anwendungen -> Zubehör -> Terminal




       #> cd IPC09_Workshop ¶

       #> sudo chown -R ubuntu:ubuntu workspace ¶

       #> ./bin/eclipse/eclipse ¶
Eclipse - Basics
 Workspace
   The workspace is the physical location (file path) you are working in. You can
    choose the workspace during startup of eclipse or via the menu (File-> Switch
    Workspace-> Others).
   All your projects, sources files, images and other artifacts will be stored and saved
    in your workspace.

 Perspective
   A perspective is a visual container for a set of views and editors.

 Views
   Viewport providing specific information and/or functionality

 Working Sets
   Group elements for display in views or for operations on a set of elements.
Your Choice …
 External Tools
 SVN and PDT
 Shortcuts
 Templates
 PTI (PHP Tool Integration)
 Validators
 Xdebug
Eclipse - Shortcuts
Shortcut          Description
CTRL-ALT-Cursor   Copy the current line

CTRL-Left/Right   Jump to previous/next courser position
CTRL-Up/Down      Move marked text
SHIFT-ALT-A       Toggle block edit and normal mode
STRG-SHIFT-T      Open the „Open Type“ box
STRG-SHIFT-C      Comment the marked text using „//“


ALT-ENTER         Maximize Editor
 To edit the shortscuts           Window -> Preferences -> General -> Keys
Templates
Contextual predefined code snippets
Configure at Preferences > PHP > Templates
File Templates

Creating a prefilled file
when using the „new PHP
File“ dialog


Window -> Preferences -> PHP -> Editor ->
Tempalates
Code Templates
Eases typing of complex code structures
  (e.g. foreach statement)

 Activation key: <CTRL> + space
Validators

Validators are plugins that
  can analyse files and set
  markers (e.g. Warnings,
  Errors)

 They can be switched off!
 Validators can be run manual or on build
 Most native PDT validators are syntax
  checkers
 It is possible to add validators
  written in PHP
                                             Window -> Preferences -> Validation
PTI & Dynamic Language Toolkit
 Eclipse Plugins für Eclipse PDT 2.x und Zend Studio 7.x
 Ziel: Direkte Nutzung von PHP Tools in Eclipse PDT
 Aktuelle Unterstützung:
      PHP_CodeSniffer
      PHPDepend
      PHPUnit
      PHP Copy / Paste Detector
 PEAR Verwaltung inkl. aktueller PEAR Bibliothek
 Erweitert Eclipse DLTK External Checker um direkte
  Nutzung von PHP Skripten
 Open Source (EPL)
Creating a Validator
The dynamic language validator will run
a php script and interprets the outfit by
matching against an regular expression




We are going to build the incredible
echo-instead-of-print Validator



                                            Window -> Preferences -> Dynamic
                                            Languages -> Validators -> Add
Subversion                               (client configuration)


 Set        „auto-properties“
       WinXp:                        C:Dokumente & Einstellungen<USER>AnwendungsdatenSubversionconfig




       MacOs / Linux:                                            ~/.subversionconfig



[miscellany]
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .project .cache .settings
enable-auto-props = yes

[auto-props]
*.js = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL
*.css = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL
*.php = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL
*.html = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=LastChangedDate LastChangedRevision URL
*.htm = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=LastChangedDate LastChangedRevision URL
*.xsl = svn:eol-style=LF
*.xml = svn:eol-style=LF
*.xsd = svn:eol-style=LF
Subversive (installation)
•   Eclipse update site
    http://download.eclipse.org/technology/subversive/0.7/update-site/
Subversion      (client configuration)


•   SVN connector
•   SVN properties for new files
•   Customize label decorations
Subversion & Subversive
 Setup
 Common      handling
   Checkout
   Commit / revert changes
 Conflict
         handling
 Extended usage
     Branching, tagging, merging, patching
External Tools
Running external tools
inside Eclipse




                         Run -> External Tools -> External Tools Configuration
Build Script
Running a script that creates the PHPDoc
documentation files


                 <project name="Workshop" basedir="." default="build">
                    <description>
                        simple example build file
                    </description>

                  <target name="documentation">
                    <exec executable="phpdoc">
                      <arg value="-s wp-content/Plugins/PushWP/ -d docs" />
                    </exec>
                  </target>

                  <target name="build" depends="documentation" />
                 </project>
Code Beautifier
The one missing thing in PDT
Debugging
 Debugging   techniques
 Xdebug
 How   to enable Eclipse for debugging
Debugging techniques
Local debugging
Debugging techniques   (II)



•   Remote debugging
Debugging techniques        (III)



•   Multi-User Debugging
     – Only possible using Remote
        Debugging
     – DBGp Proxy necessary
Xdebug
 Debugging for PHP by Derick Rethans
  (http://www.xdebug.org)
 Provides profiling, tracing, code coverage,
  …
 Cross platform
Obtaining Xdebug
 PECL
 Download    from xdebug.org
    Installation support at
     http://xdebug.org/find-binary.php
 Package   system of Linux distribution
Xdebug configuration
Add to php.ini (e.g. on Mac)

 [XDebug]
 ;; Only Zend OR (!) XDebug
 zend_extension="/usr/lib/php/php5/extensions/no-debug-non-zts-20060613/xdebug.so"
 xdebug.remote_enable=true
 xdebug.remote_host=127.0.0.1 ;if debugging on remote server, put client IP here
 xdebug.remote_port=9000
 xdebug.remote_handler=dbgp
 ;; profiler
 xdebug.profiler_enable=Off
 xdebug.profiler_enable_trigger=On
 xdebug.profiler_output_dir=/data_lokal/temp/xdebug/profiling
Xdebug configuration                                                        (II)



.htaccess - file

   #-------------------------------#
   # xDebug section                #
   #-------------------------------#
   php_value xdebug.remote_enable 1
   php_value xdebug.remote_handler bdgp
   php_value xdebug.remote_host 127.0.0.1 ;if debugging on remote server, put client IP here
 ;; php_value xdebug.allowed_clients <client IP address>
   php_value xdebug.remote_port 9000
   # profiler
   php_value xdebug.profiler_enable_trigger 1
   php_value xdebug.profiler_enable 0
   php_value xdebug.profiler_output_dir "/data_lokal/temp/xdebug/profiling"
Xdebug




         Hands on
Preferences – Basic setup
General settings
 Debug   Port
 Multisession

 DBGp    Proxy settings
Preferences – Basic setup
Preferences – PHP servers
                
                 Remote debugging
                
                 Mapping between
                IDE and Xdebug
Configuration for remote
debugging
Configuration for remote
debugging (II)
Configuration for remote
debugging (III)
Start a remote debugging
session
Start a local debugging
Configure „autostart“ options
 Accept    JIT
     Localhost
   Any

   Prompt
Debug CLI scripts
    #> export XDEBUG_CONFIG=“idekey=ECLIPSE_DBGP“↵

    #> php myScript.php ↵

    #> export XDEBUG_CONFIG=““ ↵



Preconditions

   JIT configured

   Breakpoint        set or 'Break at first line' active
Debug     cronjobs, PHPUnit tests, etc.
Debugging made easy!
Firefox Add-on
„Xdebug Helper“
Questions?




             Further questions? Ask us at:

             php@bastian-feder.de

             nils@phphatesme.com

             sven@kiera.de
Contact'n Rate
•    Contact
    – Websites:
           •   http://www.phphatesme.com
           •   http://blog.bastian-feder.de
           •   http://www.phpsrc.org


•    Rate the workshop @
     http://joind.in/talk/view/1749
License
This set of slides and the source code
    included in the download package is
    licensed under the

   Creative Commons Attribution-
   Noncommercial-Share Alike 2.0
   Generic License


   http://creativecommons.org/licenses/by-nc-sa/2.0/deed

Weitere ähnliche Inhalte

Was ist angesagt?

Puppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachPuppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachAlessandro Franceschi
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryBo-Yi Wu
 
Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHPNick Belhomme
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
CMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessCMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessMarcus Hanwell
 
Puppet control-repo 
to the next level
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next levelAlessandro Franceschi
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is DockerNick Belhomme
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package developmentTihomir Opačić
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Clark Everetts
 
Nagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPENagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPENagios
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitJames Fuller
 
BuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopBuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopMandi Walls
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios
 
Essential applications management with Tiny Puppet
Essential applications management with Tiny PuppetEssential applications management with Tiny Puppet
Essential applications management with Tiny PuppetAlessandro Franceschi
 

Was ist angesagt? (19)

Puppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachPuppet modules: An Holistic Approach
Puppet modules: An Holistic Approach
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular Library
 
C make tutorial
C make tutorialC make tutorial
C make tutorial
 
Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHP
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
CMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessCMake: Improving Software Quality and Process
CMake: Improving Software Quality and Process
 
Puppet control-repo 
to the next level
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next level
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is Docker
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package development
 
C++ for the Web
C++ for the WebC++ for the Web
C++ for the Web
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
Nagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPENagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPE
 
Php on Windows
Php on WindowsPhp on Windows
Php on Windows
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
 
BuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopBuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec Workshop
 
PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
 
Essential applications management with Tiny Puppet
Essential applications management with Tiny PuppetEssential applications management with Tiny Puppet
Essential applications management with Tiny Puppet
 

Andere mochten auch (6)

Consultorio universo 5 achecked
Consultorio universo 5 acheckedConsultorio universo 5 achecked
Consultorio universo 5 achecked
 
Forces
ForcesForces
Forces
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Christmas carol
Christmas carolChristmas carol
Christmas carol
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
 

Ähnlich wie Advanced Eclipse Workshop (held at IPC2010 -spring edition-)

Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Bastian Feder
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Itzik Kotler
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsDECK36
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidenceJohn Congdon
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Toolsrjsmelo
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Bastian Feder
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudSalesforce Developers
 
Magento 2 Development
Magento 2 DevelopmentMagento 2 Development
Magento 2 DevelopmentDuke Dao
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsNick Belhomme
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick RethansBachkoutou Toutou
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...D
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshopjulien pauli
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CIMartin de Keijzer
 

Ähnlich wie Advanced Eclipse Workshop (held at IPC2010 -spring edition-) (20)

Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Write php deploy everywhere tek11
Write php deploy everywhere   tek11Write php deploy everywhere   tek11
Write php deploy everywhere tek11
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Tools
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
Magento 2 Development
Magento 2 DevelopmentMagento 2 Development
Magento 2 Development
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CI
 

Mehr von Bastian Feder

JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentalsBastian Feder
 
Why documentation osidays
Why documentation osidaysWhy documentation osidays
Why documentation osidaysBastian Feder
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownpartsBastian Feder
 
PhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsPhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsBastian Feder
 
Introducing TDD to your project
Introducing TDD to your projectIntroducing TDD to your project
Introducing TDD to your projectBastian Feder
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the BeastBastian Feder
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownpartsBastian Feder
 
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010Bastian Feder
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09Bastian Feder
 
Php Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastBastian Feder
 
Bubbles & Trees with jQuery
Bubbles & Trees with jQueryBubbles & Trees with jQuery
Bubbles & Trees with jQueryBastian Feder
 
Ajax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestAjax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestBastian Feder
 

Mehr von Bastian Feder (15)

JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentals
 
Why documentation osidays
Why documentation osidaysWhy documentation osidays
Why documentation osidays
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownparts
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
PhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsPhpUnit - The most unknown Parts
PhpUnit - The most unknown Parts
 
Introducing TDD to your project
Introducing TDD to your projectIntroducing TDD to your project
Introducing TDD to your project
 
jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the Beast
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownparts
 
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09
 
Php Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The Beast
 
Bubbles & Trees with jQuery
Bubbles & Trees with jQueryBubbles & Trees with jQuery
Bubbles & Trees with jQuery
 
Ajax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestAjax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google Suggest
 

Kürzlich hochgeladen

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Kürzlich hochgeladen (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Advanced Eclipse Workshop (held at IPC2010 -spring edition-)

  • 1. Bastian Feder, Papaya Software GmbH Nils Langner, Gruner + Jahr Sven Kiera, TWT Interactive GmbH Advanced Eclipse Workshop IPC spring edition 2010 30.06.2010
  • 2. Who are we? Bastian Feder Nils Langner Application developer Qualitätsmanagement PHP since 2001 PHP since 2002 Open Source addict Founder www.phphatesme.com Sven Kiera Web developer PHP and Java since 1998 Author of PHP Tool Integration (PTI)
  • 5. Start the engines Set current language System -> Systemverwaltung -> Sprachunterstützung Open Anwendungen -> Zubehör -> Terminal #> cd IPC09_Workshop ¶ #> sudo chown -R ubuntu:ubuntu workspace ¶ #> ./bin/eclipse/eclipse ¶
  • 6. Eclipse - Basics  Workspace  The workspace is the physical location (file path) you are working in. You can choose the workspace during startup of eclipse or via the menu (File-> Switch Workspace-> Others).  All your projects, sources files, images and other artifacts will be stored and saved in your workspace.  Perspective  A perspective is a visual container for a set of views and editors.  Views  Viewport providing specific information and/or functionality  Working Sets  Group elements for display in views or for operations on a set of elements.
  • 7. Your Choice …  External Tools  SVN and PDT  Shortcuts  Templates  PTI (PHP Tool Integration)  Validators  Xdebug
  • 8. Eclipse - Shortcuts Shortcut Description CTRL-ALT-Cursor Copy the current line CTRL-Left/Right Jump to previous/next courser position CTRL-Up/Down Move marked text SHIFT-ALT-A Toggle block edit and normal mode STRG-SHIFT-T Open the „Open Type“ box STRG-SHIFT-C Comment the marked text using „//“ ALT-ENTER Maximize Editor To edit the shortscuts Window -> Preferences -> General -> Keys
  • 9. Templates Contextual predefined code snippets Configure at Preferences > PHP > Templates
  • 10. File Templates Creating a prefilled file when using the „new PHP File“ dialog Window -> Preferences -> PHP -> Editor -> Tempalates
  • 11. Code Templates Eases typing of complex code structures (e.g. foreach statement)  Activation key: <CTRL> + space
  • 12.
  • 13. Validators Validators are plugins that can analyse files and set markers (e.g. Warnings, Errors)  They can be switched off!  Validators can be run manual or on build  Most native PDT validators are syntax checkers  It is possible to add validators written in PHP Window -> Preferences -> Validation
  • 14. PTI & Dynamic Language Toolkit  Eclipse Plugins für Eclipse PDT 2.x und Zend Studio 7.x  Ziel: Direkte Nutzung von PHP Tools in Eclipse PDT  Aktuelle Unterstützung:  PHP_CodeSniffer  PHPDepend  PHPUnit  PHP Copy / Paste Detector  PEAR Verwaltung inkl. aktueller PEAR Bibliothek  Erweitert Eclipse DLTK External Checker um direkte Nutzung von PHP Skripten  Open Source (EPL)
  • 15. Creating a Validator The dynamic language validator will run a php script and interprets the outfit by matching against an regular expression We are going to build the incredible echo-instead-of-print Validator Window -> Preferences -> Dynamic Languages -> Validators -> Add
  • 16. Subversion (client configuration)  Set „auto-properties“  WinXp: C:Dokumente & Einstellungen<USER>AnwendungsdatenSubversionconfig  MacOs / Linux: ~/.subversionconfig [miscellany] global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .project .cache .settings enable-auto-props = yes [auto-props] *.js = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL *.css = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL *.php = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL *.html = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=LastChangedDate LastChangedRevision URL *.htm = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=LastChangedDate LastChangedRevision URL *.xsl = svn:eol-style=LF *.xml = svn:eol-style=LF *.xsd = svn:eol-style=LF
  • 17. Subversive (installation) • Eclipse update site http://download.eclipse.org/technology/subversive/0.7/update-site/
  • 18. Subversion (client configuration) • SVN connector • SVN properties for new files • Customize label decorations
  • 19. Subversion & Subversive  Setup  Common handling  Checkout  Commit / revert changes  Conflict handling  Extended usage  Branching, tagging, merging, patching
  • 20. External Tools Running external tools inside Eclipse Run -> External Tools -> External Tools Configuration
  • 21. Build Script Running a script that creates the PHPDoc documentation files <project name="Workshop" basedir="." default="build"> <description> simple example build file </description> <target name="documentation"> <exec executable="phpdoc"> <arg value="-s wp-content/Plugins/PushWP/ -d docs" /> </exec> </target> <target name="build" depends="documentation" /> </project>
  • 22. Code Beautifier The one missing thing in PDT
  • 23. Debugging  Debugging techniques  Xdebug  How to enable Eclipse for debugging
  • 25. Debugging techniques (II) • Remote debugging
  • 26. Debugging techniques (III) • Multi-User Debugging – Only possible using Remote Debugging – DBGp Proxy necessary
  • 27. Xdebug  Debugging for PHP by Derick Rethans (http://www.xdebug.org)  Provides profiling, tracing, code coverage, …  Cross platform
  • 28. Obtaining Xdebug  PECL  Download from xdebug.org  Installation support at http://xdebug.org/find-binary.php  Package system of Linux distribution
  • 29. Xdebug configuration Add to php.ini (e.g. on Mac) [XDebug] ;; Only Zend OR (!) XDebug zend_extension="/usr/lib/php/php5/extensions/no-debug-non-zts-20060613/xdebug.so" xdebug.remote_enable=true xdebug.remote_host=127.0.0.1 ;if debugging on remote server, put client IP here xdebug.remote_port=9000 xdebug.remote_handler=dbgp ;; profiler xdebug.profiler_enable=Off xdebug.profiler_enable_trigger=On xdebug.profiler_output_dir=/data_lokal/temp/xdebug/profiling
  • 30. Xdebug configuration (II) .htaccess - file #-------------------------------# # xDebug section # #-------------------------------# php_value xdebug.remote_enable 1 php_value xdebug.remote_handler bdgp php_value xdebug.remote_host 127.0.0.1 ;if debugging on remote server, put client IP here ;; php_value xdebug.allowed_clients <client IP address> php_value xdebug.remote_port 9000 # profiler php_value xdebug.profiler_enable_trigger 1 php_value xdebug.profiler_enable 0 php_value xdebug.profiler_output_dir "/data_lokal/temp/xdebug/profiling"
  • 31. Xdebug Hands on
  • 33. General settings  Debug Port  Multisession  DBGp Proxy settings
  • 35. Preferences – PHP servers  Remote debugging  Mapping between IDE and Xdebug
  • 39. Start a remote debugging session
  • 40. Start a local debugging
  • 41. Configure „autostart“ options  Accept JIT  Localhost  Any  Prompt
  • 42. Debug CLI scripts #> export XDEBUG_CONFIG=“idekey=ECLIPSE_DBGP“↵ #> php myScript.php ↵ #> export XDEBUG_CONFIG=““ ↵ Preconditions  JIT configured  Breakpoint set or 'Break at first line' active Debug cronjobs, PHPUnit tests, etc.
  • 43. Debugging made easy! Firefox Add-on „Xdebug Helper“
  • 44. Questions? Further questions? Ask us at: php@bastian-feder.de nils@phphatesme.com sven@kiera.de
  • 45. Contact'n Rate • Contact – Websites: • http://www.phphatesme.com • http://blog.bastian-feder.de • http://www.phpsrc.org • Rate the workshop @ http://joind.in/talk/view/1749
  • 46. License This set of slides and the source code included in the download package is licensed under the Creative Commons Attribution- Noncommercial-Share Alike 2.0 Generic License http://creativecommons.org/licenses/by-nc-sa/2.0/deed