You are previewing PHP Application Development with NetBeans Beginner's Guide.
O'Reilly logo
PHP Application Development with NetBeans Beginner's Guide

Book Description

"

Boost your PHP development skills using NetBeans with this step-by-step practical guide with this book and ebook.

  • Clear step-by-step instructions with lots of practical examples

  • Develop cutting-edge PHP applications like never before with the help of this popular IDE, through quick and simple techniques

  • Experience exciting features of PHP application development with real-life PHP projects

In Detail

NetBeans has many features that greatly simplify PHP development, and with its several features and great flexibility, PHP developers can become overwhelmed by the IDE's options. This book provides step-by-step instructions that show you how to take control of the environment and make use of these features to make your PHP application development more efficient and productive than ever before.

"PHP Application Development with NetBeans: Beginner's Guide" leads you through the crucial parts of PHP programming and shows you how to use the features of NetBeans that will improve your PHP development experience, through clear and easy instructions.

The book gets you started with the development environment and tools, and takes you through working on practical projects with a clear focus. With each chapter being mission-critical, the book is a perfect companion to boost your PHP coding productivity and gain experience with even complex projects.

The book starts with setting up the PHP development environment and introduces exciting and useful IDE features. You'll learn how to build real life PHP projects such as Facebook like Status Updater and even User Registration, Login & Logout application. Also the book will introduce you with some must know development tools such as debugging & testing tools, source documenter tools, and versioning tools.

Working with the NetBeans IDE for PHP development has its own advantages, and this book reassures the purpose. This book is full of illustrations, screenshots, and clear instructions to take your PHP development to a new level and even shows you time-saving tricks and other productivity enhancements.

"

Table of Contents

  1. PHP Application Development with NetBeans Beginner's Guide
    1. PHP Application Development with NetBeans Beginner's Guide
    2. Credits
    3. About the Author
    4. About the Reviewers
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Time for action — heading
        1. What just happened?
        2. Pop quiz — heading
        3. Have a go hero — heading
      6. Reader feedback
      7. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    7. 1. Setting up your Development Environment
      1. Why NetBeans for PHP application development?
        1. Recommended system requirements
      2. Downloading the NetBeans IDE
      3. Time for action — downloading the NetBeans IDE
        1. What just happened?
      4. Installing NetBeans
      5. Time for action — installing NetBeans step by step
        1. What just happened?
          1. Adding PHP as a plugin to an already existing NetBeans installation
          2. Multiple installation support
        2. Have a go hero — adding or removing features from NetBeans
      6. Setting up your development environment in Windows
      7. Time for action — installing XAMPP in Windows
        1. What just happened?
        2. Have a go hero — securing your XAMPP installation
      8. Setting up your development environment in the Ubuntu desktop
      9. Time for action — installing LAMP on the Ubuntu desktop
        1. What just happened?
        2. Have a go hero — displaying errors
      10. Setting up your development environment in Mac OS X
      11. Time for action — installing MAMP in Mac OS X
        1. What just happened?
        2. Have a go hero — securing your MAMP installation
      12. Creating a NetBeans PHP project
      13. Time for action — creating a NetBeans PHP project
        1. What just happened?
        2. Have a go hero — creating a project from existing sources
      14. Summary
    8. 2. Boosting Your Coding Productivity with the PHP Editor
      1. Familiarizing yourself with the base IDE features
        1. Pop quiz — familiarizing yourself with basic IDE features
      2. Exploring the editor for PHP
        1. Pop quiz — exploring the editor for PHP
      3. Exploring more with the editor
      4. Using rename refactoring and instant rename
        1. Pop quiz — using rename refactoring and instant rename
      5. Using code completion
        1. Pop quiz — using code completion
      6. Using the code generator
        1. Pop quiz — using code generators
      7. Summary
    9. 3. Building a Facebook-like Status Poster using NetBeans
      1. Planning the project
        1. Understanding JSON-JavaScript Object Notation
        2. Introducing jQuery-the definitive JavaScript library
        3. Understanding AJAX-asynchronous JavaScript and XML
        4. Introducing jQuery.ajax()
        5. Introducing PHP Data Objects (PDO)
        6. Creating the NetBeans PHP project
      2. Creating the status stream display list
        1. Setting up the database server
      3. Time for action — connecting with MySQL database server
        1. What just happened?
        2. Creating the database and table
      4. Time for action — creating MySQL database and table
        1. What just happened?
        2. Inserting sample rows into the table
        3. Adding sample user image files
        4. Creating the StatusPoster PHP class
      5. Time for action — creating a class, adding a constructor, and creating methods
        1. What just happened?
        2. Pop quiz — understanding PDO
        3. Firing the user interface for displaying the status list
      6. Time for action — adding CSS support to the document
        1. What just happened?
      7. Time for action — adding jQuery support and custom JS library
        1. What just happened?
      8. Time for action — showing the status list
        1. What just happened?
        2. Have a go hero — tweaking the CSS
        3. Pop quiz — understanding CSS
      9. Hatching out the status poster using PHP-AJAX
      10. Time for action — adding the status input box to the interface
        1. What just happened?
        2. Adding new status post template to index.php
        3. Creating the AJAX status poster
      11. Time for action — creating status poster using JQuery AJAX
        1. What just happened?
          1. Working with StatusPoster.php again
          2. Adding AJAX responder code to index.php
        2. Testing the usability of the status poster
        3. Pop quiz — Reviewing jQuery knowledge
        4. Have a go hero — sanitizing the status input
      12. Summary
    10. 4. Debugging and Testing using NetBeans
      1. Debugging the ancient art of programming
      2. Debugging PHP source code with XDebug
      3. Configuring XDebug
      4. Time for action — installing XDebug on Windows
        1. What just happened?
        2. Enabling XDebug on Ubuntu
      5. Time for action — installing XDebug on Ubuntu
        1. What just happened?
        2. Enabling XDebug on Mac OS X
      6. Debugging the PHP source with NetBeans
        1. The debugger windows
          1. Basic debugging workflow
      7. Time for action — running a debugging session
        1. What just happened?
        2. Adding Watches
      8. Time for action — adding the expression to watch
        1. What just happened?
        2. Pop quiz — debugging with XDebug
        3. Have a go hero — exploring NetBeans debugging feature
      9. Testing with PHPUnit
        1. Configuring PHPUnit
      10. Time for action — installing PHPUnit via PEAR
        1. What just happened?
          1. Configuring MAMP issues
          2. Adding PHPUnit to NetBeans
        2. Pop quiz — PEAR
        3. Creating and running PHPUnit tests
      11. Time for action — testing with PHPUnit
        1. What just happened?
        2. Dealing with code coverage with PHPUnit
      12. Time for action — using code coverage
        1. What just happened?
      13. Testing using the Selenium framework
        1. Installing Selenium
      14. Time for action — running tests with Selenium
        1. What just happened?
        2. Pop quiz — unit testing and code coverage
        3. Have a go hero — learning test dependencies
      15. Summary
    11. 5. Using Code Documentation
      1. Writing great documentation
      2. PHPDoc—commenting standard for PHP
        1. Example of a DocBlock
        2. Acquainting with PHPDoc tags
          1. Data type tags
          2. Legal tags
          3. Versioning tags
          4. Other tags
      3. Documenting the source code
        1. Documenting the functions and methods
      4. Time for action — documenting a PHP function or method
        1. What just happened?
        2. Documenting classes
      5. Time for action — documenting the PHP class and class variables
        1. What just happened?
        2. Documenting TODO tasks
      6. Time for action — using @todo tags
        1. What just happened?
      7. Documenting the API
        1. Configuring ApiGen
      8. Time for action — installing ApiGen and configuring it with NetBeans
        1. What just happened?
        2. Generating API documentation
      9. Time for action — generating documentation using ApiGen
        1. What just happened?
        2. Pop quiz — reviewing tags
        3. Have a go hero — doing more with documentation
      10. Summary
    12. 6. Understanding Git, the NetBeans Way
      1. Version control system
        1. Distributed version control
      2. Git the fast and distributed version control system
      3. Understanding Git, the NetBeans way
        1. Initializing a Git repository
      4. Time for action — initializing a Git repository
        1. What just happened?
        2. Cloning a Git repository
      5. Time for action — cloning a Git repository from GitHub via the SSH protocol
        1. What just happened?
        2. Pop quiz — understanding Git
      6. Staging files to a Git repository
      7. Time for action — staging files to a Git repository
        1. What just happened?
        2. Viewing changes in the source editor
        3. Git window
        4. Have a go hero — unstaging a staged file
      8. Committing changes to the repository
      9. Time for action — committing changes to the local repository
        1. What just happened?
        2. Have a go hero — adding and committing all the files together
        3. Comparing file revisions
      10. Time for action — using diff from the IDE
        1. What just happened?
        2. Reverting the local changes of the repository
      11. Time for action — reverting changes of the working tree
        1. What just happened?
        2. Pop quiz — working with Git
        3. Have a go hero — reverting commits
      12. Working with remote repositories
        1. Fetching source code updates
      13. Time for action — fetching source code updates
        1. What just happened?
        2. Pulling updates from the remote repository
      14. Time for action — pulling updates from the remote repository
        1. What just happened?
        2. Pushing source code changes to a remote repository
      15. Time for action — pushing source code changes
        1. What just happened?
      16. Working with branches
        1. Creating a branch
      17. Time for action — creating a branch
        1. What just happened?
        2. Checking out a branch
      18. Time for action — checking out a branch
        1. What just happened?
        2. Switching to a branch
        3. Checking out files
        4. Merging
      19. Time for action — merging into current branch
        1. What just happened?
        2. Deleting a branch
        3. Pop quiz — working with remote repositories and branches
        4. Have a go hero — creating tags
      20. Good practices and workflow
      21. Summary
    13. 7. Building User Registration, Login, and Logout
      1. Planning the project
      2. Understanding the application architecture
        1. Understanding the DAO pattern
        2. Reviewing OOP issues
        3. Namespace
        4. The API
      3. Designing the database
      4. Creating the data access layer
        1. Creating the BaseDao abstract class
      5. Time for action — creating the BaseDao class
        1. What just happened?
        2. Creating the User DAO class
      6. Time for action — creating the User Dao class
        1. What just happened?
        2. Pop quiz — reviewing PDO
      7. Creating the Service layer
        1. Creating the ValidatorService class
      8. Time for action — creating the ValidatorService class
        1. What just happened?
        2. Have a go hero — adding multibyte encoding support
        3. Creating the UserService class
      9. Time for action — creating the UserService class
        1. What just happened?
        2. Pop quiz — using namespaces
      10. Building the application
      11. Time for action — creating the user application
        1. What just happened?
        2. Creating the user interface
      12. Time for action — creating the user interface
        1. What just happened?
        2. Pop quiz — the application architecture
        3. Have a go hero — creating admin features
      13. Summary
    14. A. Introducing Symfony2 Support in NetBeans 7.2
      1. Downloading and integrating the latest Symfony Standard Edition
      2. Time for action — integrating Symfony2 with NetBeans
        1. What just happened?
      3. Creating a new Symfony2 project
      4. Time for action — creating a Symfony2 project using NetBeans
        1. What just happened?
      5. Running Symfony2 console commands inside NetBeans
        1. Creating a bundle
      6. Time for action — creating a bundle using the Symfony2 console command
        1. What just happened?
    15. B. NetBeans Keyboard Shortcuts
      1. File menu
      2. Edit menu
      3. View menu
      4. Navigate menu
      5. Source menu
      6. Refactor menu
      7. Run menu
      8. Debug menu
      9. Window menu
      10. Scrolling and selecting
      11. Modifying text
      12. Code folding
      13. Searching for text
      14. Setting tabs
    16. C. Pop Quiz Answers
      1. Chapter 2, Boosting your Coding Productivity with the PHP Editor
        1. Pop quiz — familiarizing with basic IDE features
        2. Pop quiz — exploring the editor for PHP
        3. Pop quiz — using rename refactoring and instant rename
        4. Pop quiz — using code completion
        5. Pop quiz — using code generators
      2. Chapter 3, Building a Facebook-like Status Poster using NetBeans
        1. Pop quiz — Understanding PDO
        2. Pop quiz — Understanding CSS
        3. Pop quiz — Reviewing jQuery knowledge
      3. Chapter 4, Debugging and Testing using NetBeans
        1. Pop quiz — debugging with XDebug
        2. Pop quiz — PEAR
        3. Pop quiz — unit testing and code coverage
      4. Chapter 5, Using Code Documentation
        1. Pop quiz — reviewing tags
      5. Chapter 6, Understanding Git, the NetBeans way
        1. Pop quiz — understanding Git
        2. Pop quiz — working with Git
        3. Pop quiz — working with remote repositories and branches
        4. Pop quiz — reviewing PDO
        5. Pop quiz — using namespaces
        6. Pop quiz — the application architecture