From 98dbe6f0d2edfff3a1f5785504504b4a6e5dd4eb Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 19 Nov 2011 11:33:31 +0000 Subject: updating phpDocumentor, part 2: add new version --- buildscripts/PhpDocumentor/scripts/add_cvs.php | 304 ++++++++++++------------- 1 file changed, 152 insertions(+), 152 deletions(-) (limited to 'buildscripts/PhpDocumentor/scripts/add_cvs.php') diff --git a/buildscripts/PhpDocumentor/scripts/add_cvs.php b/buildscripts/PhpDocumentor/scripts/add_cvs.php index 2dfcd656..8b1145d0 100644 --- a/buildscripts/PhpDocumentor/scripts/add_cvs.php +++ b/buildscripts/PhpDocumentor/scripts/add_cvs.php @@ -1,153 +1,153 @@ - - * @copyright Copyright 2003, Greg Beaver - * @version 1.0 - */ -/**#@+ - * phpDocumentor include files. If you don't have phpDocumentor, go get it! - * Your php life will be changed forever - */ -$dir = realpath(dirname(__FILE__).'/..'); -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 -*/ -$cvsadd_directory = realpath('.'); -/** -* 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 -* @global string $ignore -*/ -$ignore = array('CVS/'); - -/****************************************************************************** -* Don't change anything below here unless you're adventuresome * -*******************************************************************************/ - -/** - * @global Io $files - */ -$files = new Io; - -$allfiles = $files->dirList($cvsadd_directory); -/**#@+ - * Sorting functions for the file list - * @param string - * @param string - */ -function sortfiles($a, $b) -{ - return strnatcasecmp($a['file'],$b['file']); -} - -function mystrucsort($a, $b) -{ - if (is_numeric($a) && is_string($b)) return 1; - if (is_numeric($b) && is_string($a)) return -1; - if (is_numeric($a) && is_numeric($b)) - { - if ($a > $b) return 1; - if ($a < $b) return -1; - if ($a == $b) return 0; - } - return strnatcasecmp($a,$b); -} -/**#@-*/ - -$struc = array(); -foreach($allfiles as $file) -{ - if ($files->checkIgnore(basename($file),dirname($file),$ignore, false)) - { -// print 'Ignoring '.$file."
\n"; - continue; - } - $path = substr(dirname($file),strlen(str_replace('\\','/',realpath($cvsadd_directory)))+1); - if (!$path) $path = '/'; - $file = basename($file); - $ext = array_pop(explode('.',$file)); - if (strlen($ext) == strlen($file)) $ext = ''; - $struc[$path][] = array('file' => $file,'ext' => $ext); -} -uksort($struc,'strnatcasecmp'); -foreach($struc as $key => $ind) -{ - usort($ind,'sortfiles'); - $struc[$key] = $ind; -} -$tempstruc = $struc; -$struc = array('/' => $tempstruc['/']); -$bv = 0; -foreach($tempstruc as $key => $ind) -{ - $save = $key; - if ($key != '/') - { - $struc['/'] = setup_dirs($struc['/'], explode('/',$key), $tempstruc[$key]); - } -} -uksort($struc['/'],'mystrucsort'); -/** - * Recursively add files to cvs - * @param array the sorted directory structure - */ -function addToCVS($struc) -{ - foreach($struc as $dir => $files) - { - if ($dir === '/') - { - print 'processing '.$dir . "\n"; - addToCVS($struc[$dir]); - return; - } else - { - if (!isset($files['file'])) - { - print 'adding '.$dir . "\n"; - system('cvs add '.$dir); - chdir($dir); - addToCVS($files); - chdir('..'); - } else - { - print 'adding '.$files['file'] . "\n"; - system('cvs add '.$files['file']); - system('cvs commit -m "" '.$files['file']); - } - } - } -} -addToCVS($struc); -print "\n".'done'; + + * @copyright Copyright 2003, Greg Beaver + * @version 1.0 + */ +/**#@+ + * phpDocumentor include files. If you don't have phpDocumentor, go get it! + * Your php life will be changed forever + */ +$dir = realpath(dirname(__FILE__).'/..'); +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 +*/ +$cvsadd_directory = realpath('.'); +/** +* 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 +* @global string $ignore +*/ +$ignore = array('CVS/'); + +/****************************************************************************** +* Don't change anything below here unless you're adventuresome * +*******************************************************************************/ + +/** + * @global Io $files + */ +$files = new Io; + +$allfiles = $files->dirList($cvsadd_directory); +/**#@+ + * Sorting functions for the file list + * @param string + * @param string + */ +function sortfiles($a, $b) +{ + return strnatcasecmp($a['file'],$b['file']); +} + +function mystrucsort($a, $b) +{ + if (is_numeric($a) && is_string($b)) return 1; + if (is_numeric($b) && is_string($a)) return -1; + if (is_numeric($a) && is_numeric($b)) + { + if ($a > $b) return 1; + if ($a < $b) return -1; + if ($a == $b) return 0; + } + return strnatcasecmp($a,$b); +} +/**#@-*/ + +$struc = array(); +foreach($allfiles as $file) +{ + if ($files->checkIgnore(basename($file),dirname($file),$ignore, false)) + { +// print 'Ignoring '.$file."
\n"; + continue; + } + $path = substr(dirname($file),strlen(str_replace('\\','/',realpath($cvsadd_directory)))+1); + if (!$path) $path = '/'; + $file = basename($file); + $ext = array_pop(explode('.',$file)); + if (strlen($ext) == strlen($file)) $ext = ''; + $struc[$path][] = array('file' => $file,'ext' => $ext); +} +uksort($struc,'strnatcasecmp'); +foreach($struc as $key => $ind) +{ + usort($ind,'sortfiles'); + $struc[$key] = $ind; +} +$tempstruc = $struc; +$struc = array('/' => $tempstruc['/']); +$bv = 0; +foreach($tempstruc as $key => $ind) +{ + $save = $key; + if ($key != '/') + { + $struc['/'] = setup_dirs($struc['/'], explode('/',$key), $tempstruc[$key]); + } +} +uksort($struc['/'],'mystrucsort'); +/** + * Recursively add files to cvs + * @param array the sorted directory structure + */ +function addToCVS($struc) +{ + foreach($struc as $dir => $files) + { + if ($dir === '/') + { + print 'processing '.$dir . "\n"; + addToCVS($struc[$dir]); + return; + } else + { + if (!isset($files['file'])) + { + print 'adding '.$dir . "\n"; + system('cvs add '.$dir); + chdir($dir); + addToCVS($files); + chdir('..'); + } else + { + print 'adding '.$files['file'] . "\n"; + system('cvs add '.$files['file']); + system('cvs commit -m "" '.$files['file']); + } + } + } +} +addToCVS($struc); +print "\n".'done'; ?> \ No newline at end of file -- cgit v1.2.3