php development with eclipde pdt
DESCRIPTION
Hands on the Eclipse PDT, how integrate xDebug, phpDocumntor int Eclipse PDTTRANSCRIPT
![Page 1: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/1.jpg)
PHP developmentwith Eclipse PDT
Bastian Federpapaya Software GmbH
IPC 200829.10.2008
![Page 2: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/2.jpg)
Me, myself & I
Application developer
PHP since 2001 @papaya since
01.2008
![Page 3: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/3.jpg)
Agenda
Installation Configuration Views & Perspectives Projects Templates Code competetion External Tools Framework xDebug integration Plugins
![Page 4: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/4.jpg)
Installation
Download latest revision from Eclipse website(http://www.eclipse.org/pdt/downloads)
▹ All in one (recommended): provides everything you need to run PDT.
▹ PDT Feature / Update Manager: extends an existing Eclipse, but all dependencies PDT relies on needs to be installed first.
Extract archive Copy to favorized location
(e.g. /usr/local/bin/ or another location in your application path)
![Page 5: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/5.jpg)
Configuration
Heap space (memory allocated by JVM)size depends on system memory capacity
▹ Xms, Xmx
▹ XXMaxPermSize, XXPermSize
Eclipse PDT settings▹ disable code folding▹ formatting / linebreaks▹ validation / build settings▹ disable automatic updates
![Page 6: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/6.jpg)
Views & Perspectives
Views or Tabs(Window > Show View)
▹ Viewport providing specific information and/or functionality
Perspective(Window > Open Perspektive)
▹ Arrangement of Views:PHP Perspektive contains e.g. 'PHP Explorer', 'Outline' and 'Project Outline'
![Page 7: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/7.jpg)
Views & Perspectives (II)
![Page 8: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/8.jpg)
Projects
Organizational untis Customizeable
configuration PHP include path
▹ Validation▹ Build rules▹ ...
![Page 9: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/9.jpg)
Templates
Contextual predefined code snippets
Configure at Preferences > PHP > Templates
![Page 10: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/10.jpg)
Code templates
Activation key:<CTRL> + space
Code templates▹ Eases typing of complex code structures (e.g.
switch – statement)▹ Minimize errors▹ Act like a form
switch ($action) { case 'read': ; break;
default: ; break; }
![Page 11: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/11.jpg)
Code templates (II)
Capable of code completion Set cursor positioning (${cursor}) Dynamic content by use of variables
▹ ${class}, ${class_container}▹ ${function}, ${function_container}▹ ${variable}▹ ${value}
switch (${dollar}${variable}) { case ${value}: ${cursor}; break;
default: ; break; }
![Page 12: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/12.jpg)
File templates
File templates▹ Create new files with
standardized structures
▹ Easy to create or adapt
![Page 13: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/13.jpg)
Code completion (Code Assist)
Configuration via Preferences > PHP > Editor > Code Assist
![Page 14: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/14.jpg)
Code completion (II)(Code Assist)
Activation key<CTRL> + space
Completes▹ PHP functions▹ Classes & functions▹ Constants▹ Code templates
Evolves with every plugin supporting this feature (e.g. JSEclipse)
![Page 15: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/15.jpg)
Code completion (III)(Code Assist)
![Page 16: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/16.jpg)
Code completion (IV)(Code Assist)
Documentation hint▹ declaring the name of a class to be instantiated as
the type of the 'local' class var will enable Eclipse to resolve the methods of the instantiated class:
class docuDb {
private function connect() { return mysql_connect_db(); } }
class docuHint { /** * @var docuDb Database handling */ private $dbHandler = NULL;
private function connectToDB() { $this->dbHandler = &new docuDb(); $dbh = $this->dbHandler->connect(); } }
![Page 17: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/17.jpg)
External Tools Framework
Enables Eclipse to run ,stand-alone' applications
Two broad classes of external tools are available:▹ Ant build files▹ Everything else
![Page 18: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/18.jpg)
External Tools Framework (II)
![Page 19: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/19.jpg)
External Tools Framework (III)
LoactionLinux / Mac OsX: points to the phpDocumentor installation
Windows: points to the PHP executable
Working directorydirectory to store temporary data
ArgumentsLinux/ Mac OsX: command line parameters to be passed to phpDocumentor.
Windows: path to the phpDocumentor installation and command line parameters(e.g.: "D:\xampp\php\phpdoc" -c "${project_loc}/doc/tech/config/phpdoc.ini")
![Page 20: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/20.jpg)
External Tools Framework (III)
Display in favorits menu
Standard input & output
![Page 21: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/21.jpg)
xDebug
Debugging for PHP by Derick Rethans(http://www.xdebug.org)
Provides profiling, tracing, code coverage, … Cross platform
![Page 22: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/22.jpg)
xDebug configuration
Add to php.ini (e.g. on Mac)
or .htaccess - file
[XDebug] ;; Only Zend OR (!) XDebug zend_extension="/Applications/xampp/xamppfiles/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 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"
![Page 23: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/23.jpg)
xDebug (III)
Debug dialog
![Page 24: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/24.jpg)
xDebug (IV)
Configure PDT to talk to xDebug
![Page 25: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/25.jpg)
xDebug (IV)
Configure the 'Server' handling the debugging session
![Page 26: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/26.jpg)
Plugins
Subclipsemanaging SVN repositories from inside Eclipse
JSEclipseProvides additional features supporting JavaScript
Data Tools Platformmanaging databases from inside Eclipse
![Page 27: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/27.jpg)
Subclipse (installation)
Eclipsse update site:http://subclipse.tigris.org/update
![Page 28: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/28.jpg)
Subclipse (configuration)
Set „auto-properties“ ▹ WinXp:
C:\Dokumente und Einstellungen\<USER>\Anwendungsdaten\Subversion\config
▹ MacOs / Linux: ~/.subversion/config
[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
![Page 29: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/29.jpg)
Subclipse (conflict handling)
Integrated (diff-) editor to resolve conflicts Support for merging changes which do not
conflict Preview on the checkout to find conflicts
before updating the sources
![Page 30: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/30.jpg)
Questions?
![Page 31: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/31.jpg)
References
Eclipse PDT(http://www.eclipse.org/pdt)
Eclipse plugins▹ Subclipse (http://subclipse.tigris.org)
▹ JSEclipse (http://www.interaktonline.com/products/eclipse/jseclipse/overview)
xDebug(http://www.xdebug.org)
PhpDocumentor @ pear.php.net(http://pear.php.net/package/PhpDocumentor/docs/1.4.2)
SVN keyword substitution(http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.advanced.props.special.keywords)
![Page 32: Php Development With Eclipde PDT](https://reader033.vdocument.in/reader033/viewer/2022052410/554a089ab4c905557a8b57d6/html5/thumbnails/32.jpg)
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.en