Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1044442
startup.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jun 25, 11:50 AM
Size
7 KB
Mime Type
text/x-php
Expires
Fri, Jun 27, 11:50 AM (4 h, 33 m)
Engine
blob
Format
Raw Data
Handle
675552
Attached To
rINP In-Portal
startup.php
View Options
<?php
if
(
!
defined
(
'FULL_PATH'
)
)
define
(
'FULL_PATH'
,
realpath
(
dirname
(
__FILE__
).
'/..'
)
);
require_once
FULL_PATH
.
'/globals.php'
;
if
(
!
isset
(
$FrontEnd
)
)
$FrontEnd
=
0
;
# New path detection method: begin
// safeDefine('REL_PATH', '/admin');
$k4_path_detection
=
false
;
if
(
defined
(
'REL_PATH'
)
)
{
$ps
=
preg_replace
(
"/"
.
preg_quote
(
rtrim
(
REL_PATH
,
'/'
),
'/'
).
"$/"
,
''
,
str_replace
(
'
\\
'
,
'/'
,
dirname
(
$_SERVER
[
'PHP_SELF'
])));
safeDefine
(
'BASE_PATH'
,
$ps
);
// in case in-portal has defined it before
# New path detection method: end
// KENEL4 INIT: BEGIN
if
(
$FrontEnd
!=
1
&&
!
defined
(
'ADMIN'
)
)
define
(
'ADMIN'
,
1
);
if
(
!
defined
(
'APPLICATION_CLASS'
)
)
define
(
'APPLICATION_CLASS'
,
'MyApplication'
);
include_once
(
FULL_PATH
.
'/kernel/kernel4/startup.php'
);
// just to make sure that this is correctly detected
if
(
IsDebugMode
()
)
$debugger
->
appendHTML
(
'FULL_PATH: <b>'
.
FULL_PATH
.
'</b>'
);
$application
=&
kApplication
::
Instance
();
$application
->
Init
();
// compatibility constants
$g_TablePrefix
=
TABLE_PREFIX
;
$pathtoroot
=
FULL_PATH
.
'/'
;
$admin
=
'admin'
;
$rootURL
=
PROTOCOL
.
SERVER_NAME
.(
defined
(
'PORT'
)?
':'
.
PORT
:
''
).
rtrim
(
BASE_PATH
,
'/'
).
'/'
;
$localURL
=
$rootURL
.
'kernel/'
;
$adminURL
=
$rootURL
.
$admin
;
$imagesURL
=
$adminURL
.
'/images'
;
$browseURL
=
$adminURL
.
'/browse'
;
$cssURL
=
$adminURL
.
'/include'
;
$pathchar
=
'/'
;
// KERNEL4 INIT: END
$k4_path_detection
=
true
;
}
if
(!
get_magic_quotes_gpc
())
{
function
addSlashesA
(
$a
)
{
foreach
(
$a
as
$k
=>
$v
)
{
$a
[
$k
]
=
is_array
(
$v
)
?
addSlashesA
(
$v
)
:
addslashes
(
$v
);
}
return
$a
;
}
foreach
(
Array
(
'HTTP_GET_VARS'
,
'HTTP_POST_VARS'
,
'HTTP_COOKIE_VARS'
,
'HTTP_SESSION_VARS'
,
'HTTP_SERVER_VARS'
,
'_POST'
,
'_GET'
,
'_COOKIE'
,
'_SESSION'
,
'_SERVER'
,
'_REQUEST'
)
as
$_
)
if
(
isset
(
$GLOBALS
[
$_
]))
$GLOBALS
[
$_
]=
addSlashesA
(
$GLOBALS
[
$_
]);
}
/*
startup.php: this is the primary startup sequence for in-portal services
*/
if
(
file_exists
(
FULL_PATH
.
'/debug.php'
)
&&
!
defined
(
'DEBUG_MODE'
)
)
include_once
(
FULL_PATH
.
'/debug.php'
);
if
(
!
defined
(
'DEBUG_MODE'
)
)
error_reporting
(
0
);
ini_set
(
'memory_limit'
,
'32M'
);
ini_set
(
'include_path'
,
'.'
);
$kernel_version
=
"1.0.0"
;
$FormError
=
array
();
$FormValues
=
array
();
/* include PHP version compatibility functions */
require_once
(
FULL_PATH
.
'/compat.php'
);
/* set global variables and module lists */
if
(
constOn
(
'DEBUG_MODE'
)
)
include_once
(
FULL_PATH
.
'/kernel/include/debugger.php'
);
// put all non-checked checkboxes in $_POST & $_REQUEST with 0 values
if
(
GetVar
(
'form_fields'
)
)
{
$form_fields
=
GetVar
(
'form_fields'
);
foreach
(
$form_fields
as
$checkbox_name
)
{
if
(
GetVar
(
$checkbox_name
)
===
false
)
SetVar
(
$checkbox_name
,
0
);
}
}
LogEntry
(
"Initalizing System..
\n
"
);
/* for 64 bit timestamps */
if
(
!
function_exists
(
'adodb_mktime'
)
)
require_once
(
FULL_PATH
.
'/kernel/include/adodb/adodb-time.inc.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/dates.php'
);
/* create the global error object */
require_once
(
FULL_PATH
.
'/kernel/include/error.php'
);
$Errors
=
new
clsErrorManager
();
require_once
(
FULL_PATH
.
'/kernel/include/itemdb.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/db.class.php'
);
// moved from kernel/include/config.php
require_once
(
FULL_PATH
.
'/kernel/include/adodb/adodb.inc.php'
);
// moved from kernel/include/config.php
require_once
(
FULL_PATH
.
'/kernel/include/config.php'
);
/* create the global configuration object */
LogEntry
(
"Creating Config Object..
\n
"
);
$objConfig
=
new
clsConfig
();
$objConfig
->
Load
();
/* Populate our configuration data */
LogEntry
(
"Done Loading Configuration
\n
"
);
if
(
defined
(
'ADODB_EXTENSION'
)
&&
constant
(
'ADODB_EXTENSION'
)
>
0
)
LogEntry
(
"ADO Extension: "
.
ADODB_EXTENSION
.
"
\n
"
);
require_once
(
FULL_PATH
.
'/kernel/include/parseditem.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/itemreview.php'
);
// moved from kernel/include/item.php
require_once
(
FULL_PATH
.
'/kernel/include/itemrating.php'
);
// moved from kernel/include/item.php
require_once
(
FULL_PATH
.
'/kernel/include/item.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/syscache.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/modlist.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/searchconfig.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/banrules.php'
);
$objModules
=
new
clsModList
();
$objSystemCache
=
new
clsSysCacheList
();
$objSystemCache
->
PurgeExpired
();
$objBanList
=
new
clsBanRuleList
();
require_once
(
FULL_PATH
.
'/kernel/include/image.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/itemtypes.php'
);
$objItemTypes
=
new
clsItemTypeList
();
require_once
(
FULL_PATH
.
'/kernel/include/theme.php'
);
$objThemes
=
new
clsThemeList
();
require_once
(
FULL_PATH
.
'/kernel/include/language.php'
);
$objLanguages
=
new
clsLanguageList
();
$objImageList
=
new
clsImageList
();
/* Load session and user class definitions */
//require_once("include/customfield.php");
//require_once("include/custommetadata.php");
require_once
(
FULL_PATH
.
'/kernel/include/usersession.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/favorites.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/portaluser.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/portalgroup.php'
);
/* create the user management class */
$objFavorites
=
new
clsFavoriteList
();
$objUsers
=
new
clsUserManager
();
$objGroups
=
new
clsGroupList
();
require_once
(
FULL_PATH
.
'/kernel/include/cachecount.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/customfield.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/custommetadata.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/permissions.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/relationship.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/category.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/statitem.php'
);
/* category base class, used by all the modules at some point */
$objPermissions
=
new
clsPermList
();
$objPermCache
=
new
clsPermCacheList
();
$objCatList
=
new
clsCatList
();
$objCustomFieldList
=
new
clsCustomFieldList
();
$objCustomDataList
=
new
clsCustomDataList
();
$objCountCache
=
new
clsCacheCountList
();
require_once
(
FULL_PATH
.
'/kernel/include/smtp.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/emailmessage.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/events.php'
);
LogEntry
(
"Creating Mail Queue..
\n
"
);
$objMessageList
=
new
clsEmailMessageList
();
$objEmailQueue
=
new
clsEmailQueue
();
LogEntry
(
"Done creating Mail Queue Objects
\n
"
);
require_once
(
FULL_PATH
.
'/kernel/include/searchitems.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/advsearch.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/parse.php'
);
require_once
(
FULL_PATH
.
'/kernel/include/socket.php'
);
/* responsible for including module code as required
This script also creates an instance of the user session onject and
handles all session management. The global session object is created
and populated, then the global user object is created and populated
each module's parser functions and action code is included here
*/
LogEntry
(
"Startup complete
\n
"
);
include_once
(
"include/modules.php"
);
if
(
IsDebugMode
()
&&
function_exists
(
'DebugByFile'
)
)
DebugByFile
();
/* startup is complete, so now check the mail queue to see if there's anything that needs to be sent*/
$objEmailQueue
->
SendMailQeue
();
$ado
=&
GetADODBConnection
();
$rs
=
$ado
->
Execute
(
"SELECT * FROM "
.
GetTablePrefix
().
"Modules WHERE LoadOrder = 0"
);
$kernel_version
=
$rs
->
fields
[
'Version'
];
$adminDir
=
$objConfig
->
Get
(
"AdminDirectory"
);
if
(
$adminDir
==
''
)
{
$adminDir
=
'admin'
;
}
if
(
strstr
(
__FILE__
,
$adminDir
)
&&
!
GetVar
(
'logout'
)
&&
!
strstr
(
__FILE__
,
"install"
)
&&
!
strstr
(
__FILE__
,
"index"
))
{
require_login
(
null
,
'expired='
.(
int
)
GetVar
(
'expired'
)
);
}
?>
Event Timeline
Log In to Comment