Productivity is an important factor for a software developer. A good development environment or surrounding tools with the essence of a particular programming flavor can boost up our coding productivity and yield a quality and optimized software product. In order to maintain a fast-paced development, developers seek the environment with which they feel at home. Such an Integrated Development Environment (IDE) can really accelerate code implementation and be the magic wand to your project development.
A good IDE is more like a Swiss army knife with crafted features. It consists of:
A source editor
A compiler/an interpreter
A debugger
Database management support
Version Control System
Tools for Object-Oriented Programming, such as Class Browser and Object Inspector
IDE, like NetBeans, comes with greater flexibility, with such features where the developer can feel at home. Moreover, NetBeans is absolutely free of charge and is provided by the open source community. Simply put, the IDE for PHP will facilitate your productivity from development to production, in every respect.
In this book, PHP Application Development with NetBeans Beginner's Guide, you will learn how to cover different categories of web-based applications with the help of NetBeans IDE through a couple of real-life, trendy PHP projects, and will complete the book as a confident PHP developer.
Chapter 1, Setting Up Your Development Environment, guides you through the process of NetBeans installation and sets up the PHP development environment step by step. By the end of this chapter, you will have your development environment ready on your operating system.
Chapter 2, Boosting Your Coding Productivity with PHP Editor, shows how you can write faster code using the NetBeans PHP Editor. You will be introduced to killer features of the IDE, such as code completion, code templates, rename refactoring, and code generation. At the end of this chapter, you will have a full, hands-on knowledge of the editor's smart features and increased coding productivity.
Chapter 3, Building a Facebook-like Status Poster using NetBeans, jumps directly to a real-life, PHP application development that will be used to display Facebook/Twitter-like, posted status streams. By the end of this chapter, you will be able to develop simple PHP applications with the NetBeans IDE.
Chapter 4, Debugging and Testing using NetBeans, will explain how to debug and test a PHP application using the IDE. Topics covered in the chapter include configuring XDebug, debugging the PHP source code, testing with PHPUnit and Selenium, and code coverage.
Chapter 5, Using Code Documentation, guides the developer through the process of creating source and project documentation. You will become familiar with PHPDoc standard tags and their use, to document the source code with the help of the editor. Also, you will use an external document generator for the project API.
Chapter 6, Understanding Git, the NetBeans Way, will show you how to use Git, a free and open source-distributed version control system. Using the IDE, you will be working on Git operations, such as initializing or cloning a repository, staging files, committing changes, reverting modifications, and remote repository operations such as fetching, pulling, and pushing, while working with branches. By the end of this chapter, you will be able to be part of a development team using the NetBeans collaborative development feature.
Chapter 7, Building User Registration, Login, and Logout, deals with a professional PHP application. You will design and develop a PHP application where users can register themselves, and after the registration they can log in to the application, view, and update their own profile, and more.
Appendix A, Introducing Symfony2 Support in NetBeans 7.2, will discover the Symfony2 PHP framework support by NetBeans. This introduces Symfony2's project creation, runs Symfony2 commands, and introduces bundle creation from NetBeans.
Appendix B, NetBeans Keyboard Shortcuts, is a convenient reference for common NetBeans keyboard shortcuts.
In Chapter 1, Setting up your Development Environment the Recommended system requirements section, explains the system requirements, and the sections beginning with Setting up your development environment explains the PHP development environment for specific operating systems. In summary, you should have the following:
NetBeans IDE
Latest package of Apache, MySQL, and PHP
The book is aimed at beginning level PHP developers who wish to develop PHP applications while taking advantage of the NetBeans functionality to ease their software development efforts and utilize the powerful features of the IDE. Familiarity with NetBeans is not assumed. However, a little familiarity with PHP development is expected.
In this book, you will find several headings appearing frequently.
To give clear instructions on how to complete a procedure or task, we use:
1. Action 1
2. Action 2
3. Action 3
Instructions often need some extra explanation so that they make sense, so they are followed with:
This heading explains the working of tasks or instructions that you have just completed.
You will also find some other learning aids in the book, including:
These are short multiple choice questions intended to help you test your own understanding.
These set practical challenges and give you ideas for experimenting with what you have learned.
You will also find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "Set the installation
folder using the file browser."
A block of code is set as follows:
<?php echo "Hello World"; ?>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Status updater</title>
<link href="<?=BASE_URL?>styles/styles.css" media="screen" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/ libs/jquery/1.7/jquery.min.js">
</script>
<script src="<?=BASE_URL?>js/status.js"></script>
</head>
Any command-line input or output is written as follows:
sudo apt-get install lamp-server^
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes, for example, appear in the text like this: "By clicking on the Next button, you will be asked to accept the license agreement."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.