Книги и журналы » Компьютерная литература » Веб-дизайн и программирование
Node.js for PHP DevelopersГод: November 2012
Автор: Daniel Howard
Издательство: O'Reilly Media
ISBN: 978-1-4493-3360-7
Язык: Английский
Формат: PDF
Качество: Изначально компьютерное (eBook)
Интерактивное оглавление: Да
Количество страниц: 288
Описание:
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
[spoiler="Примеры страниц"]


[/spoiler]
[spoiler="Оглавление"]
Chapter 1 : Node.js BasicsThe node and npm Executables
Stack Traces
Eclipse PDT
Chapter 2 : A Simple Node.js FrameworkAn HTTP Server
Predefined PHP Variables
A PHP Example Page
Chapter 3 : Simple CallbacksLinearity
Making Code Linear
Chapter 4 : Advanced CallbacksAnonymous Functions, Lambdas, and Closures
PHP 5.3
PHP 4
Chapter 5 : HTTP ResponsesHeaders
Body
A PHP Example Page
Chapter 6 : SyntaxString Literals
Syntax Differences
PHP Alternative Syntax
Chapter 7 : VariablesSimple Variables
Array Variables
Other Variable Types
Undefined Variables
Scope
Chapter 8 : ClassesEncapsulation
Inheritance
PHP parent and static Keywords
Chapter 9 : File AccessReading and Writing Files
PHP file() API Function
Low-Level File Handling
Filenames
Chapter 10 : MySQL AccessDatabase Approaches
node-mysql
Chapter 11 : Plain Text, JSON, and XMLPlain Text
JSON
XML
Chapter 12 : Miscellaneous FunctionsArray
Time and Date
File
JSON
Math
String
Type
Text
MySQL
Variable
php.js License
Colophon[/spoiler]