Node.js for PHP Developers

Coverting PHP into Server-Side JavaScript

Specificaties
Paperback, 269 blz. | Engels
O'Reilly | 1e druk, 2013
ISBN13: 9781449333607
Rubricering
Hoofdrubriek : Computer en informatica
O'Reilly 1e druk, 2013 9781449333607
Verwachte levertijd ongeveer 16 werkdagen

Samenvatting

If you're an experienced PHP developer, you already have a head start on learning how to write Node.js code. In this book, author Daniel Howard demonstrates the remarkable similarities between the two languages, and shows you how to port your entire PHP web application to Node.js. By comparing specific PHP features with their Node counterparts, you'll also discover how to refactor and improve existing PHP 4 or PHP 5 source code.

At the end, you'll have two fully functional codebases to provide to your users. You can update both of them simultaneously, using this book as a reference to important aspects of PHP and Node.js.

- Use a simple Node.js framework to convert individual PHP pages to Node.js files
- Refactor blocking PHP source code to non-blocking Node.js source code that uses callbacks
- Convert PHP syntax, variables, and types to Node.js
- Use a step-by-step technique for implementing PHP classes and class inheritance in Node.js
- Convert PHP file handling APIs into their Node.js equivalents
- Compare approaches for using a MySQL database in Node.js and PHP
- Convert PHP code for JSON or XML APIs into Node.js code for npm packages

Specificaties

ISBN13:9781449333607
Taal:Engels
Bindwijze:paperback
Aantal pagina's:269
Uitgever:O'Reilly
Druk:1

Inhoudsopgave

Preface

1. Node.js Basics
-The node and npm Executables
-Stack Traces
-Eclipse PDT

2. A Simple Node.js Framework
-An HTTP Server
-Predefined PHP Variables
-A PHP Example Page

3. Simple Callbacks
-Linearity
-Making Code Linear

4. Advanced Callbacks
-Anonymous Functions, Lambdas, and Closures
-PHP 5.3
-PHP 4

5. HTTP Responses
-Headers
-Body
-A PHP Example Page

6. Syntax
-String Literals
-Syntax Differences
-PHP Alternative Syntax

7. Variables
-Simple Variables
-Array Variables
-Other Variable Types
-Undefined Variables
-Scope

8. Classes
-Encapsulation
-Inheritance
-PHP parent and static Keywords

9. File Access
-Reading and Writing Files
-PHP file() API Function
-Low-Level File Handling
-Filenames

10. MySQL Access
-Database Approaches
-node-mysql

11. Plain Text, JSON, and XML
-Plain Text
-JSON
-XML

12. Miscellaneous Functions
-Array
-Time and Date
-File
-JSON
-Math
-String
-Type
-Text
-MySQL
-Variable
-php.js License

Index

Net verschenen

Rubrieken

Populaire producten

    Personen

      Trefwoorden

        Node.js for PHP Developers