php Copyright 2008 Dennis Kreminsky etranger at etranger dot ru packag

  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
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* (c) Copyright 2008 Dennis Kreminsky, etranger at etranger dot ru
*
* @package flamework
* @author Dennis Kreminsky, etranger at etranger dot ru
* @copyright Copyright (c) 2006-2009 Dennis Kreminsky, etranger at etranger dot ru
*/
/**
* Provides automatic loading for class files. A nice feature of PHP5.
*
* @package flamework
* @author Dennis Kreminsky, etranger at etranger dot ru
* @copyright Copyright (c) 2006-2009 Dennis Kreminsky, etranger at etranger dot ru
*/
error_reporting(E_ALL);
define('EXCEPTION_DB_MISCONFIG', 0x0001);
define('EXCEPTION_DB_ERROR', 0x0002);
define('EXCEPTION_DB_FAILURE', 0x0003);
define('EXCEPTION_ACCESS_DENIED', 0x0004);
define('EXCEPTION_MODULE_FAILURE', 0x0005);
define('EXCEPTION_MODULE_ERROR', 0x0006);
if (isset($_SERVER['HTTP_HOST']))
if(!@include_once dirname(__FILE__).'/../site-specific/'.strtolower($_SERVER['HTTP_HOST']).'.php')
if(!@include_once dirname(__FILE__).'/../site-specific/'.strtolower($_SERVER['SERVER_NAME']).'.php') {
header("Content-type: text/html; charset=utf8"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Системная ошибка.</title>
<style type="text/css">
<!--
html, body {width: 100%; margin:0; padding 0}
body {font-family: Arial, Helvetica, sans-serif; font-size:90%;}
#wrapper {width: 50%; margin: 5em auto 0 auto; background: #f0f0f0; padding: 0.5em}
#title {font-size: 100%; font-weight:bold; padding: 0.5em 0.2em 0.5em 0.2em; background: #ff0000; color:#ffffff}
#message {padding: 0.5em 0.2em 0.5em 0.2em}
#location {font-size: 80%;padding: 0.2em; color: #a0a0a0}
#report {width: 50%; font-size: 100%;margin: 1em auto 0 auto;padding: 0.3em 0.2em 0.3em 0.2em; color: #ffffff; font-weight: bold;background: #ff0000;}
#report a {color: #ffffff;}
#serverid {color: #a0a0a0;font-size: 80%;}
-->
</style>
</head>
<body>
<div id='wrapper'>
<div id='title'>Ошибка: невозможно найти файл конфигурации.</div>
<div id='message'>Невозможно открыть конфигурационный файл виртуального сервера. Пример минимальной конфигурации системы приведен ниже.
<?php
if(strtolower($_SERVER['HTTP_HOST'])!=strtolower($_SERVER['SERVER_NAME'])) {
print "<div>site-specific/".strtolower($_SERVER['HTTP_HOST']).".php,</div>";
print "<div>site-specific/".strtolower($_SERVER['SERVER_NAME']).".php:</div>";
}
else {
print "<div style='margin: 1em 0 0 0; font-size: 70%'>site-specific/".strtolower($_SERVER['SERVER_NAME']).".php:</div>";
}
?>
<pre>&lt;?php
class config extends defaultconfig {
const dbhost="&lt;database-host&gt;";
# const dbport="&lt;database-port&gt;";
const dbname="&lt;database-name&gt;";
const dbuser="&lt;database-user&gt;";
const dbpass="&lt;database-password&gt;";
const title="&lt;site title&gt;";
# relative to server document root
const XSLTStylesheet="site-specific/&lt;server-name&gt;/xsl/&lt;path-to-xslt-stylesheet&gt;";
# relative to server document root
const uploadPath="site-specific/&lt;server-name&gt;/upload";
# relative classes directory
const extraclasspath="site-specific/&lt;server-name&gt;/classes";
}
?&gt;</pre>
</div>
<div id='serverid'>Сервер: <?php print $_SERVER['SERVER_NAME']." (".$_SERVER['SERVER_ADDR']."), flamework:".version::major.".".version::minor.".".version::revision."."?></div>
</div>
</body>
</html>
<?php
die;
}
/*if(mb_strstr(config::locale, ',')) {
$l=array();
foreach(explode(',', config::locale) as $locale) {
if(setlocale(LC_ALL, trim($locale, ' ,'))!=false)
break;
}
}
else
setlocale(LC_ALL, config::locale);
*/
if(config::timezone)
date_default_timezone_set(config::timezone);
function getFolder($className) {
$array = explode('__', $className, -1);
if($array)
return $array[0].'/';
else
return null;
}
function __autoload($className) {
$filename = trim(getFolder($className).$className).'.class.php';
$fullname = dirname(__FILE__).'/'.$filename;
if(file_exists($fullname))
include_once $fullname;
else
if(config::classPath)
include_once dirname(__FILE__).'/../'.config::classPath.'/'.$filename;
}
// disabling the guard improves system response time slightly, but increases the debugging pain in case something goes wrong
if (!isset($_guard) && config::guard) {
$_flameworkGuard=new guard();
}
mb_internal_encoding(config::charset);
mb_regex_encoding(config::charset);
?>