PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Cesar D. Rodas   PHP CVS Client   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example CVS
Class: PHP CVS Client
Retrieve files from a CVS repository in pure PHP
Author: By
Last change:
Date: 16 years ago
Size: 2,710 bytes
 

Contents

Class file image Download
<?php
/*
***************************************************************************
* Copyright (C) 2007-2008 by Sixdegrees *
* cesar@sixdegrees.com.br *
* "Working with freedom" *
* http://www.sixdegrees.com.br *
* *
* Permission is hereby granted, free of charge, to any person obtaining *
* a copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to *
* the following conditions: *
* *
* The above copyright notice and this permission notice shall be *
* included in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR *
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
* OTHER DEALINGS IN THE SOFTWARE. *
***************************************************************************
*/
set_time_limit(0);
require(
"phpcvsclient.php");
/* creating object, connecting to a public repository*/
$cvs = new phpCVSclient("cvsread@cvs.meta-language.net:/opt2/ena/metal","","forms");
$cvs->setDebug(TEXT,"debug.txt");

if ( !
$cvs->login() ) {
    die(
"Imposible to login. ".$cvs->errorstr);
}

?>
<html>
    <head>
        <title>Cesar Rodas' PHP CVS Client</title>
    </head>
    <body>
        <center><h1>Example</h1></center>
        <h2>Checking out a public repository</h2>
<?php
$parmas
= array(
   
DST_FOLDER=>"repository"
);
$foo = $cvs->checkout($parmas);
?>
Files downloaded are <?="<pre>".print_r($foo,true)."</pre>"?>
<h2>Getting change log of "forms.php"</h2>
<pre><?php
print_r
(
  
$cvs->getFileLogs("forms.php")
);
?></pre>
    </body>
</html>