run shell prog, CVS

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sgsg
Forum Newbie
Posts: 1
Joined: Wed May 14, 2003 11:24 am

run shell prog, CVS

Post by sgsg »

Hi!
I would like to do the following:
1. login to cvs server using cvs client installed on my local computer
2. checkout a project
3. get a log for each file

and all that from php. Is it possible to do this? And how?
Thank you in advance.

btw.
This is how i tried to do it but it didn't work. :)

$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
);

$process = proc_open("cmd.exe", $descriptorspec, $pipes);

if (is_resource($process)) {

fwrite($pipes[0], "SET CVSROOT=:pserver:USERNAME@192.168.0.2:/PROJECT\n");

fwrite($pipes[0], "c:\cvs\cvs.exe -z9 login\n");
sleep(2);
fwrite($pipes[0], "\n");

sleep(10);

fwrite($pipes[0], "cd ..\n");
fwrite($pipes[0], "md tmp1\n");
fwrite($pipes[0], "cd tmp1\n");
fwrite($pipes[0], "c:\cvs\cvs.exe checkout PROJECT\n");
...etc,etc...
Post Reply