Re: returning array from commandline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ian wrote:

> On Fri, Oct 10, 2008 at 3:47 PM, Per Jessen <per@xxxxxxxxxxxx> wrote:
>> Ian wrote:
>>
>>> I am busy developing a commandline tool that will, in certain
>>> cirumstances, return an array of information when called and im
>>> having a problem with this.
>>
>> Ian, that's a bit of a contradiction - a command line tool returns a
>> return code.
>>
> 
> Yep, my bad - thats bad english - it was talking about the output that
> the commandline tool spews out - i was hoping to return the entire
> array for use within the web interface.

Got it - yes, that should be possible, but only in text format.  Have
you looked at the output array parameter from the exec() call? 

What you might be able to is print out the serialized form of the array,
and the deserialize in the calling function?  Bit of round-about way,
but it might work. 

>>> Quick summary: Im accessing a web interface that calls a php file to
>>> parse some info. That php file may get an array back that I need to
>>> use in the web interface - but I cant pass it back to the web
>>> interface from the commandline tool.
>>
>> Why does it have to be called as a command line tool?  Why not just
>> call it as a plain PHP function?
> 
> I have to use it as I cant include some required files into my web ui
> as they interfere with the base system (not one i wrote) and it causes
> all sorts of havoc so I have resorted to creating a "bridge" to
> combine the two systems which is where this problem comes in.

Ah, now it makes sense.  Then you've just got to work out the
interface - maybe the serialize/deserialize I mentioned above.  Or you
could let the command line stuff write to a file that you'd then read
back from the web ui. 


/Per Jessen, Zürich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux