Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js + codeigniter

Recently been reading up on Node.js and how it is a great webserver and supports sockets even. I was thinking of using it on a project of mine, but i still haven't been able to figure out to to interact from CI to node.js. There was a project done for it with Drupal and it seems to be working well however i still can't figure out how they integrated it together.

Just wondering if anyone has any experience with the idea.

http://drupal.org/project/nodejs

http://www.youtube.com/watch?v=UV8lbdJfESg

Example:

User posts a comment via AJAX Comment gets store in DB All users watching the thread gets notification

now th part where after its submitted the comment and the notification, how does the msg get sent to node.js

like image 886
DregondRahl Avatar asked Apr 13 '11 19:04

DregondRahl


People also ask

Is NodeJS or PHP better?

Due to the V8 engine, asynchronous execution, and real-time server interaction, Node. js offers a better execution speed and certainly outperforms PHP.

Is CodeIgniter still good?

CodeIgniter is still exist but the name of this framework has become synonymous with a low-quality solution that is why we advise you Laravel as a better alternative. Both Laravel and CodeIgniter are open-source PHP framework.

Does NodeJS work with PHP?

Certainly, there are some benefits of using Node. js for PHP developers like async programming and concurrency. Other advantages stem out from the Node. js process being long-running.

CAN NodeJS replace PHP?

Is node. js a new language which can replace PHP or it is a language which can/only compliment/supplement PHP and other web languages to perform complex task? Short answer: Yes. You can replace all server-side Php with server-side Javascript.


2 Answers

I have just found this package:

NodeigniterMVC - an MVC framework for node.js inspired by Codeigniter. It allows custom routing, chaining, and partial view rendering; built-in with helpers, libraries, and a CLI. Fully compatible with Bower.

https://www.npmjs.com/package/nodeignitermvc

So from what I understad, it's a package that runs unde NODE.JS if you haven't started you're project and want them both without getting yourself into too much trouble playing with sockets on your server - this looks ideal.

maybe this helps :)

like image 78
Imnotapotato Avatar answered Sep 24 '22 17:09

Imnotapotato


The way Drupal has done it, is use the Node.js plugin Socket.io. When a comment gets posted, drupal notifies the socket with the comment details, node.js then notifies the other "clients".

like image 24
ShadowMorph Avatar answered Sep 20 '22 17:09

ShadowMorph