By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

how do arrays pipe from one PHP shell script to another?

P: n/a

Suppose I have a PHP script that I call at the Linux command line
(Ubuntu), and it gets all the paths to files and directories that
exist inside of some directory. All this data gets stored in an array.
How do I get this array to another PHP shell script? Can I use pipe?

/etc/getAllPathsForDomain 'thesecondroad.org' | /etc/
findFilesUpdatedInLast24Hours

Is the syntax basically right? Is this how I should build it?

Feb 8 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Feb 7, 10:24 pm, lawrence k <lkrub...@geocities.comwrote:
Suppose I have a PHP script that I call at the Linux command line
(Ubuntu), and it gets all the paths to files and directories that
exist inside of some directory. All this data gets stored in an array.
How do I get this array to another PHP shell script? Can I use pipe?

/etc/getAllPathsForDomain 'thesecondroad.org' | /etc/
findFilesUpdatedInLast24Hours

Is the syntax basically right? Is this how I should build it?
You could do it this way using serialize(), echo, $_SERVER['argv'],
and unserialize().

I don't know what your specific project is like, but you can probably
solve your problem using include() or require() -- which will be much
easier and faster.
Feb 8 '08 #2

P: n/a
..oO(lawrence k)
>Suppose I have a PHP script that I call at the Linux command line
(Ubuntu), and it gets all the paths to files and directories that
exist inside of some directory. All this data gets stored in an array.
How do I get this array to another PHP shell script? Can I use pipe?

/etc/getAllPathsForDomain 'thesecondroad.org' | /etc/
findFilesUpdatedInLast24Hours

Is the syntax basically right? Is this how I should build it?
The array should be serialized and written to php://stdout (print or
echo). The second script can then read the input from php://stdin with
one of the various file system functions and unserialize the data.

HTH
Micha
Feb 8 '08 #3

P: n/a
On Feb 7, 10:53 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(lawrence k)
Suppose I have a PHP script that I call at the Linux command line
(Ubuntu), and it gets all the paths to files and directories that
exist inside of some directory. All this data gets stored in an array.
How do I get this array to another PHP shell script? Can I use pipe?
/etc/getAllPathsForDomain 'thesecondroad.org' | /etc/
findFilesUpdatedInLast24Hours
Is the syntax basically right? Is this how I should build it?

The array should be serialized and written to php://stdout (print or
echo). The second script can then read the input from php://stdin with
one of the various file system functions and unserialize the data.
Thanks, I'm trying to run a cron job that will run once a day. What is
the syntax of php://stdout? Is this something I put at the end of the
first script, and then php://stdin is a line that I place at the
beginning of the second script? If I do this, do I still need to do
use pipe? Or do I just forget about that?


Feb 8 '08 #4

P: n/a
lawrence k wrote:
/etc/getAllPathsForDomain
It's probably not a good idea to put arbitrary executables inside /etc/.
Use /usr/local/bin/ instead -- that's what it's there for.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 9 days, 16:09.]

The Great IE8 Meta Tag Debacle
http://tobyinkster.co.uk/blog/2008/02/06/ie-8-meta-tag/
Feb 8 '08 #5

P: n/a
On Feb 8, 4:53 am, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
lawrence k wrote:
/etc/getAllPathsForDomain

It's probably not a good idea to put arbitrary executables inside /etc/.
Use /usr/local/bin/ instead -- that's what it's there for.
Thanks, Toby. I did not know that. I'll move the scripts.

If you don't mind me asking, what is /etc/ mostly for?

Feb 9 '08 #6

P: n/a
..oO(lawrence k)
>On Feb 8, 4:53 am, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
>lawrence k wrote:
/etc/getAllPathsForDomain

It's probably not a good idea to put arbitrary executables inside /etc/.
Use /usr/local/bin/ instead -- that's what it's there for.

Thanks, Toby. I did not know that. I'll move the scripts.

If you don't mind me asking, what is /etc/ mostly for?
Configuration files and system scripts for start-up and initialization.

Micha
Feb 10 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.