This repository has been archived by the owner on Nov 19, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcontrol.php
49 lines (38 loc) · 1.6 KB
/
control.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
<?php
ini_set( "display_errors", 1 );
// Define base directory locations used
$here = dirname( __FILE__ );
define ( "HOME_DIR", "$here/" );
// Add Home directory and PHP directory to the include path
$current_path = ini_get( "include_path" );
if ( ! defined( "PATH_SEPARATOR" ) )
{
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false )
define( "PATH_SEPARATOR", ";" );
else define( "PATH_SEPARATOR", ":" );
}
ini_set( "include_path", $current_path . PATH_SEPARATOR . $here . PATH_SEPARATOR . $here . DIRECTORY_SEPARATOR . "php" );
// Set NUNIT_PATH using the url for this page.
if ( isset( $_SERVER[ "PHP_SELF" ] ) )
define( "NUNIT_PATH", dirname( $_SERVER[ "PHP_SELF" ] ) . '/' );
else
define( "NUNIT_PATH", '/' );
// The following are only used for file generation
define( "NUNIT_FILES_DIR", HOME_DIR . "files/" );
define( "NUNIT_IMAGE_DIR", HOME_DIR . "img/" );
define( "NUNIT_DOCS_DIR", HOME_DIR . "docs/" );
// Target directories for Generating Static content
define( "TARGET_DIR", HOME_DIR . "static/" );
define( "TARGET_FILES_DIR", TARGET_DIR . "files/" );
define( "TARGET_IMAGE_DIR", TARGET_DIR . "img/" );
define( "TARGET_DOCS_DIR", TARGET_DIR . "docs/" );
// URL for viewing the generated html
define( "TARGET_PATH", NUNIT_PATH . "static/" );
// Include required routines
require_once( "display_page.php" );
require_once( "html_funcs.php" );
// Get any arguments passed
$name = getarg( "p", "controlPanel" );
// Display the requested page
include( "control/$name.php" );
?>