 Can you hear me well? Great So I think we should start and Let's just ensure that you're in the right room. I'm going to talk about using Integrated development environments with PHP and Drupal in particular first of all Couple of words about me. My name is Valerio Luye. I'm I'm working for a company named Trello We develop Distribution named Able Organizer which is built for building online campaigns like events donations and stuff like that If you will have troubles reading from screen, there is a short URL For slide share so that you can open the presentation there and read all the links and text there Feel free If you want to find me online in Practically every place like Facebook, Skype, Gmail Drupal Org, IRC, that will be Valdebal. That's my nickname. Sorry That's a that's a long story. I can tell you later Talking about IRC I appear there Approximately once or twice a week when we have core contribution hours and If you don't know what it is and if you will be here on Friday, I really advise you to visit Friday Springs There is community booth in the booth space You should go there and you should go And visit Friday Springs. It's really fun. First, let's talk about what the session is not about The session will not give you exact answer. What is the correct environment for you? What tool you want to go into to use and there's definitely no One size fits all. I think all Ideas that I'm going to review today are really good and they have a really long history of development. They are major tools It really depends on you what Properties of Development environment is important for you prior to making this session. I have created a small Popularity contests among Drupal developers and these are result and I think that Today my task to review most popular Development environments for PHP and Drupal is much easier than it can be like five years ago because Some tools are disappearing from the market and other tools are Joining forces and really we don't have that much options to choose then we have then we had Five years ago for example We can't actually Count up Tana as a separate player and PHP ID market is joining forces with PDT and PDT itself Also disappears from market and it's now maintained by Zen's corporation So that there is no separate link to download PDT from eclipse.org which is based on Instead you're guided to download PDT from Zen.com site, but as you see The most popular tool is PHP storm There are reasons to choose PHP storm obviously And I will talk about that a little bit later But other options that are popular in that contest which are net beans and ZN studio are popular also and as you may notice there is Relatively big bar, which is called not using ID and another relatively big bar called other and This not using ID is mainly Sublime to editor which was an interesting result for me, but This is the result of the of this contest I Can understand that because sublime to is Something in between plain text editor and fully blown IDE But I think that it lacks several properties that define Integrated development environment as itself Because the main word in IDE which is integrated development environment is the word integrated. We have much more than Text editor even if it is very good text editor. The second question in my contest was if people are using debuggers and Result was pretty much. Yes. Most people are using X debug some people were using Zen debugger and That is really interesting result because there are less people Using Zen debugger than people using Zen studio It doesn't make sense to me because I think that Zend Debugger is the reason to choose Zen studio, but we will talk about that a little bit later. So What tools I'm going to talk about the most popular choice of PHP ID is PHP storm last version 7 there is early release of 8 Which is coincidentally will support Drupal 8 Then I will talk about Zen studio last version 10 and Netbeams last version 8 we will start from Free one to price error options So the cheapest options in netbeams, which is maintained by Oracle Corporation written in Java is free. You can find the download link This tool is available for all major operating system Windows Linux Mac OS and It has kind of very unique support for Drupal And this support is different from other tools There is project called and DDT which stands for netbeams Drupal developer tools and It allows you to create a skeleton for you for your new models Like you launch that tool you say which Hooks you're going to implement and that will create all necessary functions with all necessary parameters Which is kind of cool saves you a lot of time This project is not hosted on Drupal.org, but on github Next tool is PHP storm It is maintained by JetBrains Also written in Java There are different pricing options including free ones if you're an active member of community and contributing a lot they have community support program and You can apply for it Regular license begins from 99 dollar for a year or two. I don't remember Probably it's 99 dollars a year It also works on all major platforms PHP storms approach to work with Drupal is having built-in Drupal plugin. I Will show you how it works But it was designed by JetBrains themselves. It's not the third party plug-in It comes when you download PHP storm from their site Then studio is maintained by Zen Corporation also written in Java pricing options approximately twice more than of PHP storm I will say put here a wrong version for download, but you can find it on Zen store Zen.com This tool also works on all major platforms, but as far as I know it has problems with recent Linux flavors, which are based on Diabene talking basically it's Ubuntu slash Diabene slash whatever the problem is in incompatibility of Chrome libraries So if you're running Ubuntu or Debian, maybe you will have bad luck or a run in Zen studio There is no Drupal plugin for Zen studio as far as I know Community support for for that product and maintains a project that is called coding for mothers that means that Zen studio can define pretty detailed Rules for how your output PHP code will look like what will we use for in dense do place Square or figure brackets on their own lines, or it should be placed on Exit with existing code Things like that if you have read Drupal coding standards, which include also formatting of output code It is detailed. They're also pretty well So the aim of this Project is to define a format which is stored on an XML as an XML file which will be 100% compatible with Drupal coding standards and Since this project is running for several years It's really pretty pretty well Fits Drupal coding standards so the first question that We will ask why at all we should use Something integrated when you have good options like edit plus or Sublime to and they all support Syntax highlighting and things like that The main reason for that is that you want to be more effective and I used to hear From old-fashioned developers that ID is for losers or for junior developers and real people are writing code in the eye or Notepad or something similar This is Not true For very simple reason or for set of simple reasons first of all not of all not of us are Superstars, let's face that. I'm not superstar and Still I need to work with other people and need to produce my code in a timely fashion So I need something that will maybe not that cool As a VI editor, but we'll do something that I need So it's all about working more effectively like when I write code I need to see if Result is what I intended to write So I need to see if it's syntax highlighting This feature of course works in sublime to and several other text editors What most text editors lack is a highlighting of syntax errors Warnings about syntax what could possibly what can possibly go wrong hints about using or unused variables I also don't know if there are a lot of text editors of if there are any at all that have code completion based on Documented PHP code as you know all PHP functions in Drupal code has to contain PHP doc Description and that will help integrated tools to on the fly generate Hints on how to use specific functions what types of parameters and What can be a return value? Coding style is very important if you used in a teams especially any big teams when Where each team member has its own? Coding style it can be a real mess to understand what happens there because part of the code is intended one way The rest of file is indebted the other way, and it's really hard to understand where is the end of one block and start of the other block As I mentioned all three Ideas have support for Drupal coding style So you don't have an excuse if you are not writing code according to a Drupal style if you if you're using IDE There is a very important feature which is present in paid IDs Namely in PHP storm and Zend and I need to tell that When I'm talking about Zend, I'm actually talking about two products. This is Zend Studio and PDT These products are pretty similar one to another they are based on the same code base But there are certain features that are present in a paid version Zend Studio and I wrap something in a PDT Which is a free version For example, if you're talking about refactoring This is a feature which is present only in Zend Studio Very important feature of IDE is project navigation If you if you if you have seen code base of Drupal 8 you could understand how many files This project contains and it can be really hard where really hard to find Where the function that you are going to call is defined? and What are that its parameters? debugging It is last in the list, but of course it's the it's the very important It's the most important feature of IDs I'm writing it here in the last place because it's actually supported not only by IDs, but also By certain text editors to these days when you're working on a Drupal project It is common when you work not alone, but in any team So it is very important that the tool that you use supports version control system such as git or CVS or Mercurial or whatever We don't produce pure PHP code We have to work with other technologies like HTML and JavaScript and CSS you You have also to Execute commands if you're working with drush if you're not working with drush you should start to work with working with it It's really useful tool You even can use integrated browser and never leave ID So you can run drush commands in integrated shell and see the output result and integrated browser When you work with others you need to Know what is needed to accomplish before publishing release or before go in beta or alpha or Whatever so all tools allow you to maintain to do lists by Writing commands especially a specially formatted commands And I have to mention debugging because debugging is also about working with other people and Know how your changes may affect other people or is a work and how work of other people can affect yours So let's talk about debug When we talk about debug it can be Split into local debug which runs on your local machine and remote but debug when I work in one with a code base Which is physically located on another machine Local debug if you are talking about ID runs in internal browser It requires local web server. It requires PHP extension and basically that's it Local debug setup is pretty easy and requires only these three steps If you're talking about Zen Studio it has a built-in web server with built-in Zen Zen debugger, so If you have Zen Studio installed you have working web server with debugging enabled Which is pretty easy. You can start working on debugging your code within five minutes from installing Zen Studio Remote debug as you may guess is a little bit more complex But it's also more flexible You can use any browser not only built-in browser of your IDE You can work Simultaneously with other people like you can debug the same code or different code And your caller can debug other code You can you you can debug PHP even if you don't have local web server installed You still have to install PHP extension on remote web server, but the most complex and tricky part here is establishing connection to remote server Everything is fine if that's your development server and you can access it through the local network and there are no firewall issue but if you're talking about Running some code on remote web server this sounds pretty dangerous and you don't want to allow that to run from any computer so you need to set up Connection between your computer with IDE and remote computer which runs web server and by default if you're talking about X debug which is the most common debugger used in PHP project it uses non-standard port which is 9,000 and If you go to your system admin and ask him to open port 9,000 for Every computer in the internet to your computer You probably will hear no So If you get the snow, but you still have to run a code on remote computer and sometimes you don't have other options because For example, we were in when there were Drupal developer days in second There was a sprint on Drupal.org improvements and you can't actually clone Drupal.org on your computer and work locally because it's huge and Not only it's huge. It also has very specific PHP and other programs configurations So that you will spend more time setting it up than actually working on it so opening firewall is not an option and Cloning site local is also not an option. What is the option? Here's the link that you should read the idea of that Link is pretty simple instead of opening firewall firewall ports you establish a stage connection to remote server SSH connection works on standard ports or most systems are okay with opening connection between two computers On SSH ports, so that sounds okay And if you're talking about Linux or macOS environments SSH program has Routing parameter Which actually allows you by establishing SSH connection to Establish a VPN connection to remote computer and that way you don't your IDE acts as a local program for remote computer and there is no firewall issue That is pretty cool. So Let me show you a short demo With an actual code from Drupal.org How it is possible to set up remote debug this example was written with the PHP storm But it's pretty the same I Don't see what happens there So first of all you need to ensure that Your project is set up for remote debugging all necessary ports are open and Actually, don't see what happens there. So excuse me. You have to specifically set up remote host name and Mapping between local files and remote files They can reside on different folders and the last thing that you need to do is to start actually listening to incoming remote debug connections now Before starting remote debug session, I establish SSH connection to remote site, which in our case is Drupal Drupal redesigned Drupal.org That can take some time because this site is not the fastest size. It's not the fastest server in the world now When connection is established If I go directly to My browser and start a debug session, I will get time out or I will get an output of PHP immediately Because I have to Enable remote debugging not only on my client side in my IDE. I have to enable it also on server side Yeah, here I'm trying to Debug this page by the way to start a debug session you can Append special parameter to acquire a string or you can Download book marklets. You can just search for startx debug book marklet. That will give you pretty a lot of results So to enable remote debugging in On remote server, I have to edit htaccess file and there are four Parameters that you have to enable and After that if I press debug this page, I will hopefully see Code for Yeah, that's what I will see in the code and I will Be able to track execution of this script so as you see Enabling remote debug can be a challenging task but It really pays and it will give you a better control on what happens on your servers Debugging is the most important feature of IDEs, but of course there is not of course there are others and And no debug is of any use without using breakpoints because Execution can be long and include goals for Tens or maybe thousand functions So you need to have the ability to set up breakpoints Once again, I'm talking about paid versions of paid IDs HP storm and Zen studio There you can not only set breakpoints, but you can define conditions that these breakpoints were enabled this can be pretty useful if you have long loops and You're interested to check what happens in very specific conditions Then you just enable breakpoint and set some condition in that tape in that case, I'm just Stopping execution when I'm looking for nodes of type page That's all good, but All that I said until now is Very generic and not specific to Drupal Let's talk about a little bit what each tool gives To Drupal developers, but not to generic PHP developers By far the best support for Drupal development is in PHP In PHP storm, they have built-in plug-in as I mentioned What these plug-in allows is so well it works for Drupal 6 and Drupal 7 there is Alpha release For Drupal 8 support because you know Drupal 8 code base is changing very rapidly and it's kind of shooting the moving target but still With Drupal 6 and Drupal 7 if you work with PHP storm you can see if Specific function is an implementation of hook if that's an implementation of hook you can see What is the definition of that hook where it is declared? What are parameters of the of this hook? If you are starting the new function You just type the name of your project the name of the of your model and PHP storm tries to out a complete based on the list of Existing hooks in the system Of course it supports Drupal code style including deaths Capital cases and things like that There is pretty good guide for configurations and studio with Drupal Regretfully Zen Studio itself doesn't have native support for Drupal. It is built mainly for work with Zen framework and All you'll all all its whistles and blows are based On assumption that you will work on Zen framework There is a project named PDT coding style that works with both PDT and Zen Studio and it's about a code formatting NetBeans has NetBeans Drupal developer tools Which is pretty well described in the link That you see on a screen When I mentioned code hints, let me show you just an example of hard works in PHP storm If you see this small letter H on the line online 47 This is an indication that function project node view is implementation of hook view And you can notice several other things for example I'm not talking about code Syndex highlight, but for example if you look at variable line code, which is the last parameter of project node view it is of color gray Basically that means that this variable is not used in that specific function, which probably indicates a problem But we know that it is not a problem We just have to use it as a parameter for a hook, but it's not used in that implementation Which is okay, but that may be not okay in other cases So an indication that specific parallel is not used In scope of function can bring the helpful All at ease that I'm talking about support for now pretty Close out of features they will they all work with the PHP versions from 5 3 to 5 5 They all work with the X debug So it's debug is the most used debugger for PHP so Why do what I want to pay For something that you can get for free like net beans and You actually have a pretty good support and separate project for developing Drupal applications The answer is you probably may be okay with net beans and it's a very good choice But there are several things that can turn you to paid options and The first thing is conditional breakpoints as I said it may be really daunting to Hunting something that occurs only on condition like debugging long loops and things like that Second thing that may turn you to paid options is refactoring support But I know that is not relevant for this is not relevant for everyone But if you need refactoring in your project if you're working with legacy code that need to change That you should account they should count on that the reason that you may Choose Zen studio is it's actually that it's half. It's having better debugger than X debug You can use X you can use and debugger with other tools, but you actually need to buy it first You can't just download it from Zen's Zen's Zen site and Use it and if you bought Zen studio, then you probably can use Zen studio. There is no reason to use something else So then debugger is the main reason for my point of view to use Zen studio But once again, all three options are pretty stable a pretty measure and can allow you to work really effectively with Drupal That's something that I wish you to do So This is basically it. This is something that I wanted to To tell if you have some questions and feel free Thank you