Source for file add_cvs.php
Documentation is available at add_cvs.php
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | Copyright (c) 2000-2003 Joshua Eichorn, Gregory Beaver |
// | Web http://www.phpdoc.org |
// | Mirror http://phpdocu.sourceforge.net/ |
// | PEAR http://pear.php.net/package-info.php?pacid=137 |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License, |
// | that is available at http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// +------------------------------------------------------------------------+
* CVS file adding iterator
* This file iterates over a directory, and adds everything to CVS that is
* found, ignoring any error messages, until all files in each directory
* and subdirectory have been added to cvs. It then commits the files to cvs
* @copyright Copyright 2003, Greg Beaver
* phpDocumentor include files. If you don't have phpDocumentor, go get it!
* Your php life will be changed forever
require_once("$dir/ phpDocumentor/ common. inc. php");
require_once("$dir/ phpDocumentor/ Io. inc");
* Physical location on this computer of the package to parse
* @global string $cvsadd_directory
* Comma-separated list of files and directories to ignore
* This uses wildcards * and ? to remove extra files/directories that are
* not part of the package or release
/****************************************************************************
* Don't change anything below here unless you're adventuresome *
*******************************************************************************/
$allfiles = $files->dirList($cvsadd_directory);
* Sorting functions for the file list
foreach($allfiles as $file)
// print 'Ignoring '.$file."<br>\n";
$struc[$path][] = array('file' => $file,'ext' => $ext);
uksort($struc,'strnatcasecmp');
foreach($struc as $key => $ind)
$struc = array('/' => $tempstruc['/']);
foreach($tempstruc as $key => $ind)
uksort($struc['/'],'mystrucsort');
* Recursively add files to cvs
* @param array the sorted directory structure
foreach($struc as $dir => $files)
print 'processing '. $dir . "\n";
if (!isset ($files['file']))
print 'adding '. $dir . "\n";
print 'adding '. $files['file'] . "\n";
system('cvs add '. $files['file']);
system('cvs commit -m "" '. $files['file']);
|