D-Node Part-I

Dnode:

DNode Make PHP And Node.Js Talk To Each Other:

DNode is a remote method invocation protocol originally written for Node.js, as the name probably tells. But as the protocol it is quite simple, just sending newline-terminated JSON packets over TCP connections, implementations have started popping up in other languages. You can talk DNode in Ruby, Perl, Python, Java, and now PHP.

dnode is an asynchronous rpc system for node.js that lets you call remote functions. You can pass callbacks to remote functions, and the remote end can call the functions you passed in with callbacks of its own and so on. Its callbacks all the way down! (Bidirectional)

  1. provides RMI

  2. remote functions can accept callbacks as arguments

  3. which is nice, since it is fully asynchronous

  4. runs stand-alone or through an existing http server

  5. can have browser and Node clients

  6. supports middleware, just like connect

 

How to Install DNode:

  1. Download and Extract DNode files from https://github.com/bergie/dnode-php

  2. Need to install another one

(Ie) Git Bash), you can download it from http://git-scm.com/downloads . Download and install.

  1. Set Environment path

Mycomputer – properties-Advance-Environment variable- new- Name is Git, value=C:\Program Files\Git\bin\git.exe

  1. Again set environment path

Name= PATH (already PATH will present in your system, then use semicolon and continue), and here value is = C:\Program Files\Git\bin

  1. Restart your system. (If installation not affecting in your system).

  2. You will get “composer.phar” file inside the extracted Dnode file, if not there download it from

getcomposer.org/composer.phar

  1. Now you need to run “composer.phar” file. While running this file you may face some issue (installation issue). If you face any issue, then better cut (or) copy “composer.json” file from extracted one (Ie: dnode_sample folder) and keep it in inside D:\wamp\bin\php\php5.3.5 (I installed Wamp in D: drive, it may vary in your system).If there is no issue then let it be.

  2. But, in my case am facing some installation issue, so I keep it in inside D:\wamp\bin\php\php5.3.5.

  3. For installing “composer.phar” use below command in command prompt. Refer screen shot – 6. Wamp version will change as per your’s

D:\wamp\bin\php\php5.3.5> php MYPATH\composer.phar

Screen shot – 6: (Give your wamp and folder path)

 Dnode1

  1. Once you run above command then you will get “vendor” folder in your wamp-bin-php-php5.3.5-vendor.

  2. After initialized “Vendor” folder open and check following folder structure is formed or not

    1. Composer folder
    2. Evenement folder
    3. React folder
    4. Autoload.php (Must check this file is create or not)

All the above folders have some files, please check whether all folders have files or not, if not better installed once again.

  1. If installation is proper, then copy “vendor” folder from wamp-bin-php-php5.3.5 path to paste it to your location : For Ex: D:\wamp\www\MYPATH\dnode_sample\

Note: we can keep vendor folder php5.3.5 itself, that’s also possible but while running a DNode file we need to give proper path in Command prompt. And sometimes while running a client file it will give some issue.