Re: CVS Scripts

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

 



Eric Butera wrote:
On Thu, Mar 6, 2008 at 10:58 AM, Adrian Walls <awalls@xxxxxxxxxxxx> wrote:
Firstly thanks for a sensible reply.

 I am using Zend Studio Server and I haven't upgraded to Zend Studio for
 Eclipse as yet.  It also has some CVS capability not its not what I am
 after.

 Google was my first stop but it didn't turn up anything which appeared to be
 in a stable enough state.  Hence my email to the list to see if anyone else
 had come across such a solution.  My application is built from several
 modules contained with cvs.  Some of these modules are used across projects.
 I wanted to create my own web-based script to check these out of cvs and to
 build and configure the application on the fly.

 I had a look at cruisecontrol but its not really what I am looking for
 either.

 Adrian.






 -----Original Message-----
 From: Wolf [mailto:lonewolf@xxxxxxxxx]


Sent: 06 March 2008 15:42
 To: Adrian Walls
 Cc: 'Eric Butera'; php-general@xxxxxxxxxxxxx
 Subject: RE:  CVS Scripts

 ---- Adrian Walls <awalls@xxxxxxxxxxxx> wrote:
 > 1. It is a legal thing, whether it means anything or not or regardless of
 > what anyone else's take is on it.
 >
 > 2. It was a straight forward question I asked.  I guess it was my mistake
 > for thinking this was a place to ask questions rather than somewhere to
 take
 > the p*ss.  I'll not make the same mistake again.
 >
 <!-- SNIP -->

 We're a bunch of helpful and flippant sods on this list, so take the
 criticism as constructive (trim your own sig file down and remove the white
 space and see if you can NOT send the confidentiality notices when broadcast
 mailing).

 As for automatic CVS via PHP, it depends on your take on it...

 Eclipse has a CVS piece to it which seems to work well (I've installed it,
 but most of my stuff is layered and I don't have a reason for CVS), though
 someone also posted about cruisecontrol on the sourceforge site.

 What have you found and tried via a google search?

 Wolf



Maybe look at Phing[1]?  Skimming over the docs (I know you said you
use CVS) I saw a task you can define to check files out form SVN.
There might be a cvs one somewhere or you could extend it and write
your own.

[1] http://phing.info/


Another option would be to write your own. If your requirements are super specific, then that might be the best route. I can't imagine it would be too difficult.

You can use shell_exec to execute the CVS checkout, and any other CVS command necessary. Don't forget to use escapeshellcmd() either:

http://us3.php.net/manual/en/function.escapeshellcmd.php

After it's checked out, then you can use shell_exec() again to run the compile command. If it takes a long time, you might be best just sending the command to the output so you can copy and paste and run it yourself, or just make sure you set_time_limit(0), or some amount of time it should finish compiling in.

I assume it's an internal app, so you wouldn't have to worry too much about it looking pretty or any of the other time consuming operations.

<?php

//
// NOTE: Paths are for Linux. Change for Windows as necessary
//

$cmd = escapeshellcmd('/usr/bin/cvs -d :ext:user@cvshost:/.../cvsroot checkout module');

$output = shell_exec($cmd);

// do something with output if you need

$cmd = escapeshellcmd('/path/to/module/configure');

$output = shell_exec($cmd);

echo "done!";

?>

Something like that anyway. That's overly simplified of course, but it should get you a start if you want to write it yourself.

--
Ray Hauge
www.primateapplications.com

--
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