Quick Search:

View

Revision:

Diff

Diff from 1863 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/trunk/oscommerce/includes/application_top.php

Annotated File View

hpdl
1
1 <?php
2 /*
hpdl
8
3   $Id: application_top.php 1863 2009-03-06 23:53:49Z hpdl $
hpdl
1
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
hpdl
1358
8   Copyright (c) 2007 osCommerce
hpdl
1
9
hpdl
1498
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License v2 (1991)
12   as published by the Free Software Foundation.
hpdl
1
13 */
14
15 // start the timer for the page parse time log
16   define('PAGE_PARSE_START_TIME', microtime());
17
hpdl
1358
18 // set the level of error reporting to E_ALL except E_NOTICE
19   error_reporting(E_ALL ^ E_NOTICE);
20
hpdl
1
21 // set the local configuration parameters - mainly for developers
hpdl
1358
22   if ( file_exists('includes/local/configure.php') ) {
23     include('includes/local/configure.php');
24   }
hpdl
1
25
26 // include server parameters
27   require('includes/configure.php');
28
29 // set the level of error reporting
hpdl
831
30   error_reporting(E_ALL);
hpdl
1
31
32 // redirect to the installation module if DB_SERVER is empty
33   if (strlen(DB_SERVER) < 1) {
34     if (is_dir('install')) {
35       header('Location: install/index.php');
36     }
37   }
38
39 // define the project version
hpdl
1498
40   define('PROJECT_VERSION', 'osCommerce 3.0a4');
hpdl
1
41
42 // set the type of request (secure or not)
43   $request_type = (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on')) ? 'SSL' : 'NONSSL';
44
45   if ($request_type == 'NONSSL') {
46     define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
47   } else {
48     define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
49   }
50
51 // compatibility work-around logic for PHP4
52   require('includes/functions/compatibility.php');
53
54 // include the list of project filenames
55   require('includes/filenames.php');
56
57 // include the list of project database tables
58   require('includes/database_tables.php');
59
60 // initialize the message stack for output messages
61   require('includes/classes/message_stack.php');
hpdl
1863
62   $osC_MessageStack = new osC_MessageStack();
hpdl
1
63
64 // initialize the cache class
65   require('includes/classes/cache.php');
hpdl
808
66   $osC_Cache = new osC_Cache();
hpdl
1
67
68 // include the database class
69   require('includes/classes/database.php');
70
71 // make a connection to the database... now
72   $osC_Database = osC_Database::connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);
73   $osC_Database->selectDatabase(DB_DATABASE);
74
75 // set the application parameters
76   $Qcfg = $osC_Database->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
hpdl
369
77   $Qcfg->bindTable(':table_configuration', TABLE_CONFIGURATION);
hpdl
1
78   $Qcfg->setCache('configuration');
79   $Qcfg->execute();
80
81   while ($Qcfg->next()) {
82     define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
83   }
84
85   $Qcfg->freeResult();
86
hpdl
443
87 // include functions
hpdl
1
88   require('includes/functions/general.php');
89   require('includes/functions/html_output.php');
90
91 // include and start the services
92   require('includes/classes/services.php');
hpdl
808
93   $osC_Services = new osC_Services();
hpdl
1
94   $osC_Services->startServices();
95 ?>