Node.js for PHP Developers
Coverting PHP into Server-Side JavaScript
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
Inhoudsopgave
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
Anderen die dit boek kochten, kochten ook
Net verschenen
Rubrieken
- aanbestedingsrecht
- aansprakelijkheids- en verzekeringsrecht
- accountancy
- algemeen juridisch
- arbeidsrecht
- bank- en effectenrecht
- bestuursrecht
- bouwrecht
- burgerlijk recht en procesrecht
- europees-internationaal recht
- fiscaal recht
- gezondheidsrecht
- insolventierecht
- intellectuele eigendom en ict-recht
- management
- mens en maatschappij
- milieu- en omgevingsrecht
- notarieel recht
- ondernemingsrecht
- pensioenrecht
- personen- en familierecht
- sociale zekerheidsrecht
- staatsrecht
- strafrecht en criminologie
- vastgoed- en huurrecht
- vreemdelingenrecht