Cover image for Node.js for PHP Developers

Book description

If you’re a PHP developer, you too can take advantage of the incredible capabilities of Node.js. This book provides several practical recipes for porting your existing PHP code to Node, and what you can achieve with this open source framework once you’re done. By comparing specific PHP features with their Node counterparts, author Daniel Howard demonstrates how the concept behind PHP has evolved in Node.

Table of Contents

  1. Node.js for PHP Developers
  2. Preface
    1. The Mission
    2. Who I Am
    3. This Book
    4. About This Book
    5. Conventions Used in This Book
    6. Using Code Examples
    7. Safari® Books Online
    8. How to Contact Us
    9. Acknowledgments
  3. 1. Node.js Basics
    1. The node and npm Executables
    2. Stack Traces
    3. Eclipse PDT
  4. 2. A Simple Node.js Framework
    1. An HTTP Server
    2. Predefined PHP Variables
    3. A PHP Example Page
  5. 3. Simple Callbacks
    1. Linearity
    2. Making Code Linear
  6. 4. Advanced Callbacks
    1. Anonymous Functions, Lambdas, and Closures
    2. PHP 5.3
    3. PHP 4
  7. 5. HTTP Responses
    1. Headers
    2. Body
    3. A PHP Example Page
  8. 6. Syntax
    1. String Literals
    2. Syntax Differences
    3. PHP Alternative Syntax
  9. 7. Variables
    1. Simple Variables
    2. Array Variables
    3. Other Variable Types
    4. Undefined Variables
    5. Scope
  10. 8. Classes
    1. Encapsulation
    2. Inheritance
    3. PHP parent and static Keywords
  11. 9. File Access
    1. Reading and Writing Files
    2. PHP file() API Function
    3. Low-Level File Handling
    4. Filenames
  12. 10. MySQL Access
    1. Database Approaches
    2. node-mysql
  13. 11. Plain Text, JSON, and XML
    1. Plain Text
    2. JSON
    3. XML
  14. 12. Miscellaneous Functions
    1. Array
    2. Time and Date
    3. File
    4. JSON
    5. Math
    6. String
    7. Type
    8. Text
    9. MySQL
    10. Variable
    11. php.js License
  15. Index
  16. About the Author
  17. Colophon
  18. Copyright