Fr. 42.90

Node.js for PHP Developers - Converting PHP into Server-Side JavaScript

English · Paperback / Softback

Shipping usually within 3 to 5 weeks

Description

Read more

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

List of contents










Preface;
The Mission;
Who I Am;
This Book;
About This Book;
Conventions Used in This Book;
Using Code Examples;
Safari® Books Online;
How to Contact Us;
Acknowledgments;
Chapter 1: Node.js Basics;
1.1 The node and npm Executables;
1.2 Stack Traces;
1.3 Eclipse PDT;
Chapter 2: A Simple Node.js Framework;
2.1 An HTTP Server;
2.2 Predefined PHP Variables;
2.3 A PHP Example Page;
Chapter 3: Simple Callbacks;
3.1 Linearity;
3.2 Making Code Linear;
Chapter 4: Advanced Callbacks;
4.1 Anonymous Functions, Lambdas, and Closures;
4.2 PHP 5.3;
4.3 PHP 4;
Chapter 5: HTTP Responses;
5.1 Headers;
5.2 Body;
5.3 A PHP Example Page;
Chapter 6: Syntax;
6.1 String Literals;
6.2 Syntax Differences;
6.3 PHP Alternative Syntax;
Chapter 7: Variables;
7.1 Simple Variables;
7.2 Array Variables;
7.3 Other Variable Types;
7.4 Undefined Variables;
7.5 Scope;
Chapter 8: Classes;
8.1 Encapsulation;
8.2 Inheritance;
8.3 PHP parent and static Keywords;
Chapter 9: File Access;
9.1 Reading and Writing Files;
9.2 PHP file() API Function;
9.3 Low-Level File Handling;
9.4 Filenames;
Chapter 10: MySQL Access;
10.1 Database Approaches;
10.2 node-mysql;
Chapter 11: Plain Text, JSON, and XML;
11.1 Plain Text;
11.2 JSON;
11.3 XML;
Chapter 12: Miscellaneous Functions;
12.1 Array;
12.2 Time and Date;
12.3 File;
12.4 JSON;
12.5 Math;
12.6 String;
12.7 Type;
12.8 Text;
12.9 MySQL;
12.10 Variable;
12.11 php.js License;
Colophon;

About the author

Daniel Howard has worked as a software developer for over 15 years. He has worked at startups, Fortune 500 companies, and several in between. He has seen companies and individual developers struggle to move from one technology to another. He believes everybody can keep one foot firmly planted on one side and plant his other foot in the new technology, and wants to help them learn how to do so.

Summary

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.

Product details

Authors Daniel Howard, Daniel Howard, Howard Daniel
Publisher O'Reilly Media
 
Languages English
Product format Paperback / Softback
Released 28.01.2013
 
EAN 9781449333607
ISBN 978-1-4493-3360-7
No. of pages 288
Dimensions 179 mm x 234 mm x 21 mm
Weight 470 g
Illustrations w. ill.
Subjects Natural sciences, medicine, IT, technology > IT, data processing > Data communication, networks

Programmier- und Skriptsprachen, allgemein, sourceforge, programming, node.js, javascript, PHP

Customer reviews

No reviews have been written for this item yet. Write the first review and be helpful to other users when they decide on a purchase.

Write a review

Thumbs up or thumbs down? Write your own review.

For messages to CeDe.ch please use the contact form.

The input fields marked * are obligatory

By submitting this form you agree to our data privacy statement.