Node.js for PHP Developers: Porting PHP to Node.js (Paperback)

Daniel Howard

買這商品的人也買了...

商品描述

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

商品描述(中文翻譯)

如果你是一位有經驗的PHP開發者,你已經在學習如何撰寫Node.js代碼上有了一個頭部。在這本書中,作者Daniel Howard展示了這兩種語言之間的顯著相似之處,並向你展示如何將整個PHP網絡應用程序轉換為Node.js。通過比較特定的PHP功能與其Node對應物,你還將發現如何重構和改進現有的PHP 4或PHP 5源代碼。

最終,你將擁有兩個完全功能的代碼庫供給用戶使用。你可以使用這本書作為PHP和Node.js重要方面的參考,同時更新它們兩個。

使用一個簡單的Node.js框架將個別的PHP頁面轉換為Node.js文件
將阻塞的PHP源代碼重構為非阻塞的Node.js源代碼,並使用回調函數
將PHP語法、變量和類型轉換為Node.js
使用逐步技術在Node.js中實現PHP類和類繼承
將PHP文件處理API轉換為它們的Node.js等效物
比較在Node.js和PHP中使用MySQL數據庫的方法
將用於JSON或XML API的PHP代碼轉換為npm包的Node.js代碼