exit(JSON_Encode($Answer)); #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- exit(SPrintF($Result, $String, $String, $JBsErrorID, Date('Y', Time()))); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if (Set_Error_Handler('__Error_Handler__') === FALSE) { exit('Не удалось установить перехват ошибок'); } #******************************************************************************# # НАСТРОЙКА СРЕДЫ ВЫПОЛНЕНИЯ #******************************************************************************# $PATH = isset($_ENV['PATH']) ? $_ENV['PATH'] : ''; #------------------------------------------------------------------------------- $PATH = SPrintF('%s:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:%s:%s:%s', $PATH, SYSTEM_PATH, DirName(SYSTEM_PATH), DirName(DirName(SYSTEM_PATH))); #------------------------------------------------------------------------------- if (!PutENV(SPrintF('PATH=%s', $PATH))) { $GLOBALS['__MESSAGES'][] = '[JBs core]: не удалось установить переменную окружения PATH'; } #------------------------------------------------------------------------------- Debug(SPrintF('[JBs core]: PATH=(%s)', $PATH)); #-------------------------------------------------------------------------------
#echo $MySQLbin; } else { if (File_Exists('/usr/local/bin/mysql')) { $MySQLbin = '/usr/local/bin/mysql'; } elseif (File_Exists('/usr/bin/mysql')) { $MySQLbin = '/usr/bin/mysql'; } else { #echo 'mysql not found using $PATH, or /usr/local/bin/mysql, or /usr/bin/mysql'; #exit; $TestMySQL = array('Name' => 'Клиент MySQL', 'Status' => 'Не найден', 'IsOk' => FALSE); } } if (isset($MySQLbin)) { $TestMySQL = array('Name' => 'Клиент MySQL', 'Status' => $MySQLbin, 'IsOk' => TRUE); } Set_Error_Handler('__Error_Handler__'); Define('PHP_INI_PATH', 'php.ini'); $HostID = StrToLower(@$_SERVER['HTTP_HOST']); if (Preg_Match('/^www\\.(.+)$/', $HostID, $Mathces)) { $HostID = Next($Mathces); } if (Preg_Match('/^(.+)\\:[0-9]+$/', $HostID, $Mathces)) { $HostID = Next($Mathces); } Define('HOST_ID', $HostID); Define('SYSTEM_PATH', DirName(DirName(__FILE__))); Define('SETTINGS_FILE', SPrintF('%s/install.settings', SYSTEM_PATH)); Define('MY_CNF', SPrintF('%s/install.my.cnf', SYSTEM_PATH)); $__SETTINGS = array('db-server' => 'localhost', 'db-port' => '3306', 'db-type' => 'exists', 'db-root' => '', 'db-user' => 'jbs', 'db-password' => 'password', 'db-name' => 'jbs'); if (!isset($_GET['flush']) && File_Exists(SETTINGS_FILE)) { $__SETTINGS = @File_Get_Contents(SETTINGS_FILE);