/
index.php
executable file
·87 lines (80 loc) · 3.43 KB
/
index.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
85
86
87
<?php
/* ================================================================== *\
(C) Copyright 2005 by Secure Data Software, Inc.
This file is part of Andromeda
Andromeda is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Andromeda is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Andromeda; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301 USA
or visit http://www.gnu.org/licenses/gpl.html
\* ================================================================== */
// ==================================================================
// This first stuff you see makes possible "friendly URLS", by
// making possible absolute path references to CSS and JS files.
//
// The global value 'tmpPathInsert' is used by templates to create
// absolute references to CSS files and JS files that will work
// in all three deployment modes, which are:
// -> On a localhost, like http://localhost/~userdir/andro/....
// -> On a domain, like http://www.example.com/....
// -> On a domain, admin mode like http://dhost2.secdat.com/app/....
//
// This code must also be smart enough to figure out the following
// cases it might find:
//
// REQUEST_URI = /~userdir/app/index.php?parmstring....
// REQUEST_URI = /~userdir/app/?parmstring....
// REQUEST_URI = /~userdir/app/
//
// Note that it checks first to see if tmpPathInsert has already been
// created, because upstream files like "pages" might have done this
// already.
//
// -- KFD 3/15/07
//
// ==================================================================
if(!isset($AG['tmpPathInsert'])) {
$ruri=$_SERVER['REQUEST_URI'];
// If there is a "?", strip that off and everything past it
$ruriqm =strpos($ruri,'?');
if($ruriqm!==false) $ruri=substr($ruri,0,$ruriqm);
// If there is an "index.php" then strip that off
$ruri=preg_replace('/index.php/i','',$ruri);
// Now remove the leading slash that is always there (unless it ain't)
if(substr($ruri,0,1)=='/') $ruri = substr($ruri,1);
$AG['tmpPathInsert']=$ruri;
}
// ==================================================================
// >>>
// >>> The path is based on the real location of the index.php
// >>> file.
// >>>
// ==================================================================
$dir = realpath(dirname(__FILE__)).'/';
$AG['dirs']['root'] = $dir;
$AG["dirs"]["dynamic"] = $dir."dynamic/";
$AG["dirs"]["application"] = $dir."application/";
$AG["dirs"]["generated"] = $dir."generated/";
$AG["dirs"]["lib"] = $dir."lib/";
ini_set("include_path"
,$AG["dirs"]["dynamic"].PATH_SEPARATOR
.$AG["dirs"]["application"].PATH_SEPARATOR
.$AG["dirs"]["generated"].PATH_SEPARATOR
.$AG["dirs"]["lib"].PATH_SEPARATOR
.ini_get("include_path")
);
// ==================================================================
// >>>
// >>> Now pass control forever to the library routines
// >>>
// ==================================================================
include('index_hidden.php');
?>