• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
JAB12 - Using an IDE for Joomla Development
 

JAB12 - Using an IDE for Joomla Development

on

  • 7,710 views

My presentation on J And Beyond 2012:

My presentation on J And Beyond 2012:
Using an IDE for Joomla Development -
Best practice and Tips using the PHP-IDE phpStorm

Statistics

Views

Total Views
7,710
Views on SlideShare
7,370
Embed Views
340

Actions

Likes
8
Downloads
0
Comments
2

7 Embeds 340

http://jandbeyond.org 312
http://elearning.fatinafar.com 20
http://elearning.tadelformacion.com 3
http://www.slashdocs.com 2
http://us-w1.rockmelt.com 1
https://si0.twimg.com 1
http://www.docshut.com 1
More...

Accessibility

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

JAB12 - Using an IDE for Joomla Development JAB12 - Using an IDE for Joomla Development Presentation Transcript

  • Using an IDE forJoomla DevelopmentBest practice and Tips using the PHP-IDE phpStorm Thomas Kahl J And Beyond 2012, 19th May 2012 - Bad Nauheim, Germany
  • About Me...just in case you don‘t know me✤ Born - yes, but a long, long time ago - in 1966✤ I live in Elmshorn (30 km north of Hamburg)✤ Owner of a Webdevelopment Company since 2004✤ Part of Virtuemart-Team for a long time Known as Virtuemart Expert - visit vm-expert.com✤ Part of all German Joomladays (Organizer & Speaker) and Speaker on international Joomladays and Conferences
  • BTW: JD12DE✤ The next German Joomladay will be in Berlin, 5th & 6th October 2012✤ Interested in Sponsoring?✓ You are welcome!
  • About VMX|Prosome shameless Selfpromotion✤ Developing Extensions for Mambo/Joomla since 2004✤ Specialized in Joomla Ecommerce✤ Offering Virtuemart Extension development and support at www.vm-expert.com✤ We build Websites & Online-Shops Joomla & Virtuemart Extensions Ecommerce Accounting Software for Joomla✤ Wordwide Joomla Ecommerce Consulting
  • About this session✤ Answer the question why it is useful to use an IDE for Joomla development✤ Short overview about good PHP IDE‘s✤ How to set up a project in phpstorm✤ Useful tools within the IDE✤ Combination with external tools✤ Tips, Questions, Examples...
  • Before we start...✤ There is not „THE“ way to work! The things i want to show you are „MY“ way. Maybe there are better ways (I‘m sure there are) - so please tell me if you have other ideas, workflows, tools, ...✤ Though my examples use phpStorm, i am no affiliate, staff-member of Jetbrains (the company behind phpStorm) - I‘m just a happy user...✤ Yes, other than for example Netbeans, phpStorm is not OpenSource (unfortunately). But they offer free licences when you can proove that you are a member of an OpenSource-Team (i did that when i was member of the Virtuemart-Team... it works)
  • Do you still use an Editor?✤ Fast✤ Small✤ Easy to learn (Really?)✤ Available for different platforms
  • Advantages using an IDE✤ Project Management GIT/SVN/CVS Deployment / Synchronization with Server✤ Code Parsing / Framework Support Auto Completion (Methods, Variables, ...) Combination of technologies (PHP, HTML, JS, CSS, ...) Display of Errors✤ Development Tools Debugger (!!!!!) Profiler, Refactoring, Diff-Tool
  • Good IDE‘s✤ Netbeans✤ Eclipse / PHPeclipse✤ Zend Studio Based on Eclipse✤ PHPStorm✤ List of IDE‘s with free licences for OpenSource-Developers: http://www.fromdev.com/2012/05/top-7-open-source- free-php-ide-for.html
  • Learning Curve✤ Yes, getting familiar with an IDE can take some time✤ A wide range of features to discover and learn✤ Features require special settings or project configuration✤ Changes in the workflow
  • Learning Curve
  • Learning Curve
  • Hardware?✤ You will need a large monitor✤ Memory is important✤ An up to date CPU might help
  • How to set up a Joomla Project
  • 3 (or more) different Ways1. just create the extensions- or template directories you need for your project and add the Joomla libraries as external files2. copy the „non-standard“ directories from the live site and add the Joomla libraries as external files3. create the project directory as an exact copy of the live site or as local document-root. This is required, if you want to use the debugger.
  • 1. Extension or Template Directory✤ add Joomla libraries as external files✤ configure deployment server mapping with automatic upload to testserver
  • How to include external files
  • 2. Non-Joomla Directories✤ This is the structure we normally create when we have VM-Expert support projects. We copy the Virtuemart Stuff and all corresponding extensions and templates to our project directory.✤ Then we add the corresponding Joomla libraries as external files to the project.✤ We have full code completion, lookup, classes, ...
  • 3. Full Site✤ Tip: add an additional directory level under your projects tree (i always name it „src“) where you put the site. This way, you can have other project files (phing, profiler, sass, ...) in an additional directory above the site.
  • ToolsWork smarter
  • Debuggerhow could you ever live without it?!?
  • Debugger - the Setup✤ Before you can benefit from the help of the debugger, you have to install and configure all parts: local Server, xDebug, PHP and IDE✤ As far as i can see, this is the hardest part when you configure your workspace :( but it is worth the hard work✤ Other than for example in Visual Studio, the different parts of your development environment are not integrated. You will have to „tell“ each of them how to communicate by configuring hosts, ports, paths and trigger.
  • Debugger - it works!
  • ProfilerWhy is your code slow?
  • Profiler✤ The Profiler logs all calls to classes, functions, ... and the time that was spent.✤ phpStorm offers different views to analyze the logfile✤ a profiler gives great insight of how the code is executed✤ xDebug is used for profiling
  • Profiler✤ The Profiler logs all calls to classes, functions, ... and the time that was spent.✤ phpStorm offers different views to analyze the logfile✤ a profiler gives great insight of how the code is executed✤ xDebug is used for profiling
  • Tip: Helpers in the Browser✤ There are Browser-AddOns available for Firefox and Chrome that make it easy to switch on and off the debugger- and profiler session.✤ It is also possible to start and stop the session with a „bookmarklet“ (small Javascript Code added to a Bookmark). The code for the bookmarklet should look similar to this:✤ xDebug Start Session: javascript:(function() {document.cookie = "XDEBUG_SESSION=PHPSTORM; path=/;";})()✤ xDebug Stop Session: javascript:(function() {document.cookie = "XDEBUG_SESSION=; expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;";}) ()
  • CSS-X-FireThe missing link
  • CSS-X-Fire - a phpStorm Plugin✤ CSS-X-Fire is a plugin for phpStorm and Firefox with Firebug (anyone who doesn‘t know Firebug???)✤ All changes you do in the CSS- Tool of Firebug are „recorded“ in phpStorm and can be applied to the project files.✤ Edit in Firebug, save & upload in phpStorm
  • CodeSnifferStick To Coding Standards
  • CodeSniffer✤ phpStorm supports Codesniffer✤ You can import Joomla Coding Styles✤ phpStorm reminds you of keeping coding standards
  • CodeSniffer
  • BTW: Inspections✤ Inspections in phpstorm are great - but as you can imagine, parsing the code for each rule in the inspections is eating performance.✤ It is a good idea to take the time and go through the Inspections settings to disable all inspections you don‘t need
  • Tips and other things...
  • Working with Scopes✤ The „Scopes“ Feature filters the Project-Tree For example: all our extensions are named vmx* - so we can create a scope to filter the project tree and show only our extensions
  • Working with ToDo‘s✤ You can configure your own „ToDo-Patterns“. It does not need to be real ToDo‘s - you can use it for everything you want to have quick access to. I mark all changes, hacks, bugfixes that are not accepted yet with a special comment. Here you can see the settings and the result:
  • Working with external Tools✤ The „external Tools“ settings allow you to add functionality to the IDE by configuring the calls and the area where they should be available. You can use phpStorm variables (called Macros)
  • Ooops, no Code CompletionSometimes (not very often) itmight happen, that the codecompletion doesn‘t work. Inthis case, you can tellphpStorm the classname touse by adding a comment
  • Important Notes✤ All Images „royalty free“ from stock.xchng www.sxc.hu except: burning Firebug-Bug from getfirebug.com/img/firebug-large.png Netbeans and Zend Screenshots from their Product Pages