<?php #------------------------------------------------------------------------------- $Folder = $_SERVER['DOCUMENT_ROOT']; #------------------------------------------------------------------------------- $Link = SPrintF('%s/styles', $Folder); #------------------------------------------------------------------------------- if (!File_Exists($Link)) { #----------------------------------------------------------------------------- if (!SymLink(SPrintF('%s/styles', SYSTEM_PATH), $Link)) { return ERROR | @Trigger_Error(500); } } #------------------------------------------------------------------------------- $HtAccess = IO_Read(SPrintF('%s/.htaccess', $Folder)); if (Is_Error($HtAccess)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $HtAccess = Str_Replace('Styles', 'styles', $HtAccess); #------------------------------------------------------------------------------- $IsWrite = IO_Write(SPrintF('%s/.htaccess', $Folder), $HtAccess, TRUE); if (Is_Error($IsWrite)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- @UnLink(SPrintF('%s/Styles', $Folder)); #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------
<?php #------------------------------------------------------------------------------- $Folder = $_SERVER['DOCUMENT_ROOT']; #------------------------------------------------------------------------------- $Link = SPrintF('%s/public', $Folder); #------------------------------------------------------------------------------- if (!File_Exists($Link)) { #----------------------------------------------------------------------------- $Tmp = System_Element('tmp'); if (Is_Error($Tmp)) { return ERROR | @Trigger_Error(500); } #----------------------------------------------------------------------------- if (!SymLink(SPrintF('%s/public', $Tmp), $Link)) { return ERROR | @Trigger_Error(500); } } #------------------------------------------------------------------------------- $HtAccess = IO_Read(SPrintF('%s/.htaccess', $Folder)); if (Is_Error($HtAccess)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $HtAccess = Str_Replace('(styles|index.php)', '(public|styles|index.php)', $HtAccess); #------------------------------------------------------------------------------- $IsWrite = IO_Write(SPrintF('%s/.htaccess', $Folder), $HtAccess, TRUE); if (Is_Error($IsWrite)) { return ERROR | @Trigger_Error(500); } #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- if (!File_Put_Contents($File, SPrintF("HostsIDs=%s\nmemcached.port=11211", Implode(',', $HostsIDs)))) { Error(SPrintF('Ошибка записи файла (%s)', $File)); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- $Link = SPrintF('%s/hosts/%s/tmp/public', SYSTEM_PATH, HOST_ID); #------------------------------------------------------------------------------- if (!File_Exists($Link)) { #------------------------------------------------------------------------------- if (!@MkDir($Link, 0755, TRUE)) { Error(SPrintF('Не возможно создать директорию (%s)', $Link)); } #------------------------------------------------------------------------------- if (!@SymLink(SPrintF('./hosts/%s/tmp/public', HOST_ID), './public')) { Error(SPrintF('Не возможно создать символическую ссылку (%s)', $Link)); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- if (File_Exists(SETTINGS_FILE)) { if (!@UnLink(SETTINGS_FILE)) { Error(SPrintF('Не возможно удалить файл (%s)', SETTINGS_FILE)); } } #------------------------------------------------------------------------------- if (!Count($__ERRORS)) { #------------------------------------------------------------------------------- $Files = array('INSTALL', 'install.settings', 'install.my.cnf', 'install/index.php', 'install'); #-------------------------------------------------------------------------------
} #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- $DataFolder = SPrintF('%s/WhatsApp', $Tmp); #------------------------------------------------------------------------------- $LogFile = SPrintF('%s/WhatsApp.%s.log', $DataFolder, Date('Y-m-d')); #------------------------------------------------------------------------------- if (!Is_Dir(SPrintF('%s/logs', $DataFolder))) { if (!MkDir(SPrintF('%s/logs', $DataFolder), 0750, true)) { return ERROR | @Trigger_Error(500); } } #------------------------------------------------------------------------------- if (!Is_Link($wadata)) { if (!SymLink($DataFolder, $wadata)) { return ERROR | @Trigger_Error(500); } } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $WhatsAppClient = new WhatsProt($Settings['Login'], $Settings['Params']['Sender'], FALSE, TRUE, $DataFolder); if (Is_Error($WhatsAppClient)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $WhatsAppClient->connect(); #------------------------------------------------------------------------------- $WhatsAppClient->loginWithPassword($Settings['Password']); #------------------------------------------------------------------------------- if (!File_Exists(SPrintF('%s/info.update.txt', $DataFolder))) {