node.js - How to use exec-php(node js) in MVC framework like zend? -
basically want on here data node server js, data returned function written zend model.
my node js server code below:
var socket = require( 'socket.io' ); var express = require( 'express' ); var http = require( 'http' ); var execphp = require('exec-php'); var app = express(); var server = http.createserver( app ); var io = socket.listen( server ); execphp('../application/modules/front/models/dbtable/postcontent.php', function(error, php, outprint){ php.fetchentryall(function(error, result){ io.sockets.emit('showfeeds', result); }); }); server.listen( 7000 );
so when tried execute above code gives me error below:
error: command failed: php fatal error: class 'zend_db_table_abstract' not found in /data/www/xxx/application/modules/front/models/dbtable/postcontent.php on line 3
same code works when use core php instead of zend.
so believe can't use oop stuff exec-php.
is there solution here?
reference link exec-php: https://www.npmjs.com/package/exec-php
the problem ran not oop autoloading object class file(s).
while have path defined first file or of following files don't have path defined dependencies--like abstract class.
zf1 files should have require statements , work without auto loader. missing , need same in own modules files.
in application/modules/front/models/dbtable/postcontent.php
file have hint path abstract class require_once
statement.
Comments
Post a Comment