PhpConcept
 
 

PhpConcept's Articles

 
 
Configure WinCVS for PEAR
 
 

March 2002
Voir cet article en Français

Introduction

This article describe how to install and configure WinCVS on a PC under Windows in order to use the versioning system of PEAR (CVS - Concurrent Versions System).

There is three ways to access the files archived in the PEAR CVS repository :
By an HTTP/HTML interface ( http://cvs.php.net )
By CVS in read only mode, with an anonymous account
By CVS in read and write mode, with a PEAR developper login

In order to use directly CVS on your PC, you must install a CVS client. A free one (GNU GPL license) exists in order to use CVS in a friendly oriented way : WinCVS.
A Web browser offers a direct access to the read only Web access.

This article does not describe a generic configuration of WinCVS, but the use of WinCVS for PEAR CVS access.

 

Installation

You must first download the client from the web site CVSGui.org. The actual stable version is the version 1.2. A beta version, 1.3beta7, is available, but I did have problems with my own PC under Windows 2000.
The installation is a classic Windows installation process.

Configuration

If you start WinCVS for the first time, you will be asked to fill the preferences popup. If you didn't do that the first time, you can come back later to the popup by the menu 'Admin'->'Preferences...'.

> Preferences configuration

It is in the preferences that you give the CVS server you want to access, and your identifier. This is indicated in the "CVSROOT" value. You need to configure :

Enter the CVSROOT : mylogin@cvs.php.net:/repository

Where "mylogin" is your PEAR developper login (please see bellow "Rules to use PEAR CVS"), "cvs.php.net" is the PEAR CVS server (in fact it is the same as the PHP one) and "repository" the position of the CVS tree in the server. In case of a read-only access, just use "cvsread" for the "mylogin". value.

Figure 1: Preferences configuration.

You will have also to indicate, in the authentication method field, that you are using a password located on the CVS server :

Authentication : "passwd" file on the cvs server

> Login to the CVS server

When the CVS server and you account login is configured (in the CVSROOT field), you need to identify yourself during the connection. To connect, use the menu 'Admin'->'login...' and indicate your password.

Figure 2 : Connect to the CVS server.

When you are using a read-only access (login "cvsread"), the password is "phpfi".

> Recuperate PEAR source code

When you are connected to the PEAR CVS server you can recuperate the PEAR source code, and have a local copy on your system.
You need to do a "checkout" of a part of the php.net CVS tree. Use menu 'Create'->'Checkout module...' in WinCVS.

Figure 3: Recuperate a module for the first time.

The name of the module to extract is 'pear' and you must indicate the path of the folder where you want to have the copy installed.

Enter the module name and path on the server : pear
Local folder to checkout to : mylocalfolder

Please note that if you do not check the box 'Do not recurse', all the folders (packages) which are part of PEAR will be copied, representing a certain amount of data. After you have recuperate the root of PEAR CVS, you will be able to checkout the modules you care about (example : 'pear/PEAR', 'pear/Archive_Tar', ....) by using the same dialog box.
Use all the time the same local folder, the tree structure is respected during the local copy : when the local folder is set to 'D:\php\dev', the module 'pear' is extracted in 'D:\php\dev\pear', the module 'pear/Archive_Tar' in 'D:\php\dev\pear\Archive_Tar', etc ...

Usage

With WinCVS you can perform several actions on the files stored in the PEAR CVS repository. The first one, described in the previous section, is to get the last source code. In this section we will quickly describe somes other basic actions :

> Recuperate the last source code updates

To simply recuperate the last updates of a module you have already locally loaded on your PC, just select, with WinCVS, the folder where this module is stored and click 'update'.
A dialog box allow you to select options. By example you can indicate if you want to get the new sub-folders or not.

Figure 4 : Recuperate the last source code updates.

In figure 4, the module 'Archive_Tar' is selected and the update starts by a click on the 'update' () button.
You can see that the folders managed by WinCVS are identified by a folder icon with a check symbol. These folders can be updated by this action.

> Commit a modification in the PEAR repository

When you did modifications on PEAR files on your local PC, you need to archive the modification on the PEAR CVS system. The modification will then be available for everybody.

Modified files are identified by their read icon. Just select it and click the 'commit' () button. A dialog box opens, and you need to describe the modifications and confirm the commit action.

Figure 5 : Commit a modification.

In figure 5, files 'package.xml' and 'Tar.php' were modified. Only the selected file 'Tar.php' will be archived when we will click the 'commit' () button. In the dialog box, we describe the modifications that were done in the file.

> Adding a file in the PEAR CVS repository

Only existing files in the CVS server can be updated after modifications. If you want to add a new file (or directory), you need to select it and use the 'Add' () button. When the file is added, you will need to do a 'commit' in order to confirm the add of the file.

Figure 6: Adding a file.

In figure 6 , the file 'New-file-to-add.txt' is not archived on the CVS server (Status = NonCvs file). In order to add it, simply select it and click on the 'add' () button. Please note that, for a binary file (for example a picture, a compressed file, ...) you need to use the next button 'Add binary'.

Rules to use PEAR CVS

Several rules must be respected to become a PEAR contributor. These rules are described in the PEAR web site. Here are some important points :

When you have a source code that may be added to PEAR, discuss about it on the dev mailing list : pear-dev@lists.php.net, as indicated in the manual. It is when you have a new code, that is approved by the other contributors, that you become a PEAR contributor.

In order to be able to access the PEAR CVS server with write credentials, you will need to have a user login. This login can be obtain by filling the following form in the PHP web site.
If you want to become a PEAR contributor, and want to know what are the rules, please refer to the PEAR web site (How to contribute to PEAR).

Don't forget to respect the PEAR coding rules.

Don't forget to respect the publication rules.

 

Enjoy PEAR !

Vincent Blavet
vincent@phpconcept.net

Misc. links about WinCVS on a more general aspect

WinCVS -- Daily use guide
How to use WinCVS

a
   

Member login - Stats
Copyright 2003 - PhpConcept

Powered by PcWeb