Quick Search:

View

Revision:

Diff

Diff from 1865 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 1865 2009-03-08 22:00:36Z hpdl $
hpdl
1
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
hpdl
1865
8   Copyright (c) 2009 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
hpdl
1865
32   ini_set('log_errors', true);
33   ini_set('error_log', DIR_FS_WORK . 'oscommerce_errors.log');
34
hpdl
1
35 // redirect to the installation module if DB_SERVER is empty
36   if (strlen(DB_SERVER) < 1) {
37     if (is_dir('install')) {
38       header('Location: install/index.php');
39     }
40   }
41
42 // define the project version
hpdl
1498
43   define('PROJECT_VERSION', 'osCommerce 3.0a4');
hpdl
1
44
45 // set the type of request (secure or not)
46   $request_type = (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on')) ? 'SSL' : 'NONSSL';
47
48   if ($request_type == 'NONSSL') {
49     define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
50   } else {
51     define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
52   }
53
54 // compatibility work-around logic for PHP4
55   require('includes/functions/compatibility.php');
56
57 // include the list of project filenames
58   require('includes/filenames.php');
59
60 // include the list of project database tables
61   require('includes/database_tables.php');
62
63 // initialize the message stack for output messages
64   require('includes/classes/message_stack.php');
hpdl
1863
65   $osC_MessageStack = new osC_MessageStack();
hpdl
1
66
67 // initialize the cache class
68   require('includes/classes/cache.php');
hpdl
808
69   $osC_Cache = new osC_Cache();
hpdl
1
70
71 // include the database class
72   require('includes/classes/database.php');
73
74 // make a connection to the database... now
75   $osC_Database = osC_Database::connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);
76   $osC_Database->selectDatabase(DB_DATABASE);
77
78 // set the application parameters
79   $Qcfg = $osC_Database->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
hpdl
369
80   $Qcfg->bindTable(':table_configuration', TABLE_CONFIGURATION);
hpdl
1
81   $Qcfg->setCache('configuration');
82   $Qcfg->execute();
83
84   while ($Qcfg->next()) {
85     define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
86   }
87
88   $Qcfg->freeResult();
89
hpdl
443
90 // include functions
hpdl
1
91   require('includes/functions/general.php');
92   require('includes/functions/html_output.php');
93
94 // include and start the services
95   require('includes/classes/services.php');
hpdl
808
96   $osC_Services = new osC_Services();
hpdl
1
97   $osC_Services->startServices();
98 ?>