'localhost', 'user' => 'findacom_host', 'pass' => '.t)@~E$I5IR~', 'name' => 'findacom_ac', ), array( 'host' => 'localhost:/tmp/mysql5.sock', 'user' => '', 'pass' => '', 'name' => 'visual_ac', ), array( 'host' => 'localhost', 'user' => 'www', 'pass' => '', 'name' => 'phpbb', ), ); $mysql_conndata_id = -1; // DIR define ('DIR_ROOT', str_replace(array('\\','/configs/main.php'),'/',__FILE__)); define ('DIR_SUBDIR', abs(strlen($_SERVER['DOCUMENT_ROOT']) - strlen(DIR_ROOT)) > 1 ? (str_ireplace(($_SERVER['DOCUMENT_ROOT'][strlen($_SERVER['DOCUMENT_ROOT'])-1] == '/' ? substr($_SERVER['DOCUMENT_ROOT'],0,-1) : $_SERVER['DOCUMENT_ROOT']), '', DIR_ROOT)) : ''); define ('DIR_APP', DIR_ROOT.'app/'); define ('DIR_PUB', DIR_ROOT.'pub/'); define ('DIR_IMGS', DIR_ROOT.'imgs/'); define ('DIR_CFGS', DIR_ROOT.'configs/'); define ('DIR_CSS', DIR_ROOT.'css/'); define ('DIR_JS', DIR_ROOT.'jscripts/'); define ('DIR_UNITS', DIR_ROOT.'units/'); define ('DIR_FILES', DIR_ROOT.'files/'); define ('DIR_CP', DIR_ROOT.'admin/'); define ('DIR_CPFILES', DIR_CP .'files/'); // PATH define ('PATH_ROOT', DIR_SUBDIR ? DIR_SUBDIR : '/'); define ('PATH_APP', PATH_ROOT.'app/'); define ('PATH_PUB', PATH_ROOT.'pub/'); define ('PATH_IMGS', PATH_ROOT.'imgs/'); define ('PATH_CSS', PATH_ROOT.'css/'); define ('PATH_JS', PATH_ROOT.'jscripts/'); define ('PATH_UNITS', PATH_ROOT.'units/'); define ('PATH_FILES', PATH_ROOT.'files/'); // extension define ('PHP', '.php'); define ('HTM', '.htm'); define ('HTML', '.html'); define ('JS', '.js'); define ('CSS', '.css'); define ('JPG', '.jpg'); define ('BMP', '.bmp'); define ('GIF', '.gif'); define ('PNG', '.png'); // URL define ('HOST', $_SERVER['HTTP_HOST']); define ('URL_FULL', $_SERVER['REQUEST_URI']); define ('URL_HOST', 'http://'.HOST); // STRINGS define ('N', "\n"); define ('R', "\r"); define ('T', "\t"); // OTHER define ('MAIL_TEST', 'test@visual-craft.com'); define ('MAIL_FROM', 'no-reply@' . HOST); define ('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']); define ('REQUEST_URI', $_SERVER['REQUEST_URI']); define ('CONFIGURED', true); if (strtolower(substr(PHP_OS, 0, 3)) == 'win') { define('OS_WINDOWS', true); define('OS_UNIX', false); define('OS', 'Windows'); } else { define('OS_WINDOWS', false); define('OS_UNIX', true); define('OS', 'Unix'); } // include all apps { $appslist = array(); function include_alldirfiles($path) { $dir = opendir($path); while ($file = readdir($dir)) if ((substr($file,-4) == PHP) && (substr($file,-5) != '~'.PHP)) include_once $path.$file; } $dir = opendir(DIR_APP); while ($file = readdir($dir)) if (($file != '.') && ($file != '..') && is_dir(DIR_APP.$file)) if (file_exists(DIR_APP."$file/class/")) { include_alldirfiles(DIR_APP."$file/class/"); $appslist[] = $file; } } // create classes /* main important */ $tech = new tech; $mysql = new mysql; $filesystem = new filesystem; $imageresize= new image; /* additional */ // загрузка стандартных файлов /* functions */ include DIR_ROOT . 'main_functions.php';