php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #56272 cvsclient docu/sample required
Submitted: 2005-01-18 22:20 UTC Modified: 2015-08-16 04:22 UTC
From: eflash at gmx dot net Assigned:
Status: No Feedback Package: cvsclient (PECL)
PHP Version: Irrelevant OS: all
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 - 5 = ?
Subscribe to this entry?

 
 [2005-01-18 22:20 UTC] eflash at gmx dot net
Description:
------------
Any plans for at least listing the available functions,
and providing a test sample?



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-20 16:48 UTC] efash at gmx dot net
<html>
<h2>PHP cvsclient extension sample</h2>
<pre>
<?php
// Sample to test the cvsclient extension
// To view source call with: tstcvsclient.php?viewsource=1
// v0.10 20-Jan-2005, by G. Knauf <efash@gmx.net>

// Connect to CVS pserver
//   resource cvsclient_connect(string server, string cvsroot[, int port])
// Authenticate to the CVS pserver
//   bool cvsclient_login(resource cvsclient, string username, string password)
// Retrieve specified <revision> (can also be tag or branch) of filename referred to by <path> in <module> */
//   mixed cvsclient_retrieve(resource cvsclient, string module, string path[, string saveto[, string revision]])
// Retrieve log message for a particular revision
//   proto string cvsclient_log(resource cvsclient, string module, string filepath[, string revision])
if ($_GET['viewsource']) { highlight_file($_SERVER['SCRIPT_FILENAME']); die; };
extension_loaded('cvsclient') or die ("Error: cvsclient extension not loaded!"); 

$server = 'cvs.php.net';
$cvsroot = '/repository';
$username = 'cvsread';

if( ! isset( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] != 'on' ) {
  echo "<font color=red><b>Warning! This connection is unsecure - use HTTPS instead!</b></font><p>\n";
}

if (isset($_POST['submit'])) { 
  $server = $_POST['cvsserver'];
  $cvsroot = $_POST['cvsroot'];
  $username = $_POST['username'];
  $password = $_POST['password'];

  $cvsclient = cvsclient_connect($server, $cvsroot) or die("Can't connect to '$server'");
  if (cvsclient_login($cvsclient, $username, $password)) {
    echo "<font color=green>Successfully logged into '$server'!</font>\n";
  } else {
    echo "<font color=red>Failed to login to '$server'!</font>\n";
  }
  echo "</pre>\n";
} else {
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table>
<tr><td><b>Enter Server: </b></td>
<td><input type="cvsserver" name="cvsserver" size="30" value="<?php echo $server; ?>"></td></tr>
<tr><td><b>Enter CVSROOT: </b></td>
<td><input type="cvsroot" name="cvsroot" size="90" value="<?php echo $cvsroot; ?>"></td></tr>
<tr><td><b>Enter Username: </b></td>
<td><input type="username" name="username" size="30" value="<?php echo $username; ?>"></td></tr>
<tr><td><b>Enter Password: </b></td>
<td><input type="password" name="password" size="30"></td></tr>
</table>
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>
</html>
 [2005-01-20 17:23 UTC] pollita@php.net
It's on an ever-growing list of TODOs...

The reason the cvsclient package got stalled is that I wanted to include CVS over SSH functionality, but of course that meant building an SSH extension first.

That's nearing a stable state though so I may be able to turn some of my focus back here (don't get too hopeful, I've got more than a couple requests to bring runkit to light).

If you (or anyone else) is interrested in working on (or taking over) this extension, then by all means let me know.
 [2005-01-20 21:12 UTC] eflash at gmx dot net
Hi Pollita,
your timeframe seems not better than mine;
I'm in far too many projects involved, and also I'm somwhat new to php extension coding....
also I would now prefer to make focus on a svnclient; that seems far easier cause we can call into libsvn...

below a new sample with which I was at least able to retrieve a file; but it's still not clear for me how I can retieve a file listing...?? Would be great if you could take a look, perhaps add some lines, and check into CVS test folder.
==========================================================
<html>
<h2>PHP cvsclient extension sample</h2>
<pre>
<?php
// Sample to test the cvsclient extension
// To view source call with: tstcvsclient.php?viewsource=1
// v0.11 21-Jan-2005, by G. Knauf <efash@gmx.net>

// Connect to CVS pserver
//   resource cvsclient_connect(string server, string cvsroot[, int port])
// Authenticate to the CVS pserver
//   bool cvsclient_login(resource cvsclient, string username, string password)
// Retrieve specified <revision> (can also be tag or branch) of filename referred to by <path> in <module> */
//   mixed cvsclient_retrieve(resource cvsclient, string module, string path[, string saveto[, string revision]])
// Retrieve log message for a particular revision
//   proto string cvsclient_log(resource cvsclient, string module, string filepath[, string revision])
if ($_GET['viewsource']) { highlight_file($_SERVER['SCRIPT_FILENAME']); die; };
extension_loaded('cvsclient') or die ("Error: cvsclient extension not loaded!"); 

$server = 'cvs.php.net';
$cvsroot = '/repository';
$username = 'cvsread';
$password = 'cvsread';
$module = '/pecl/cvsclient';
$path = 'package.xml';
$saveto = '/tmp/pecl';

if( ! isset( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] != 'on' ) {
  echo "<font color=red><b>Warning! This connection is unsecure - use HTTPS instead!</b></font><p>\n";
}

if (isset($_POST['submit'])) { 
  $server = $_POST['server'];
  $cvsroot = $_POST['cvsroot'];
  $module = $_POST['module'];
  $path = $_POST['path'];
  $username = $_POST['username'];
  $password = $_POST['password'];

  $cvsclient = cvsclient_connect($server, $cvsroot) or die("Can't connect to '$server'");
  if (cvsclient_login($cvsclient, $username, $password)) {
    echo "<font color=green>Successfully logged into '$server'!</font>\n\n";
    //$r = cvsclient_retrieve($cvsclient, $module, $path[, string saveto[, string revision]])
    echo "Trying to retreive '$path' from '$module'...\n";
    if ($r = cvsclient_retrieve($cvsclient, $module, $path)) {
      echo "<font color=blue>\n";
      echo "<hr>\n$r\n<hr>\n";
      echo "</font>\n";
    } else {
      echo "<font color=red>Failed to retrieve '$path' from '$module'!</font>\n";
    }
  } else {
    echo "<font color=red>Failed to login to '$server'!</font>\n";
  }
  echo "</pre>\n";
} else {
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table>
<tr><td><b>Enter Server: </b></td>
<td><input type="text" name="server" size="40" value="<?php echo $server; ?>"></td></tr>
<tr><td><b>Enter CVSROOT: </b></td>
<td><input type="text" name="cvsroot" size="40" value="<?php echo $cvsroot; ?>"></td></tr>
<tr><td><b>Enter Module: </b></td>
<td><input type="text" name="module" size="40" value="<?php echo $module; ?>"></td></tr>
<tr><td><b>Enter Filepath: </b></td>
<td><input type="text" name="path" size="40" value="<?php echo $path; ?>"></td></tr>
<tr><td><b>Enter Username: </b></td>
<td><input type="username" name="username" size="40" value="<?php echo $username; ?>"></td></tr>
<tr><td><b>Enter Password: </b></td>
<td><input type="password" name="password" size="40" value="<?php echo $password; ?>"></td></tr>
</table>
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>
</html>
 [2015-08-02 14:15 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2015-08-02 14:15 UTC] cmb@php.net
I guess this ticket can be closed, or is cvsclient documentation still required?
 [2015-08-16 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 06 16:01:26 2024 UTC