-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepoDoc.php
executable file
·85 lines (80 loc) · 1.91 KB
/
repoDoc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?PHP
/**
* repoDoc main execution file
*
* This should work with PHP >= Version 4.1.2
* If there are any problems on a version, email me at [email protected].
* Even
*
* @package repoDoc
* @author Bryn Mosher
*/
// keep this away from web servers
if ( array_key_exists( 'SERVER_SIGNATURE', $_SERVER ) ) {
header("HTTP/1.0 501 Not Implemented");
exit(501);
}
// set some surefire things that need to be done
ini_set("html_errors", 0 );
ini_set( "display_errors", 1 );
error_reporting( E_ALL );
if ( !defined( "PHP_EOL" ) ) {
/**
* PHP_EOL for PHP versions older than 4.3.x
*/
if ( preg_match( "/windows/i", $_SERVER["OS"] ) ) {
define( "PHP_EOL", "\r\n" );
} else {
define( "PHP_EOL", "\n" );
}
}
/**
* pdpDoc destination
*/
$GLOBALS["doxDestination"] = FALSE;
/**
* CVS repository to check out
*/
$GLOBALS["cvsRepos"] = FALSE;
/**
* logfile file name
*/
$GLOBALS["logfile"] = FALSE;
/**
* log file resource handle
*/
$GLOBALS["logResource"] = FALSE;
/**
* Local sources to have phpDoc parse (from --nocheckout)
*/
$GLOBALS["sourceLocal"] = FALSE;
/**
* Subversion repository to check out
*/
$GLOBALS["svnRepos"] = FALSE;
/**
* Require the functions file
*/
require_once( dirname( __FILE__ ) . "/repoDoc_functions.php" );
if ( array_key_exists( 'argc', $_SERVER ) ){
$usedParms = array();
if ( !$cmdOut = cmdLine() ) {
pIt( "Could not parse arguments!", -1, 1 );
helpThem( 1 );
}
if ( $cmdOut ) {
if ( ($GLOBALS["doxDestination"] === FALSE ) ) {
pIt( "No destination given. See --destination.", -1, 1 );
helpThem( 1 );
}
if ( ( $GLOBALS["svnRepos"] === FALSE ) && ( $GLOBALS["cvsRepos"] === FALSE ) && ( $GLOBALS["sourceLocal"] === FALSE ) ) {
pIt( PHP_EOL . "No repository or source given. See --cvs, --svn or --nocheckout." . PHP_EOL, -1 );
helpThem( 1 );
}
pIt( $cmdOut[0] . PHP_EOL );
pIt( $cmdOut[1] . PHP_EOL );
}
} else {
pIt( "Could not get arguments!", -1, 1 );
helpThem( 1 );
}