ignore install

This commit is contained in:
Alexander Yakovlev 2017-02-17 14:12:06 +07:00
parent 86093d41ff
commit 50d6e96312
43 changed files with 1 additions and 25971 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ application/logs
uploads uploads
application/tmp application/tmp
application/plugins/admin application/plugins/admin
application/install

View File

@ -1,8 +0,0 @@
LiveStreet 2.0.0
Free social engine.
INSTALLATION
1. Copy files to the engine to the desired directory site
2. Go the address http://you_site/
3. Follow the instructions of the installer.

View File

@ -1,29 +0,0 @@
LiveStreet 2.0.0
Бесплатный движок блого-социальной сети.
УСТАНОВКА
1. Скопировать файлы движка в нужный каталог сайта
2. Зайти через браузер на ваш сайт ( http://ваш_сайт_на_ls/ ), автоматически запустится инсталлятор
3. Следовать инструкциям установщика.
ОБНОВЛЕНИЕ С ВЕРСИИ 1.0.3
0. ОБЯЗАТЕЛЬНО СДЕЛАЙТЕ РЕЗЕРВНЫЕ КОПИИ ВАШЕГО САЙТА И БАЗЫ ДАННЫХ
1. Обновить до версии 2.0.0 возможно только базу данных, поэтому копировать новую версию поверх старой НЕЛЬЗЯ, для установки используйте чистый каталог
2. Скопировать файлы движка в новый нужный каталог сайта
3. Скопировать в новый каталог (/application/config/) файл config.local.php от вашей старой версии 1.0 и скопировать каталог /uploads/ со всеми файлами. Обязательно дать права на запись в этот каталог и перезапись всех файлов.
4. Зайти через браузер на ваш сайт ( http://ваш_сайт_на_ls/ ), автоматически запустится инсталлятор
5. На первом шаге следует выбрать режим обновления сайта, далее следовать инструкциям установщика.
КОНФИГУРАЦИЯ И НАСТРОЙКА ДВИЖКА
Настройки находятся в файле /application/config/config.php. Для их изменения желательно переопределять эти настройки в файле config.local.php, это позволит избежать проблем при последующих обновлениях.
Управление плагинами находится по адресу /admin/plugins/
Для более удобного управления сайтом рекомендуем активировать плагин админ-панели (входит в комплект)
По всем вопросам обращайтесь на сайт русского комьюнити http://livestreet.ru
Официальный сайт проекта http://livestreetcms.com
Каталог плагинов и шаблонов https://catalog.livestreetcms.com

View File

@ -1,2 +0,0 @@
Order Deny,Allow
Deny from all

View File

@ -1,113 +0,0 @@
<?php
class InstallConfig
{
static public $sFileConfig = null;
static public $sLastError = null;
static public function save($mName, $mValue = null)
{
if (!self::checkFile()) {
return false;
}
if (is_array($mName)) {
$aValues = $mName;
} else {
$aValues = array($mName => $mValue);
}
$sContent = file_get_contents(self::$sFileConfig);
foreach ($aValues as $sName => $mValue) {
$sContent = self::_writeValue($sName, $mValue, $sContent);
}
file_put_contents(self::$sFileConfig, $sContent);
return true;
}
static public function get($sName, $mDefault = null)
{
if (!self::checkFile(false)) {
return $mDefault;
}
$aConfig = include(self::$sFileConfig);
if (strpos($sName, '.')) {
$sVal = $aConfig;
$aKeys = explode('.', $sName);
foreach ($aKeys as $k) {
if (isset($sVal[$k])) {
$sVal = $sVal[$k];
} else {
return $mDefault;
}
}
} else {
if (isset($aConfig[$sName])) {
$sVal = $aConfig[$sName];
} else {
return $mDefault;
}
}
return $sVal;
}
static public function _writeValue($sName, $mValue, $sContent)
{
$sName = '$config[\'' . implode('\'][\'', explode('.', $sName)) . '\']';
$mValue = self::_convertToConfigValue($mValue);
/**
* Если переменная уже определена в конфиге,
* то меняем значение.
*/
if (substr_count($sContent, $sName)) {
$sContent = preg_replace("~" . preg_quote($sName) . ".+;~Ui", $sName . ' = ' . $mValue . ';', $sContent);
} else {
$sContent = str_replace('return $config;', $sName . ' = ' . $mValue . ';' . PHP_EOL . 'return $config;',
$sContent);
}
return $sContent;
}
static public function _convertToConfigValue($mValue)
{
switch (true) {
case is_string($mValue):
return "'" . addslashes($mValue) . "'";
case is_bool($mValue):
return ($mValue) ? "true" : "false";
case is_array($mValue):
$sArrayString = "";
foreach ($mValue as $sKey => $sValue) {
$sArrayString .= "'{$sKey}'=>" . self::_convertToConfigValue($sValue) . ",";
}
return "array(" . $sArrayString . ")";
case is_numeric($mValue):
return $mValue;
default:
return "'" . (string)$mValue . "'";
}
}
static public function checkFile($bCheckWritable = true)
{
if (is_null(self::$sFileConfig) or !file_exists(self::$sFileConfig)) {
self::$sLastError = InstallCore::getLang('config.errors.file_not_found');
return false;
}
if ($bCheckWritable) {
if (!is_writable(self::$sFileConfig)) {
self::$sLastError = InstallCore::getLang('config.errors.file_not_writable');
return false;
}
}
return true;
}
}

View File

@ -1,420 +0,0 @@
<?php
class InstallCore
{
const COOKIE_NAME = 'install_data';
static public $aGroups = array();
static public $aGroupsParams = array();
static public $oLayout = null;
static public $aLangMsg = array();
static public $aStoredData = array();
public function __construct($aGroups)
{
if (!$aGroups) {
throw new Exception('Empty groups');
}
$this->defineGroups($aGroups);
$this->loadLang();
$this->loadStoredData();
self::$oLayout = new InstallTemplate('layout.tpl.php');
}
protected function defineGroups($aGroups)
{
$aGroupsResult = array();
$aParamsResult = array();
foreach ($aGroups as $sGroup => $aSteps) {
foreach ($aSteps as $sStep => $aParams) {
if (is_int($sStep)) {
$sStep = $aParams;
$aParams = array();
}
$aParamsResult[$sGroup][$sStep] = $aParams;
$aGroupsResult[$sGroup][] = $sStep;
}
}
self::$aGroups = $aGroupsResult;
self::$aGroupsParams = $aParamsResult;
}
/**
* Запускает процесс инсталляции
*/
public function run()
{
if (self::getRequest('reset')) {
self::$aStoredData = array();
self::saveStoredData();
}
/**
* Получаем текущую группу
*/
$sGroup = self::getRequestStr('group');
if ($sGroup) {
return $this->runGroup($sGroup);
}
/**
* Если группа не определена и она только одна - запускаем
*/
if (!$sGroup and count(self::$aGroups) == 1) {
$aGroupNames = array_keys(self::$aGroups);
return $this->runGroup(array_shift($aGroupNames));
}
/**
* Показываем страницу выбора группы
*/
self::setPreviousStepHide();
self::setNextStepHide();
self::setInstallResetHide();
self::render('index.tpl.php', array('groups' => array_keys(self::$aGroups)));
}
public function runGroup($sGroup)
{
if (!isset(self::$aGroups[$sGroup])) {
return self::renderError('Not found group');
}
$aGroup = self::$aGroups[$sGroup];
/**
* Определяем текущий шаг
* Смотрим его в куках, если там нет, то используем первый
* Шаг сквозной для всех групп, поэтому при установке у одной группы - у других он сбрасывается на первый
*/
$sCurrentStep = self::getStoredData('step');
if (!$sCurrentStep or !in_array($sCurrentStep, $aGroup)) {
if (!$sFirst = array_shift($aGroup)) {
return self::renderError('Not found steps');
}
$sCurrentStep = $sFirst;
}
$sNextStep = self::getNextStep($sGroup, $sCurrentStep);
$sPrevousStep = self::getPreviousStep($sGroup, $sCurrentStep);
if (!$sPrevousStep) {
}
if (!$sNextStep) {
self::setNextStepHide();
}
if (isset($_POST['action_previous'])) {
if ($sPrevousStep) {
InstallCore::setStoredData('step', $sPrevousStep);
InstallCore::location($sGroup);
} elseif (count(self::$aGroups) > 1) {
/**
* Перенаправлям на страницу выбора группы
*/
self::location();
}
}
return $this->runStep($sCurrentStep, $sGroup);
}
public function runStep($sStep, $sGroup)
{
$sClass = 'InstallStep' . ucfirst($sStep);
if (!class_exists($sClass)) {
return self::renderError('Not found step ' . $sStep);
}
$aParams = isset(self::$aGroupsParams[$sGroup][$sStep]) ? self::$aGroupsParams[$sGroup][$sStep] : array();
$oStep = new $sClass($sGroup, $aParams);
if (isset($_POST['action_next'])) {
/**
* Сначала обрабатываем шаг
*/
$oStep->_process();
}
$oStep->_show();
}
protected function loadLang()
{
$sLang = 'ru';
$sFilePath = INSTALL_DIR . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'i18n' . DIRECTORY_SEPARATOR . $sLang . '.php';
if (file_exists($sFilePath)) {
self::$aLangMsg = require($sFilePath);
}
}
protected function loadStoredData()
{
$aData = isset($_COOKIE[self::COOKIE_NAME]) ? $_COOKIE[self::COOKIE_NAME] : '';
if (get_magic_quotes_gpc()) {
$this->stripslashes($aData);
}
self::$aStoredData = $aData ? @unserialize($aData) : array();
}
static public function saveStoredData()
{
$sData = serialize(self::$aStoredData);
setcookie(self::COOKIE_NAME, $sData, time() + 60 * 60 * 24);
}
static public function getStoredData($sName, $mDefault = null)
{
return isset(self::$aStoredData[$sName]) ? self::$aStoredData[$sName] : $mDefault;
}
static public function setStoredData($sName, $mValue)
{
self::$aStoredData[$sName] = $mValue;
self::saveStoredData();
}
static public function getDataFilePath($sFile)
{
return dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . $sFile;
}
static public function renderError($sMsg, $sTitle = null)
{
self::render('error.tpl.php', array('msg' => $sMsg, 'title' => $sTitle));
}
static public function render($sTemplate, $aVars = array())
{
if (is_object($sTemplate)) {
$oTemplate = $sTemplate;
self::$oLayout->assign($aVars);
} else {
$oTemplate = new InstallTemplate($sTemplate, $aVars);
}
$oTemplate->setParent(self::$oLayout);
$sContent = $oTemplate->render();
self::$oLayout->assign('content', $sContent);
echo(self::$oLayout->render());
exit();
}
static public function assign($mName, $mValue = null)
{
self::$oLayout->assign($mName, $mValue);
}
static public function getRequest($sName, $mDefault = null)
{
$sName = str_replace('.', '_', $sName);
return isset($_REQUEST[$sName]) ? $_REQUEST[$sName] : $mDefault;
}
static public function getRequestStr($sName, $mDefault = null)
{
$sVal = self::getRequest($sName, $mDefault);
return is_scalar($sVal) ? (string)$sVal : '';
}
static public function getLang($sName)
{
if (strpos($sName, '.')) {
$sLang = self::$aLangMsg;
$aKeys = explode('.', $sName);
foreach ($aKeys as $k) {
if (isset($sLang[$k])) {
$sLang = $sLang[$k];
} else {
return $sName;
}
}
} else {
if (isset(self::$aLangMsg[$sName])) {
$sLang = self::$aLangMsg[$sName];
} else {
return $sName;
}
}
return $sLang;
}
static public function getNextStep($sGroup, $sStep = null)
{
$aGroups = self::$aGroups;
if (isset($aGroups[$sGroup])) {
if (is_null($sStep)) {
return array_shift($aGroups[$sGroup]);
} else {
if (false !== ($iPos = array_search($sStep, $aGroups[$sGroup]))) {
$aNext = array_slice($aGroups[$sGroup], $iPos + 1, 1);
$sNext = current($aNext);
return $sNext !== false ? $sNext : null;
}
}
} else {
return null;
}
}
static public function getPreviousStep($sGroup, $sStep = null)
{
$aGroups = self::$aGroups;
if (isset($aGroups[$sGroup])) {
if (is_null($sStep)) {
return array_shift($aGroups[$sGroup]);
} else {
if ($iPos = array_search($sStep, $aGroups[$sGroup])) {
$aPrev = array_slice($aGroups[$sGroup], $iPos - 1, 1);
$sPrev = current($aPrev);
return $sPrev !== false ? $sPrev : null;
}
}
} else {
return null;
}
}
static public function location($sGroup = '')
{
header('Location: ./' . ($sGroup ? '?group=' . $sGroup : ''));
exit;
}
static public function setInstallResetHide($bHide = true)
{
self::$oLayout->assign('install_reset_hide', $bHide);
}
static public function setNextStepHide($bHide = true)
{
self::$oLayout->assign('next_step_hide', $bHide);
}
static public function setNextStepDisable($bDisable = true)
{
self::$oLayout->assign('next_step_disable', $bDisable);
}
static public function setPreviousStepHide($bHide = true)
{
self::$oLayout->assign('previous_step_hide', $bHide);
}
static public function setPreviousStepDisable($bDisable = true)
{
self::$oLayout->assign('previous_step_disable', $bDisable);
}
protected function stripslashes(&$data)
{
if (is_array($data)) {
foreach ($data as $sKey => $value) {
if (is_array($value)) {
$this->stripslashes($data[$sKey]);
} else {
$data[$sKey] = stripslashes($value);
}
}
} else {
$data = stripslashes($data);
}
}
/**
* Выполняет транслитерацию текста
*
* @param $sText
* @param bool $bLower
* @return mixed|string
*/
static public function transliteration($sText, $bLower = true)
{
$aConverter = array(
'а' => 'a',
'б' => 'b',
'в' => 'v',
'г' => 'g',
'д' => 'd',
'е' => 'e',
'ё' => 'e',
'ж' => 'zh',
'з' => 'z',
'и' => 'i',
'й' => 'y',
'к' => 'k',
'л' => 'l',
'м' => 'm',
'н' => 'n',
'о' => 'o',
'п' => 'p',
'р' => 'r',
'с' => 's',
'т' => 't',
'у' => 'u',
'ф' => 'f',
'х' => 'h',
'ц' => 'c',
'ч' => 'ch',
'ш' => 'sh',
'щ' => 'sch',
'ь' => "'",
'ы' => 'y',
'ъ' => "'",
'э' => 'e',
'ю' => 'yu',
'я' => 'ya',
'А' => 'A',
'Б' => 'B',
'В' => 'V',
'Г' => 'G',
'Д' => 'D',
'Е' => 'E',
'Ё' => 'E',
'Ж' => 'Zh',
'З' => 'Z',
'И' => 'I',
'Й' => 'Y',
'К' => 'K',
'Л' => 'L',
'М' => 'M',
'Н' => 'N',
'О' => 'O',
'П' => 'P',
'Р' => 'R',
'С' => 'S',
'Т' => 'T',
'У' => 'U',
'Ф' => 'F',
'Х' => 'H',
'Ц' => 'C',
'Ч' => 'Ch',
'Ш' => 'Sh',
'Щ' => 'Sch',
'Ь' => "'",
'Ы' => 'Y',
'Ъ' => "'",
'Э' => 'E',
'Ю' => 'Yu',
'Я' => 'Ya',
" " => "-",
"." => "",
"/" => "-",
"_" => "-",
'і' => 'i',
'І' => 'I',
'ї' => 'i',
'Ї' => 'I',
'є' => 'e',
'Є' => 'E',
'ґ' => 'g',
'Ґ' => 'G',
'«' => '',
'»' => '',
);
$sRes = strtr($sText, $aConverter);
if ($sResIconv = @iconv("UTF-8", "ISO-8859-1//IGNORE//TRANSLIT", $sRes)) {
$sRes = $sResIconv;
}
$sRes = preg_replace('/[^A-Za-z0-9\-]/', '', $sRes);
$sRes = preg_replace('/\-{2,}/', '-', $sRes);
if ($bLower) {
$sRes = strtolower($sRes);
}
return $sRes;
}
}

View File

@ -1,357 +0,0 @@
<?php
abstract class InstallStep
{
protected $aParams = array();
protected $oTemplate = null;
protected $sGroup = null;
protected $aErrors = array();
protected $rDbLink = null;
protected $aDbParams = array();
public function __construct($sGroup, $aParams = array())
{
$this->aParams = array_merge($this->aParams, $aParams);
$this->oTemplate = new InstallTemplate($this->getTemplateName());
$this->sGroup = $sGroup;
$this->init();
}
public function init()
{
}
public function getParam($sName, $mDefault = null)
{
return array_key_exists($sName, $this->aParams) ? $this->aParams[$sName] : $mDefault;
}
protected function getTemplateName()
{
return 'steps/' . $this->getName() . '.tpl.php';
}
public function getErrors()
{
return $this->aErrors;
}
protected function addError($sMsg)
{
$this->aErrors[] = $sMsg;
return false;
}
public function getName()
{
$aPath = explode('_', install_func_underscore(get_class($this)));
array_shift($aPath);
array_shift($aPath);
$sName = ucfirst(install_func_camelize(join('_', $aPath)));
$sName{0} = strtolower($sName{0});
return $sName;
}
public function getStepTitle()
{
return InstallCore::getLang('steps.' . $this->getName() . '.title');
}
public function getGroupTitle()
{
return InstallCore::getLang('groups.' . $this->sGroup . '.title');
}
/**
* Выводит шаблон шага
*/
protected function render()
{
InstallCore::assign('currentStep', $this);
$this->oTemplate->assign('currentStep', $this);
InstallCore::render($this->oTemplate);
}
protected function assign($mName, $mValue = null)
{
$this->oTemplate->assign($mName, $mValue);
}
/**
* Запускает отображение шага
*/
public function _show()
{
if ($this->beforeShow()) {
$this->show();
$this->afterShow();
$this->render();
} else {
/**
* todo: нужно изменить - показываем только страницу с ошибкой
*/
return self::renderError('Вернитесь на прошлый шаг');
}
}
/**
* Запускает выполнение шага - когда пользователь жмет "Далее" на текущем шаге
*/
public function _process()
{
if ($this->beforeProcess()) {
if ($this->process()) {
$this->afterProcess();
/**
* Устанавливаем следующий шаг
*/
if ($sNextStep = InstallCore::getNextStep($this->sGroup, $this->getName())) {
InstallCore::setStoredData('step', $sNextStep);
}
/**
* Редиректим
*/
InstallCore::location($this->sGroup);
} else {
/**
* todo: здесь нужно показать сам текущий шаг с сообщением об ошибке
*/
//return InstallCore::renderError('Ошибка при выполнении шага');
}
} else {
/**
* todo: нужно изменить - показываем сам шаг с сообщением об ошибке
*/
//return InstallCore::renderError('Невозможно выполнить шаг');
}
}
protected function getDBConnection($sHost, $iPort, $sUser, $sPasswd, $bGeneral = false)
{
$oDb = @mysqli_connect($sHost, $sUser, $sPasswd, '', $iPort);
if ($oDb) {
/**
* Валидация версии MySQL сервера
*/
if (!version_compare(mysqli_get_server_info($oDb), '5.0.0', '>')) {
return $this->addError(InstallCore::getLang('db.errors.db_version'));
}
mysqli_query($oDb, 'set names utf8');
if ($bGeneral) {
$this->rDbLink = $oDb;
}
return $oDb;
}
return $this->addError(InstallCore::getLang('db.errors.db_connect'));
}
protected function setDbParams($aParams)
{
$this->aDbParams = $aParams;
}
protected function importDumpDB($oDb, $sFile, $aParams = null)
{
$sFileQuery = @file_get_contents($sFile);
if (is_null($aParams)) {
$aParams = $this->aDbParams;
}
if (isset($aParams['prefix'])) {
$sFileQuery = str_replace('prefix_', $aParams['prefix'], $sFileQuery);
}
$aQuery = preg_split("#;(\n|\r)#", $sFileQuery, null, PREG_SPLIT_NO_EMPTY);
/**
* Массив для сбора ошибок
*/
$aErrors = array();
if (isset($aParams['check_table'])) {
/**
* Смотрим, какие таблицы существуют в базе данных
*/
$aDbTables = array();
$aResult = @mysqli_query($oDb, "SHOW TABLES");
if (!$aResult) {
return array(
'result' => false,
'errors' => array($this->addError(InstallCore::getLang('db.errors.db_query')))
);
}
while ($aRow = mysqli_fetch_array($aResult, MYSQLI_NUM)) {
$aDbTables[] = $aRow[0];
}
/**
* Если среди таблиц БД уже есть нужная таблица, то выполнять SQL-дамп не нужно
*/
if (in_array($aParams['prefix'] . $aParams['check_table'], $aDbTables)) {
return array('result' => true, 'errors' => array());
}
}
/**
* Проверка на существование поля
*/
if (isset($aParams['check_table_field'])) {
list($sCheckTable, $sCheckField) = $aParams['check_table_field'];
$sCheckTable = str_replace('prefix_', $aParams['prefix'], $sCheckTable);
$aResult = @mysqli_query($oDb, "SHOW FIELDS FROM `{$sCheckTable}`");
if (!$aResult) {
return array(
'result' => false,
'errors' => array($this->addError(InstallCore::getLang('db.errors.db_query')))
);
}
while ($aRow = mysqli_fetch_assoc($aResult)) {
if ($aRow['Field'] == $sCheckField) {
return array('result' => true, 'errors' => array());
}
}
}
/**
* Выполняем запросы по очереди
*/
foreach ($aQuery as $sQuery) {
$sQuery = trim($sQuery);
/**
* Заменяем движек, если таковой указан в запросе
*/
if (isset($aParams['engine'])) {
$sQuery = str_ireplace('ENGINE=InnoDB', "ENGINE={$aParams['engine']}", $sQuery);
}
if ($sQuery != '') {
$bResult = mysqli_query($oDb, $sQuery);
if (!$bResult) {
$sError = mysqli_error($oDb);
if (isset($aParams['skip_fk_errors']) and $aParams['skip_fk_errors'] and
(stripos($sError, 'errno: 152') !== false or stripos($sError, 'errno: 150') !== false or (stripos($sError, '_fk') !== false and stripos($sError, 'DROP') !== false))
) {
// пропускаем ошибки связанные с внешними ключами
} else {
$aErrors[] = mysqli_error($oDb);
}
}
}
}
return array('result' => count($aErrors) ? false : true, 'errors' => $aErrors);
}
protected function dbCheckTable($sTable)
{
/**
* Смотрим, какие таблицы существуют в базе данных
*/
$aDbTables = array();
$aResult = @mysqli_query($this->rDbLink, "SHOW TABLES");
if (!$aResult) {
return false;
}
while ($aRow = mysqli_fetch_array($aResult, MYSQLI_NUM)) {
$aDbTables[] = $aRow[0];
}
/**
* Ищем необходимую таблицу
*/
$aParams = $this->aDbParams;
if (isset($aParams['prefix'])) {
$sTable = str_replace('prefix_', $aParams['prefix'], $sTable);
}
if (in_array($sTable, $aDbTables)) {
return true;
}
return false;
}
protected function dbQuery($sQuery)
{
$aParams = $this->aDbParams;
if (isset($aParams['prefix'])) {
$sQuery = str_replace('prefix_', $aParams['prefix'], $sQuery);
}
if (isset($aParams['engine'])) {
$sQuery = str_ireplace('ENGINE=InnoDB', "ENGINE={$aParams['engine']}", $sQuery);
}
if ($rResult = mysqli_query($this->rDbLink, $sQuery)) {
return $rResult;
}
$aErrors[] = mysqli_error($this->rDbLink);
return false;
}
protected function dbSelect($sQuery)
{
$aResult = array();
if ($rResult = $this->dbQuery($sQuery)) {
while ($aRow = mysqli_fetch_assoc($rResult)) {
$aResult[] = $aRow;
}
}
return $aResult;
}
protected function dbSelectOne($sQuery)
{
$aResult = $this->dbSelect($sQuery);
if ($aResult) {
$aRow = reset($aResult);
return $aRow;
}
return array();
}
protected function dbInsertQuery($sTable, $aFields, $bRun = true)
{
$aPath = array();
foreach ($aFields as $sFields => $sValue) {
if (is_int($sValue)) {
$aPath[] = "`{$sFields}` = " . $sValue;
} else {
$aPath[] = "`{$sFields}` = '" . mysqli_escape_string($this->rDbLink, $sValue) . "'";
}
}
$sQuery = "INSERT INTO {$sTable} SET " . join(', ', $aPath);
if ($bRun) {
if ($this->dbQuery($sQuery)) {
return mysqli_insert_id($this->rDbLink);
}
return false;
} else {
return $sQuery;
}
}
protected function beforeShow()
{
return true;
}
protected function afterShow()
{
}
protected function beforeProcess()
{
return true;
}
protected function afterProcess()
{
}
public function show()
{
}
public function process()
{
return true;
}
}

View File

@ -1,119 +0,0 @@
<?php
class InstallStepCheckRequirements extends InstallStep
{
public function show()
{
/**
* Проверяем требования
*/
$sAdditionalSolution = '';
$aRequirements = array();
if (!version_compare(PHP_VERSION, '5.5', '>=')) {
$aRequirements[] = array(
'name' => 'php_version',
'current' => PHP_VERSION
);
}
if (!in_array(strtolower(@ini_get('safe_mode')), array('0', 'off', ''))) {
$aRequirements[] = array(
'name' => 'safe_mode',
'current' => InstallCore::getLang('yes')
);
}
if (!@preg_match('//u', '')) {
$aRequirements[] = array(
'name' => 'utf8',
'current' => InstallCore::getLang('no')
);
}
if (!@extension_loaded('mbstring')) {
$aRequirements[] = array(
'name' => 'mbstring',
'current' => InstallCore::getLang('no')
);
}
if (!in_array(strtolower(@ini_get('mbstring.func_overload')), array('0', '4', 'no overload'))) {
$aRequirements[] = array(
'name' => 'mbstring_func_overload',
'current' => InstallCore::getLang('yes')
);
}
if (!@extension_loaded('SimpleXML')) {
$aRequirements[] = array(
'name' => 'xml',
'current' => InstallCore::getLang('no')
);
}
if (@extension_loaded('xdebug')) {
$iLevel = (int)@ini_get('xdebug.max_nesting_level');
if ($iLevel < 1000) {
$aRequirements[] = array(
'name' => 'xdebug',
'current' => InstallCore::getLang('yes') . " ({$iLevel})"
);
}
}
/**
* Права на запись файлов
*/
$bWriteSolutions = false;
$sAppDir = dirname(INSTALL_DIR);
$sDir = dirname($sAppDir) . DIRECTORY_SEPARATOR . 'uploads';
if (!is_dir($sDir) or !is_writable($sDir)) {
$aRequirements[] = array(
'name' => 'dir_uploads',
'current' => InstallCore::getLang('is_not_writable')
);
$bWriteSolutions = true;
}
$sDir = $sAppDir . DIRECTORY_SEPARATOR . 'plugins';
if (!is_dir($sDir) or !is_writable($sDir)) {
$aRequirements[] = array(
'name' => 'dir_plugins',
'current' => InstallCore::getLang('is_not_writable')
);
$bWriteSolutions = true;
}
$sDir = $sAppDir . DIRECTORY_SEPARATOR . 'tmp';
if (!is_dir($sDir) or !is_writable($sDir)) {
$aRequirements[] = array(
'name' => 'dir_tmp',
'current' => InstallCore::getLang('is_not_writable')
);
$bWriteSolutions = true;
}
$sDir = $sAppDir . DIRECTORY_SEPARATOR . 'logs';
if (!is_dir($sDir) or !is_writable($sDir)) {
$aRequirements[] = array(
'name' => 'dir_logs',
'current' => InstallCore::getLang('is_not_writable')
);
$bWriteSolutions = true;
}
$sFile = $sAppDir . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.local.php';
if (!is_file($sFile) or !is_writable($sFile)) {
$aRequirements[] = array(
'name' => 'file_config_local',
'current' => InstallCore::getLang('is_not_writable')
);
$bWriteSolutions = true;
}
if (count($aRequirements)) {
InstallCore::setNextStepDisable();
}
if ($bWriteSolutions) {
$sBuildPath = $sAppDir . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'build.sh';
$sAdditionalSolution .= '<b>' . InstallCore::getLang('steps.checkRequirements.writable_solution') . '</b><br/>';
$sAdditionalSolution .= '<i>chmod 0755 ' . $sBuildPath . '</i><br/>';
$sAdditionalSolution .= '<i>' . $sBuildPath . '</i><br/>';
}
$this->assign('requirements', $aRequirements);
$this->assign('additionalSolution', $sAdditionalSolution);
}
}

View File

@ -1,62 +0,0 @@
<?php
class InstallStepInstallAdmin extends InstallStep
{
/**
* Обработка отправки формы
*
* @return bool
*/
public function process()
{
/**
* Проверяем корректность емайла
*/
$sMail = InstallCore::getRequestStr('admin_mail');
if (!preg_match("/^[\da-z\_\-\.\+]+@[\da-z_\-\.]+\.[a-z]{2,5}$/i", $sMail)) {
return $this->addError(InstallCore::getLang('steps.installAdmin.errors.mail'));
}
/**
* Проверяем корректность пароль
*/
$sPasswd = InstallCore::getRequestStr('admin_passwd');
if (mb_strlen($sPasswd, 'UTF-8') < 3) {
return $this->addError(InstallCore::getLang('steps.installAdmin.errors.passwd'));
}
/**
* Получаем данные коннекта к БД из конфига
*/
InstallConfig::$sFileConfig = dirname(INSTALL_DIR) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.local.php';
/**
* Коннект к серверу БД
*/
if (!$oDb = $this->getDBConnection(InstallConfig::get('db.params.host'), InstallConfig::get('db.params.port'),
InstallConfig::get('db.params.user'), InstallConfig::get('db.params.pass'))
) {
return false;
}
/**
* Выбираем БД
*/
if (!@mysqli_select_db($oDb, InstallConfig::get('db.params.dbname'))) {
return $this->addError(InstallCore::getLang('db.errors.db_query'));
}
/**
* Обновляем пользователя
*/
$sPrefix = InstallConfig::get('db.table.prefix');
$sQuery = "
UPDATE `{$sPrefix}user`
SET
`user_mail` = '{$sMail}',
`user_admin` = '1',
`user_password` = '" . md5($sPasswd) . "'
WHERE `user_id` = 1";
if (!mysqli_query($oDb, $sQuery)) {
return $this->addError(InstallCore::getLang('db.errors.db_query'));
}
return true;
}
}

View File

@ -1,23 +0,0 @@
<?php
class InstallStepInstallComplete extends InstallStep
{
public function init()
{
InstallConfig::$sFileConfig = dirname(INSTALL_DIR) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.local.php';
}
public function show()
{
/**
* Прописываем параметры в конфиг
*/
$aSave = array(
'module.blog.encrypt' => md5(time() . mt_rand()),
'module.talk.encrypt' => md5(time() . mt_rand()),
'module.security.hash' => md5(time() . mt_rand()),
);
InstallConfig::save($aSave);
}
}

View File

@ -1,156 +0,0 @@
<?php
class InstallStepInstallDb extends InstallStep
{
protected $sConfigPath;
public function init()
{
$this->sConfigPath = dirname(INSTALL_DIR) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.local.php';
InstallConfig::$sFileConfig = $this->sConfigPath;
}
/**
* Получаем данные для загрузки на форму
* Возможные источники: реквест, конфиг, дефолтные значения
*
* @param $sName
* @param null $mDefault
* @param bool $bUseHtmlspecialchars
*
* @return mixed|null|string
*/
public function getValue($sName, $mDefault = null, $bUseHtmlspecialchars = true)
{
$mResult = null;
$sNameRequest = str_replace('.', '_', $sName);
if (isset($_REQUEST[$sNameRequest])) {
$mResult = $_REQUEST[$sNameRequest];
} else {
$mResult = InstallConfig::get($sName, $mDefault);
}
return $bUseHtmlspecialchars ? htmlspecialchars($mResult) : $mResult;
}
/**
* Обработка отправки формы
*
* @return bool
*/
public function process()
{
if (!$aRes = $this->processDbCheck()) {
return $aRes;
}
list($oDb, $sEngineDB) = $aRes;
/**
* Запускаем импорт дампов, сначала GEO DB
*/
list($bResult, $aErrors) = array_values($this->importDumpDB($oDb, InstallCore::getDataFilePath('sql/geo.sql'),
array(
'engine' => $sEngineDB,
'prefix' => InstallCore::getRequestStr('db.table.prefix'),
'check_table' => 'geo_city'
)));
if ($bResult) {
/**
* Запускаем основной дамп
*/
list($bResult, $aErrors) = array_values($this->importDumpDB($oDb,
InstallCore::getDataFilePath('sql/dump.sql'), array(
'engine' => $sEngineDB,
'prefix' => InstallCore::getRequestStr('db.table.prefix'),
'check_table' => 'topic'
)));
if ($bResult) {
return true;
}
}
return $this->addError(join('<br/>', $aErrors));
}
protected function processDbCheck()
{
/**
* Коннект к серверу БД
*/
if (!$oDb = $this->getDBConnection(InstallCore::getRequestStr('db.params.host'),
InstallCore::getRequestStr('db.params.port'), InstallCore::getRequestStr('db.params.user'),
InstallCore::getRequestStr('db.params.pass'))
) {
return false;
}
/**
* Выбор БД
*/
$sNameDb = InstallCore::getRequestStr('db.params.dbname');
if (!InstallCore::getRequest('db_create')) {
if (!@mysqli_select_db($oDb, $sNameDb)) {
return $this->addError(InstallCore::getLang('steps.installDb.errors.db_not_found'));
}
} else {
/**
* Пытаемся создать БД
*/
@mysqli_query($oDb,
"CREATE DATABASE IF NOT EXISTS `{$sNameDb}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
if (!@mysqli_select_db($oDb, $sNameDb)) {
return $this->addError(InstallCore::getLang('steps.installDb.errors.db_not_create'));
}
}
/**
* Проверяем корректность префикса таблиц
*/
if (!preg_match('#^[a-z0-9\_]*$#i', InstallCore::getRequestStr('db.table.prefix'))) {
return $this->addError(InstallCore::getLang('steps.installDb.errors.db_table_prefix'));
}
/**
* Определяем поддержку InnoDB
*/
$sEngineDB = 'MyISAM';
if ($aRes = @mysqli_query($oDb, 'SHOW ENGINES')) {
while ($aRow = mysqli_fetch_assoc($aRes)) {
if (strtoupper($aRow['Engine']) == 'INNODB' and in_array(strtoupper($aRow['Support']),
array('DEFAULT', 'YES'))
) {
$sEngineDB = 'InnoDB';
break;
}
}
}
$sPathRootWeb = $this->getPathRootWeb();
$aDirs = array();
$sDirs = trim(str_replace('http://' . $_SERVER['HTTP_HOST'], '', $sPathRootWeb), '/');
if ($sDirs != '') {
$aDirs = explode('/', $sDirs);
}
/**
* Прописываем параметры в конфиг
*/
$aSave = array(
'db.params.host' => InstallCore::getRequestStr('db.params.host'),
'db.params.port' => InstallCore::getRequestStr('db.params.port'),
'db.params.dbname' => InstallCore::getRequestStr('db.params.dbname'),
'db.params.user' => InstallCore::getRequestStr('db.params.user'),
'db.params.pass' => InstallCore::getRequestStr('db.params.pass'),
'db.table.prefix' => InstallCore::getRequestStr('db.table.prefix'),
'db.tables.engine' => $sEngineDB,
'path.root.web' => $sPathRootWeb,
'path.offset_request_url' => count($aDirs),
);
if (!InstallConfig::save($aSave)) {
return $this->addError(InstallConfig::$sLastError);
}
return array($oDb, $sEngineDB);
}
protected function getPathRootWeb()
{
$sPath = rtrim('http://' . $_SERVER['HTTP_HOST'], '/') . str_replace('/install/index.php', '',
$_SERVER['PHP_SELF']);
return preg_replace('#\/application$#', '', $sPath);
}
}

View File

@ -1,6 +0,0 @@
<?php
class InstallStepUpdateComplete extends InstallStepInstallComplete
{
}

View File

@ -1,32 +0,0 @@
<?php
class InstallStepUpdateDb extends InstallStepInstallDb
{
protected function getTemplateName()
{
/**
* Показываем шаблон настроек БД
*/
return 'steps/installDb.tpl.php';
}
public function show()
{
}
/**
* Обработка отправки формы
*
* @return bool
*/
public function process()
{
if (!$aRes = $this->processDbCheck()) {
return $aRes;
}
return true;
}
}

View File

@ -1,893 +0,0 @@
<?php
class InstallStepUpdateVersion extends InstallStep
{
protected $aVersionConvert = array(
'2.0.0',
'1.0.3',
);
public function init()
{
/**
* Получаем данные коннекта к БД из конфига
*/
InstallConfig::$sFileConfig = dirname(INSTALL_DIR) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.local.php';
}
public function show()
{
$this->assign('from_version', InstallCore::getStoredData('update_from_version'));
$this->assign('convert_versions', $this->aVersionConvert);
}
public function process()
{
set_time_limit(0);
/**
* Коннект к серверу БД
*/
if (!$oDb = $this->getDBConnection(InstallConfig::get('db.params.host'), InstallConfig::get('db.params.port'),
InstallConfig::get('db.params.user'), InstallConfig::get('db.params.pass'), true)
) {
return false;
}
/**
* Выбираем БД
*/
if (!@mysqli_select_db($oDb, InstallConfig::get('db.params.dbname'))) {
return $this->addError(InstallCore::getLang('db.errors.db_query'));
}
$this->setDbParams(array(
'prefix' => InstallConfig::get('db.table.prefix'),
'engine' => InstallConfig::get('db.tables.engine'),
));
$sVersion = InstallCore::getRequestStr('from_version');
/**
* Проверяем наличие конвертора
* Конвертор представляет собой отдельный метод вида converFrom_X1_Y1_Z1_to_X2_Y2_Z2
*/
$sMethod = 'convertFrom_' . str_replace('.', '_', $sVersion) . '_to_' . str_replace('.', '_', VERSION);
if (!method_exists($this, $sMethod)) {
return $this->addError(InstallCore::getLang('steps.updateVersion.errors.not_found_convert'));
}
InstallCore::setStoredData('update_from_version', $sVersion);
/**
* Запускаем конвертор
*/
return call_user_func_array(array($this, $sMethod), array($oDb));
}
/**
* Конвертор версии 2.0.0 в 2.0.1
*
* @param $oDb
*
* @return bool
*/
public function convertFrom_2_0_0_to_2_0_1($oDb)
{
/**
* Запускаем SQL патч
*/
$sFile = 'sql' . DIRECTORY_SEPARATOR . 'patch_2.0.0_to_2.0.1.sql';
list($bResult, $aErrors) = array_values($this->importDumpDB($oDb, InstallCore::getDataFilePath($sFile), array(
'engine' => InstallConfig::get('db.tables.engine'),
'prefix' => InstallConfig::get('db.table.prefix'),
'skip_fk_errors' => true
)));
if ($bResult) {
return true;
}
return $this->addError(join('<br/>', $aErrors));
}
/**
* Конвертор версии 1.0.3 в 2.0.0
*
* @param $oDb
*
* @return bool
*/
public function convertFrom_1_0_3_to_2_0_0($oDb)
{
/**
* Запускаем SQL патч
*/
$sFile = 'sql' . DIRECTORY_SEPARATOR . 'patch_1.0.3_to_2.0.0.sql';
list($bResult, $aErrors) = array_values($this->importDumpDB($oDb, InstallCore::getDataFilePath($sFile), array(
'engine' => InstallConfig::get('db.tables.engine'),
'prefix' => InstallConfig::get('db.table.prefix'),
'check_table' => 'cron_task',
'skip_fk_errors' => true
)));
if ($bResult) {
/**
* Проверяем необходимость конвертировать таблицу плагина Page
*/
if ($this->dbCheckTable("prefix_page")) {
$sFile = 'sql' . DIRECTORY_SEPARATOR . 'patch_page_1.3_to_2.0.sql';
list($bResult, $aErrors) = array_values($this->importDumpDB($oDb, InstallCore::getDataFilePath($sFile),
array(
'engine' => InstallConfig::get('db.tables.engine'),
'prefix' => InstallConfig::get('db.table.prefix'),
'check_table_field' => array('prefix_page', 'id'),
'skip_fk_errors' => true
)));
if (!$bResult) {
return $this->addError(join('<br/>', $aErrors));
}
}
/**
* Конвертируем опросы
* Сначала проверяем необходимость конвертации опросов
*/
if ($this->dbCheckTable("prefix_topic_question_vote")) {
$iPage = 1;
$iLimitCount = 50;
$iLimitStart = 0;
while ($aTopics = $this->dbSelect("SELECT t.*, c.topic_extra FROM prefix_topic as t, prefix_topic_content as c WHERE topic_type = 'question' and t.topic_id = c.topic_id LIMIT {$iLimitStart},{$iLimitCount}")) {
$iPage++;
$iLimitStart = ($iPage - 1) * $iLimitCount;
/**
* Топики
*/
foreach ($aTopics as $aTopic) {
$aPollData = @unserialize($aTopic['topic_extra']);
if (!isset($aPollData['answers'])) {
continue;
}
/**
* Создаем опрос
*/
$aFields = array(
'user_id' => $aTopic['user_id'],
'target_type' => 'topic',
'target_id' => $aTopic['topic_id'],
'title' => htmlspecialchars($aTopic['topic_title']),
'count_answer_max' => 1,
'count_vote' => isset($aPollData['count_vote']) ? $aPollData['count_vote'] : 0,
'count_abstain' => isset($aPollData['count_vote_abstain']) ? $aPollData['count_vote_abstain'] : 0,
'date_create' => $aTopic['topic_date_add'],
);
if ($iPollId = $this->dbInsertQuery('prefix_poll', $aFields)) {
foreach ($aPollData['answers'] as $iAnswerIdOld => $aAnswer) {
/**
* Создаем вариант ответа
*/
$aFields = array(
'poll_id' => $iPollId,
'title' => htmlspecialchars($aAnswer['text']),
'count_vote' => htmlspecialchars($aAnswer['count']),
'date_create' => $aTopic['topic_date_add'],
);
if ($iAnswerId = $this->dbInsertQuery('prefix_poll_answer', $aFields)) {
/**
* Получаем список кто голосовал за этот вариант
*/
if ($aVotes = $this->dbSelect("SELECT * FROM prefix_topic_question_vote WHERE topic_id = '{$aTopic['topic_id']}' AND answer = '{$iAnswerIdOld}' ")) {
foreach ($aVotes as $aVote) {
/**
* Добавляем новый факт голосования за вариант
*/
$aFields = array(
'poll_id' => $iPollId,
'user_id' => $aVote['user_voter_id'],
'answers' => serialize(array($iAnswerId)),
'date_create' => $aTopic['topic_date_add'],
);
$this->dbInsertQuery('prefix_poll_vote', $aFields);
}
}
}
}
/**
* Добавляем факты голосования воздержавшихся
*/
/**
* Получаем список кто голосовал за этот вариант
*/
if ($aVotes = $this->dbSelect("SELECT * FROM prefix_topic_question_vote WHERE topic_id = '{$aTopic['topic_id']}' AND answer = -1 ")) {
foreach ($aVotes as $aVote) {
/**
* Добавляем новый факт воздержания
*/
$aFields = array(
'poll_id' => $iPollId,
'user_id' => $aVote['user_voter_id'],
'answers' => serialize(array()),
'date_create' => $aTopic['topic_date_add'],
);
$this->dbInsertQuery('prefix_poll_vote', $aFields);
}
}
}
/**
* Меняем тип топика
*/
$this->dbQuery("UPDATE prefix_topic SET topic_type = 'topic' WHERE topic_id ='{$aTopic['topic_id']}'");
/**
* Убираем лишние данные из topic_extra
*/
unset($aPollData['answers']);
unset($aPollData['count_vote_abstain']);
unset($aPollData['count_vote']);
$sExtra = mysqli_escape_string($this->rDbLink, serialize($aPollData));
$this->dbQuery("UPDATE prefix_topic_content SET topic_extra = '{$sExtra}' WHERE topic_id ='{$aTopic['topic_id']}'");
}
}
/**
* Удаляем старые таблицы
*/
if (!$this->getErrors()) {
$this->dbQuery('DROP TABLE prefix_topic_question_vote');
}
}
/**
* Конвертируем топик-ссылки
*/
$iPage = 1;
$iLimitCount = 50;
$iLimitStart = 0;
while ($aTopics = $this->dbSelect("SELECT t.*, c.topic_extra, c.topic_text, c.topic_text_short, c.topic_text_source FROM prefix_topic as t, prefix_topic_content as c WHERE topic_type = 'link' and t.topic_id = c.topic_id LIMIT {$iLimitStart},{$iLimitCount}")) {
$iPage++;
$iLimitStart = ($iPage - 1) * $iLimitCount;
/**
* Топики
*/
foreach ($aTopics as $aTopic) {
$aData = @unserialize($aTopic['topic_extra']);
if (!isset($aData['url'])) {
continue;
}
/**
* Переносим ссылку в текст топика
*/
$sUrl = $aData['url'];
if (strpos($sUrl, '://') === false) {
$sUrl = 'http://' . $sUrl;
}
$sUrl = htmlspecialchars($sUrl);
$sTextAdd = "\n<br/><br/><a href=\"{$sUrl}\">{$sUrl}</a>";
$aTopic['topic_text'] .= $sTextAdd;
$aTopic['topic_text_short'] .= $sTextAdd;
$aTopic['topic_text_source'] .= $sTextAdd;
unset($aData['url']);
$sExtra = mysqli_escape_string($this->rDbLink, serialize($aData));
$sText = mysqli_escape_string($this->rDbLink, $aTopic['topic_text']);
$sTextShort = mysqli_escape_string($this->rDbLink, $aTopic['topic_text_short']);
$sTextSource = mysqli_escape_string($this->rDbLink, $aTopic['topic_text_source']);
$this->dbQuery("UPDATE prefix_topic_content SET topic_extra = '{$sExtra}', topic_text = '{$sText}', topic_text_short = '{$sTextShort}', topic_text_source = '{$sTextSource}' WHERE topic_id ='{$aTopic['topic_id']}'");
/**
* Меняем тип топика
*/
$this->dbQuery("UPDATE prefix_topic SET topic_type = 'topic' WHERE topic_id ='{$aTopic['topic_id']}'");
}
}
/**
* Конвертируем топик-фотосеты
*/
if ($this->dbCheckTable("prefix_topic_photo")) {
$iPage = 1;
$iLimitCount = 50;
$iLimitStart = 0;
while ($aTopics = $this->dbSelect("SELECT t.*, c.topic_extra, c.topic_text, c.topic_text_short, c.topic_text_source FROM prefix_topic as t, prefix_topic_content as c WHERE topic_type = 'photoset' and t.topic_id = c.topic_id LIMIT {$iLimitStart},{$iLimitCount}")) {
$iPage++;
$iLimitStart = ($iPage - 1) * $iLimitCount;
/**
* Топики
*/
foreach ($aTopics as $aTopic) {
$aData = @unserialize($aTopic['topic_extra']);
if (!isset($aData['main_photo_id'])) {
continue;
}
/**
* Получаем фото
*/
if ($aPhotos = $this->dbSelect("SELECT * FROM prefix_topic_photo WHERE topic_id = '{$aTopic['topic_id']}' ")) {
$aMediaItems = array();
foreach ($aPhotos as $aPhoto) {
/**
* Необходимо перенести изображение в media и присоеденить к топику
*/
$sFileSource = $this->convertPathWebToServer($aPhoto['path']);
/**
* Формируем список старых изображений для удаления
*/
$sMask = pathinfo($sFileSource,
PATHINFO_DIRNAME) . DIRECTORY_SEPARATOR . pathinfo($sFileSource,
PATHINFO_FILENAME) . '_*';
$aFilesForRemove = array();
if ($aPaths = glob($sMask)) {
foreach ($aPaths as $sPath) {
$aFilesForRemove[$sPath] = $sPath;
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
$iWidth = $oImage->getSize()->getWidth();
$iHeight = $oImage->getSize()->getHeight();
if ($this->resizeImage($oImage, 1000)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_1000x')) {
unset($aFilesForRemove[$sFileSave]);
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->resizeImage($oImage, 500)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_500x')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 100)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_100x100crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 50)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_50x50crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
/**
* Добавляем запись в медиа
*/
$aDataMedia = array(
'image_sizes' => array(
array(
'w' => 1000,
'h' => null,
'crop' => false,
),
array(
'w' => 500,
'h' => null,
'crop' => false,
),
array(
'w' => 100,
'h' => 100,
'crop' => true,
),
array(
'w' => 50,
'h' => 50,
'crop' => true,
),
),
);
if ($aPhoto['description']) {
$aDataMedia['title'] = htmlspecialchars($aPhoto['description']);
}
$aFields = array(
'user_id' => $aTopic['user_id'],
'type' => 1,
'target_type' => 'topic',
'file_path' => '[relative]' . str_replace(dirname(dirname(INSTALL_DIR)), '',
$sFileSource),
'file_name' => pathinfo($sFileSource, PATHINFO_FILENAME),
'file_size' => filesize($sFileSource),
'width' => $iWidth,
'height' => $iHeight,
'date_add' => $aTopic['topic_date_add'],
'data' => serialize($aDataMedia),
);
if ($iMediaId = $this->dbInsertQuery('prefix_media', $aFields)) {
/**
* Добавляем связь медиа с топиком
*/
$aFields = array(
'media_id' => $iMediaId,
'target_id' => $aTopic['topic_id'],
'target_type' => 'topic',
'date_add' => $aTopic['topic_date_add'],
'data' => '',
);
if ($iMediaTargetId = $this->dbInsertQuery('prefix_media_target', $aFields)) {
$sFileWeb = InstallConfig::get('path.root.web') . str_replace(dirname(dirname(INSTALL_DIR)),
'',
$sFileSource);
$aMediaItems[$iMediaId] = $sFileWeb;
}
}
/**
* Удаляем старые
*/
foreach ($aFilesForRemove as $sFileRemove) {
@unlink($sFileRemove);
}
}
}
/**
* Добавляем в начало текста топика вывод фотосета
*/
$sCodeRender = '';
$sCodeSource = '';
if ($aMediaItems) {
$sCodeSource = '<gallery items="' . join(',',
array_keys($aMediaItems)) . '" nav="thumbs" caption="1" />' . "\n";
$sCodeRender = '<div class="fotorama" data-nav="thumbs" >' . "\n";
foreach ($aMediaItems as $iId => $sFileWeb) {
$sCodeRender .= '<img src="' . $sFileWeb . '" />' . "\n";
}
$sCodeRender .= '</div>' . "\n";
}
unset($aData['main_photo_id']);
unset($aData['count_photo']);
$sExtra = mysqli_escape_string($this->rDbLink, serialize($aData));
$sText = mysqli_escape_string($this->rDbLink, $sCodeRender . $aTopic['topic_text']);
$sTextShort = mysqli_escape_string($this->rDbLink,
$sCodeRender . $aTopic['topic_text_short']);
$sTextSource = mysqli_escape_string($this->rDbLink,
$sCodeSource . $aTopic['topic_text_source']);
$this->dbQuery("UPDATE prefix_topic_content SET topic_extra = '{$sExtra}', topic_text = '{$sText}', topic_text_short = '{$sTextShort}', topic_text_source = '{$sTextSource}' WHERE topic_id ='{$aTopic['topic_id']}'");
/**
* Меняем тип топика
*/
$this->dbQuery("UPDATE prefix_topic SET topic_type = 'topic' WHERE topic_id ='{$aTopic['topic_id']}'");
}
}
}
/**
* Удаляем старые таблицы
*/
if (!$this->getErrors()) {
$this->dbQuery('DROP TABLE prefix_topic_photo');
}
}
/**
* Конвертируем урлы топиков к ЧПУ формату
*/
$iPage = 1;
$iLimitCount = 50;
$iLimitStart = 0;
while ($aTopics = $this->dbSelect("SELECT * FROM prefix_topic ORDER BY topic_id asc LIMIT {$iLimitStart},{$iLimitCount}")) {
$iPage++;
$iLimitStart = ($iPage - 1) * $iLimitCount;
/**
* Топики
*/
foreach ($aTopics as $aTopic) {
if ($aTopic['topic_slug']) {
continue;
}
$sSlug = InstallCore::transliteration($aTopic['topic_title']);
$sSlug = $this->GetUniqueTopicSlug($sSlug, $aTopic['topic_id']);
$sSlug = mysqli_escape_string($this->rDbLink, $sSlug);
/**
* Меняем тип топика
*/
$this->dbQuery("UPDATE prefix_topic SET topic_slug = '{$sSlug}' WHERE topic_id ='{$aTopic['topic_id']}'");
}
}
/**
* Конвертируем аватарки блогов
*/
$iPage = 1;
$iLimitCount = 50;
$iLimitStart = 0;
while ($aBlogs = $this->dbSelect("SELECT * FROM prefix_blog WHERE blog_avatar <> '' and blog_avatar <> '0' and blog_avatar IS NOT NULL LIMIT {$iLimitStart},{$iLimitCount}")) {
$iPage++;
$iLimitStart = ($iPage - 1) * $iLimitCount;
foreach ($aBlogs as $aBlog) {
$sAvatar = $aBlog['blog_avatar'];
if (strpos($sAvatar, 'http') === 0) {
$sAvatar = preg_replace('#_\d{1,3}x\d{1,3}(\.\w{3,5})$#i', '\\1', $sAvatar);
$sFileSource = $this->convertPathWebToServer($sAvatar);
/**
* Формируем список старых изображений для удаления
*/
$sMask = pathinfo($sFileSource,
PATHINFO_DIRNAME) . DIRECTORY_SEPARATOR . pathinfo($sFileSource,
PATHINFO_FILENAME) . '_[0-9]*';
$aFilesForRemove = array();
if ($aPaths = glob($sMask)) {
foreach ($aPaths as $sPath) {
$aFilesForRemove[$sPath] = $sPath;
}
}
/**
* Ресайзим к новым размерам
*/
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 500)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_500x500crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 100)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_100x100crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 64)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_64x64crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 48)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_48x48crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 24)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_24x24crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
/**
* Удаляем старые
*/
foreach ($aFilesForRemove as $sFileRemove) {
@unlink($sFileRemove);
}
/**
* Меняем путь до аватара
*/
$sAvatar = '[relative]' . str_replace(dirname(dirname(INSTALL_DIR)), '', $sFileSource);
$sAvatar = mysqli_escape_string($this->rDbLink, $sAvatar);
$this->dbQuery("UPDATE prefix_blog SET blog_avatar = '{$sAvatar}' WHERE blog_id ='{$aBlog['blog_id']}'");
}
}
}
}
/**
* Конвертируем аватарки и фото пользователей
* Дополнительно добавляем роль для прав
*/
/**
* Получаем текущий список админов
*/
$aUserAdmin = array();
if ($this->dbCheckTable("prefix_user_administrator")) {
if ($aAdmins = $this->dbSelect("SELECT * FROM prefix_user_administrator ")) {
foreach ($aAdmins as $aRow) {
$aUserAdmin[] = $aRow['user_id'];
}
}
}
$iPage = 1;
$iLimitCount = 50;
$iLimitStart = 0;
while ($aUsers = $this->dbSelect("SELECT * FROM prefix_user LIMIT {$iLimitStart},{$iLimitCount}")) {
$iPage++;
$iLimitStart = ($iPage - 1) * $iLimitCount;
foreach ($aUsers as $aUser) {
$sAvatar = $aUser['user_profile_avatar'];
$sPhoto = $aUser['user_profile_foto'];
/**
* Аватарки
*/
if (strpos($sAvatar, 'http') === 0) {
$sAvatar = preg_replace('#_\d{1,3}x\d{1,3}(\.\w{3,5})$#i', '\\1', $sAvatar);
$sFileSource = $this->convertPathWebToServer($sAvatar);
/**
* Формируем список старых изображений для удаления
*/
$sMask = pathinfo($sFileSource,
PATHINFO_DIRNAME) . DIRECTORY_SEPARATOR . pathinfo($sFileSource,
PATHINFO_FILENAME) . '_[0-9]*';
$aFilesForRemove = array();
if ($aPaths = glob($sMask)) {
foreach ($aPaths as $sPath) {
$aFilesForRemove[$sPath] = $sPath;
}
}
/**
* Ресайзим к новым размерам
*/
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 100)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_100x100crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 64)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_64x64crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 48)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_48x48crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
if ($oImage = $this->createImageObject($sFileSource)) {
if ($this->cropImage($oImage, 1) and $this->resizeImage($oImage, 24)) {
if ($sFileSave = $this->saveImage($oImage, $sFileSource, '_24x24crop')) {
unset($aFilesForRemove[$sFileSave]);
}
}
}
/**
* Удаляем старые
*/
foreach ($aFilesForRemove as $sFileRemove) {
@unlink($sFileRemove);
}
/**
* Меняем путь до аватара
*/
$sAvatar = '[relative]' . str_replace(dirname(dirname(INSTALL_DIR)), '', $sFileSource);
}
}
/**
* Фото
*/
if (strpos($sPhoto, 'http') === 0) {
$sFileSource = $this->convertPathWebToServer($sPhoto);
/**
* Меняем путь до аватара
*/
$sPhoto = '[relative]' . str_replace(dirname(dirname(INSTALL_DIR)), '', $sFileSource);
}
/**
* Права
*/
if (!$this->dbSelectOne("SELECT * FROM prefix_rbac_role_user WHERE user_id = '{$aUser['user_id']}' and role_id = 2 ")) {
/**
* Добавляем
*/
$aFields = array(
'user_id' => $aUser['user_id'],
'role_id' => 2,
'date_create' => date("Y-m-d H:i:s"),
);
$this->dbInsertQuery('prefix_rbac_role_user', $aFields);
}
/**
* Timezone
*/
$sTzName = null;
if ($aUser['user_settings_timezone']) {
$sTzName = $this->convertTzOffsetToName($aUser['user_settings_timezone']);
}
/**
* Реферальный код
*/
$sReferralCode = $aUser['user_referral_code'];
if (!$sReferralCode) {
$sReferralCode = md5($aUser['user_id'] . '_' . mt_rand());
}
/**
* Админы
*/
$isAdmin = 0;
if (in_array($aUser['user_id'], $aUserAdmin) or $aUser['user_admin']) {
$isAdmin = 1;
}
/**
* Сохраняем в БД
*/
$sAvatar = mysqli_escape_string($this->rDbLink, $sAvatar);
$sPhoto = mysqli_escape_string($this->rDbLink, $sPhoto);
$this->dbQuery("UPDATE prefix_user SET user_admin = '{$isAdmin}' , user_referral_code = '{$sReferralCode}' , user_settings_timezone = " . ($sTzName ? "'{$sTzName}'" : 'null') . " , user_profile_avatar = '{$sAvatar}', user_profile_foto = '{$sPhoto}' WHERE user_id ='{$aUser['user_id']}'");
/**
* Удаляем таблицы
*/
if ($this->dbCheckTable("prefix_user_administrator")) {
$this->dbQuery('DROP TABLE prefix_user_administrator');
}
}
}
if ($this->getErrors()) {
return $this->addError(join('<br/>', $aErrors));
}
return true;
}
return $this->addError(join('<br/>', $aErrors));
}
protected function convertTzOffsetToName($fOffset)
{
$fOffset *= 3600;
$aAbbrarray = DateTimeZone::listAbbreviations();
foreach ($aAbbrarray as $aAbbr) {
foreach ($aAbbr as $aCity) {
if ($aCity['offset'] == $fOffset && $aCity['timezone_id']) {
$oNow = new DateTime(null, new DateTimeZone($aCity['timezone_id']));
if ($oNow->getOffset() == $aCity['offset']) {
return $aCity['timezone_id'];
}
}
}
}
return false;
}
protected function convertPathWebToServer($sFile)
{
/**
* Конвертируем в серверный
*/
if (preg_match('#^http.*(\/uploads\/images\/.*)$#i', $sFile, $aMatch)) {
$sFile = dirname(dirname(INSTALL_DIR)) . str_replace('/', DIRECTORY_SEPARATOR, $aMatch[1]);
}
return $sFile;
}
protected function createImageObject($sFile)
{
try {
$oImagine = new \Imagine\Gd\Imagine;
return $oImagine->open($sFile);
} catch (Exception $e) {
$this->addError($e->getMessage());
return false;
}
}
protected function cropImage($oImage, $fProp, $sPosition = 'center')
{
try {
$oBox = $oImage->getSize();
$iWidth = $oBox->getWidth();
$iHeight = $oBox->getHeight();
/**
* Если высота и ширина уже в нужных пропорциях, то возвращаем изначальный вариант
*/
$iProp = round($fProp, 2);
if (round($iWidth / $iHeight, 2) == $iProp) {
return $this;
}
/**
* Вырезаем прямоугольник из центра
*/
if (round($iWidth / $iHeight, 2) <= $iProp) {
$iNewWidth = $iWidth;
$iNewHeight = round($iNewWidth / $iProp);
} else {
$iNewHeight = $iHeight;
$iNewWidth = $iNewHeight * $iProp;
}
$oBoxCrop = new Imagine\Image\Box($iNewWidth, $iNewHeight);
if ($sPosition == 'center') {
$oPointStart = new Imagine\Image\Point(($iWidth - $iNewWidth) / 2, ($iHeight - $iNewHeight) / 2);
} else {
$oPointStart = new Imagine\Image\Point(0, 0);
}
$oImage->crop($oPointStart, $oBoxCrop);
return true;
} catch (Exception $e) {
$this->addError($e->getMessage());
return false;
}
}
protected function resizeImage($oImage, $iWidthDest, $iHeightDest = null, $bForcedMinSize = true)
{
try {
$oBox = $oImage->getSize();
if ($bForcedMinSize) {
if ($iWidthDest and $iWidthDest > $oBox->getWidth()) {
$iWidthDest = $oBox->getWidth();
}
if ($iHeightDest and $iHeightDest > $oBox->getHeight()) {
$iHeightDest = $oBox->getHeight();
}
}
if (!$iHeightDest) {
/**
* Производим пропорциональное уменьшение по ширине
*/
$oBoxResize = $oBox->widen($iWidthDest);
} elseif (!$iWidthDest) {
/**
* Производим пропорциональное уменьшение по высоте
*/
$oBoxResize = $oBox->heighten($iHeightDest);
} else {
$oBoxResize = new Imagine\Image\Box($iWidthDest, $iHeightDest);
}
$oImage->resize($oBoxResize);
return true;
} catch (Exception $e) {
$this->addError($e->getMessage());
return false;
}
}
protected function saveImage($oImage, $sFileSource, $sFilePostfix)
{
$sDir = pathinfo($sFileSource, PATHINFO_DIRNAME);
$sName = pathinfo($sFileSource, PATHINFO_FILENAME);
$sFormat = pathinfo($sFileSource, PATHINFO_EXTENSION);
$sFile = $sDir . DIRECTORY_SEPARATOR . $sName . $sFilePostfix . '.' . $sFormat;
try {
$oImage->save($sFile, array(
'format' => $sFormat,
'quality' => 95,
));
return $sFile;
} catch (Exception $e) {
$this->addError($e->getMessage());
// TODO: fix exception for Gd driver
if (strpos($e->getFile(), 'Imagine' . DIRECTORY_SEPARATOR . 'Gd')) {
restore_error_handler();
}
return false;
}
}
protected function GetUniqueTopicSlug($sSlug, $iSkipTopicId = null)
{
$iPostfix = 0;
do {
$sUrl = $sSlug . ($iPostfix ? '-' . $iPostfix : '');
$iPostfix++;
} while (($aTopic = $this->getTopicBySlug($sUrl)) and (is_null($iSkipTopicId) or $iSkipTopicId != $aTopic['topic_id']));
return $sUrl;
}
protected function getTopicBySlug($sUrl)
{
$sUrl = mysqli_escape_string($this->rDbLink, $sUrl);
return $this->dbSelectOne("SELECT * FROM prefix_topic WHERE topic_slug = '{$sUrl}' ");
}
}

View File

@ -1,64 +0,0 @@
<?php
class InstallTemplate
{
protected $aVars = array();
protected $sTemplate = null;
protected $oParent = null;
public function __construct($sTemplate, $aVars = array())
{
$this->sTemplate = $sTemplate;
$this->assign($aVars);
}
public function assign($mName, $mValue = null)
{
if (is_array($mName)) {
$this->aVars = array_merge($this->aVars, $mName);
} else {
$this->aVars[$mName] = $mValue;
}
}
public function get($sName = null, $mDefault = null)
{
if (is_null($sName)) {
return $this->aVars;
}
return isset($this->aVars[$sName]) ? $this->aVars[$sName] : $mDefault;
}
public function getFromParent($sName = null, $mDefault = null)
{
if (!$this->oParent) {
return $mDefault;
}
return $this->oParent->get($sName, $mDefault);
}
public function render()
{
ob_start();
include($this->getPathTemplate());
$sResult = ob_get_contents();
ob_end_clean();
return $sResult;
}
public function setParent($oTemplate)
{
$this->oParent = $oTemplate;
}
public function lang($sName)
{
return InstallCore::getLang($sName);
}
protected function getPathTemplate()
{
return INSTALL_DIR . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $this->sTemplate;
}
}

View File

@ -1,71 +0,0 @@
<?php
define('INSTALL_DIR', dirname(__FILE__));
define('VERSION', '2.0.1');
function install_func_underscore($sStr)
{
return strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", $sStr));
}
function install_func_camelize($sStr)
{
$aParts = explode('_', $sStr);
$sCamelized = '';
foreach ($aParts as $sPart) {
$sCamelized .= ucfirst($sPart);
}
return $sCamelized;
}
/**
* Загрузка классов инсталлятора
* пример - InstallCore, InstallStepInit
*
* @param $sClassName
* @return bool
*/
function install_autoload($sClassName)
{
$aPath = explode('_', install_func_underscore($sClassName));
if (count($aPath) >= 2 and $aPath[0] == 'install') {
array_shift($aPath);
if ($aPath[0] == 'step' and count($aPath) > 1) {
array_shift($aPath);
$sDir = 'step';
$sName = ucfirst(install_func_camelize(join('_', $aPath)));
$sName{0} = strtolower($sName{0});
} else {
$sName = array_pop($aPath);
$sDir = join(DIRECTORY_SEPARATOR, $aPath);
}
$sPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'backend' . DIRECTORY_SEPARATOR . ($sDir ? $sDir . DIRECTORY_SEPARATOR : '') . $sName . '.php';
if (file_exists($sPath)) {
require_once($sPath);
return true;
}
}
/**
* Проверяем соответствие PSR-0 для библиотек фреймворка
*/
$sClassName = ltrim($sClassName, '\\');
$sFileName = '';
$sNameSpace = '';
if ($iLastNsPos = strrpos($sClassName, '\\')) {
$sNameSpace = substr($sClassName, 0, $iLastNsPos);
$sClassName = substr($sClassName, $iLastNsPos + 1);
$sFileName = str_replace('\\', DIRECTORY_SEPARATOR, $sNameSpace) . DIRECTORY_SEPARATOR;
}
$sFileName .= str_replace('_', DIRECTORY_SEPARATOR, $sClassName) . '.php';
$sFileName = dirname(dirname(INSTALL_DIR)) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'libs' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $sFileName;
if (file_exists($sFileName)) {
require_once($sFileName);
return true;
}
return false;
}
/**
* Подключаем загрузкик классов
*/
spl_autoload_register('install_autoload');

View File

@ -1,73 +0,0 @@
<?php
/**
* Консольный запуск шагов инсталляции
* Позволяет выполнить обновление на новую версию через консоль, это актуально при большой БД
* Запускать шаги желательно от имени пользователя под которым работает веб-сервер, это поможет избежать проблем с правами доступа.
*
* Пример запуска обновления с 1.0.3 версии LS до 2.0.0:
* php -f ./console.php run update_version 1.0.3
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_time_limit(0);
require_once('bootstrap.php');
function console_echo($sMsg, $bExit = false)
{
echo("{$sMsg} \n");
if ($bExit) {
exit();
}
}
/**
* Init core
*/
$oInstall = new InstallCore(array('fake' => array()));
/**
* Получаем параметры
*/
$aArgs = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
if (count($aArgs) == 1) {
console_echo(InstallCore::getLang('console.command_empty'), true);
}
/**
* Ищем команду
*/
$sCommand = strtolower($aArgs[1]);
if ($sCommand == 'run') {
if (!isset($aArgs[2])) {
console_echo(InstallCore::getLang('console.command.run.params_step_empty'), true);
}
$sStep = install_func_camelize($aArgs[2]);
$sClass = 'InstallStep' . ucfirst($sStep);
if (!class_exists($sClass)) {
console_echo(InstallCore::getLang('Not found step ' . $sStep), true);
}
/**
* Хардкодим параметр для шага обновления
* TODO: убрать и переделать на нормальную консольную утилиту
*/
$_REQUEST['from_version'] = isset($aArgs[3]) ? $aArgs[3] : '';
/**
* Создаем объект шага и запускаем его
*/
$oStep = new $sClass('fake', array());
if ($oStep->process()) {
console_echo(InstallCore::getLang('console.command_successful'));
} else {
$aErrors = $oStep->getErrors();
if ($aErrors) {
$sMsgError = join("\n", $aErrors);
} else {
$sMsgError = InstallCore::getLang('console.command_failed');
}
console_echo($sMsgError, true);
}
} else {
console_echo(InstallCore::getLang('console.command_empty'), true);
}

View File

@ -1,13 +0,0 @@
#!/bin/sh
DIRECTORY=$(cd "$(dirname "$0")"; pwd)
if [ ! -e "$DIRECTORY/../../config/config.local.php" ]; then
cp $DIRECTORY/../../config/config.local.php.dist $DIRECTORY/../../config/config.local.php
fi
chmod 777 $DIRECTORY/../../config/config.local.php
chmod 777 $DIRECTORY/../../tmp
chmod 777 $DIRECTORY/../../logs
chmod 777 $DIRECTORY/../../../uploads
chmod 777 $DIRECTORY/../../plugins

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,978 +0,0 @@
ALTER TABLE `prefix_subscribe` ADD `user_id` INT( 11 ) UNSIGNED NULL DEFAULT NULL AFTER `target_id` ,
ADD INDEX ( `user_id` ) ;
CREATE TABLE IF NOT EXISTS `prefix_blog_category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) DEFAULT NULL,
`title` varchar(200) NOT NULL,
`url` varchar(100) NOT NULL,
`url_full` varchar(200) NOT NULL,
`sort` int(11) NOT NULL DEFAULT '0',
`count_blogs` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `pid` (`pid`),
KEY `count_blogs` (`count_blogs`),
KEY `title` (`title`),
KEY `url` (`url`),
KEY `url_full` (`url_full`),
KEY `sort` (`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `prefix_blog_category`
ADD CONSTRAINT `prefix_blog_category_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `prefix_blog_category` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `prefix_blog` ADD `category_id` INT NULL DEFAULT NULL AFTER `user_owner_id` ,
ADD INDEX ( `category_id` ) ;
ALTER TABLE `prefix_blog` ADD FOREIGN KEY ( `category_id` ) REFERENCES `prefix_blog_category` (
`id`
) ON DELETE CASCADE ON UPDATE CASCADE ;
-- 01-10-2013
--
-- Структура таблицы `prefix_property`
--
CREATE TABLE IF NOT EXISTS `prefix_property` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`target_type` varchar(50) NOT NULL,
`type` enum('int','float','varchar','text','checkbox','select','tags','video_link') NOT NULL DEFAULT 'text',
`code` varchar(50) NOT NULL,
`title` varchar(250) NOT NULL,
`date_create` datetime NOT NULL,
`sort` int(11) NOT NULL,
`validate_rules` varchar(500) DEFAULT NULL,
`params` text,
PRIMARY KEY (`id`),
KEY `target_type` (`target_type`),
KEY `code` (`code`),
KEY `type` (`type`),
KEY `date_create` (`date_create`),
KEY `sort` (`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_property_value`
--
CREATE TABLE IF NOT EXISTS `prefix_property_value` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`property_id` int(11) NOT NULL,
`property_type` varchar(30) NOT NULL,
`target_type` varchar(50) NOT NULL,
`target_id` int(11) NOT NULL,
`value_int` int(11) DEFAULT NULL,
`value_float` float(11,2) DEFAULT NULL,
`value_varchar` varchar(250) DEFAULT NULL,
`value_text` text,
`data` text,
PRIMARY KEY (`id`),
KEY `property_id` (`property_id`),
KEY `target_type` (`target_type`),
KEY `target_id` (`target_id`),
KEY `value_int` (`value_int`),
KEY `property_type` (`property_type`),
KEY `value_float` (`value_float`),
KEY `value_varchar` (`value_varchar`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_property_value_tag`
--
CREATE TABLE IF NOT EXISTS `prefix_property_value_tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`property_id` int(11) NOT NULL,
`target_type` varchar(50) NOT NULL,
`target_id` int(11) NOT NULL,
`text` varchar(50) NOT NULL,
PRIMARY KEY (`id`),
KEY `target_type` (`target_type`),
KEY `target_id` (`target_id`),
KEY `text` (`text`),
KEY `property_id` (`property_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 29-10-2013
--
-- Структура таблицы `prefix_property_select`
--
CREATE TABLE IF NOT EXISTS `prefix_property_select` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`property_id` int(11) NOT NULL,
`target_type` varchar(50) NOT NULL,
`value` varchar(250) NOT NULL,
`sort` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `property_id` (`property_id`),
KEY `target_type` (`target_type`),
KEY `sort` (`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_property_value_select`
--
CREATE TABLE IF NOT EXISTS `prefix_property_value_select` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`property_id` int(11) NOT NULL,
`target_type` varchar(50) NOT NULL,
`target_id` int(11) NOT NULL,
`select_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `target_type` (`target_type`),
KEY `target_id` (`target_id`),
KEY `property_id` (`property_id`),
KEY `select_id` (`select_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `prefix_media` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`type` int(11) NOT NULL,
`file_path` varchar(500) NOT NULL,
`file_name` varchar(500) NOT NULL,
`file_size` int(11) NOT NULL,
`width` int(11) NOT NULL,
`height` int(11) NOT NULL,
`date_add` datetime NOT NULL,
`data` text NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `type` (`type`),
KEY `file_size` (`file_size`),
KEY `width` (`width`),
KEY `height` (`height`),
KEY `date_add` (`date_add`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_media_target`
--
CREATE TABLE IF NOT EXISTS `prefix_media_target` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`media_id` int(11) NOT NULL,
`target_id` int(11) DEFAULT NULL,
`target_type` varchar(50) NOT NULL,
`target_tmp` varchar(50) DEFAULT NULL,
`date_add` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `media_id` (`media_id`),
KEY `target_id` (`target_id`),
KEY `target_type` (`target_type`),
KEY `target_tmp` (`target_tmp`),
KEY `date_add` (`date_add`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Ограничения внешнего ключа сохраненных таблиц
--
--
-- Ограничения внешнего ключа таблицы `prefix_media_target`
--
ALTER TABLE `prefix_media_target`
ADD CONSTRAINT `prefix_media_target_ibfk_1` FOREIGN KEY (`media_id`) REFERENCES `prefix_media` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- 10-01-2014
ALTER TABLE `prefix_topic` CHANGE `topic_type` `topic_type` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'topic';
-- 11-01-2014
CREATE TABLE IF NOT EXISTS `prefix_topic_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(250) NOT NULL,
`name_many` varchar(250) NOT NULL,
`code` varchar(50) NOT NULL,
`allow_remove` tinyint(1) NOT NULL DEFAULT '0',
`date_create` datetime NOT NULL,
`state` tinyint(4) NOT NULL DEFAULT '1',
`params` text,
PRIMARY KEY (`id`),
KEY `code` (`code`),
KEY `state` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 12.01.2014
ALTER TABLE `prefix_topic_type` ADD `sort` INT NOT NULL DEFAULT '0' AFTER `state` ,
ADD INDEX ( `sort` ) ;
-- 12.01.2014
ALTER TABLE `prefix_property` ADD `description` VARCHAR( 500 ) NOT NULL AFTER `title` ;
-- 23.01.2014
--
-- Структура таблицы `prefix_property_target`
--
CREATE TABLE IF NOT EXISTS `prefix_property_target` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(50) NOT NULL,
`date_create` datetime NOT NULL,
`date_update` datetime DEFAULT NULL,
`state` tinyint(4) NOT NULL DEFAULT '1',
`params` text NOT NULL,
PRIMARY KEY (`id`),
KEY `type` (`type`),
KEY `date_create` (`date_create`),
KEY `date_update` (`date_update`),
KEY `state` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 25.01.2014
--
-- Структура таблицы `prefix_user_complaint`
--
CREATE TABLE IF NOT EXISTS `prefix_user_complaint` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`target_user_id` int(11) unsigned NOT NULL,
`user_id` int(11) unsigned NOT NULL,
`type` varchar(50) NOT NULL,
`text` text NOT NULL,
`date_add` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `target_user_id` (`target_user_id`),
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Ограничения внешнего ключа сохраненных таблиц
--
--
-- Ограничения внешнего ключа таблицы `prefix_user_complaint`
--
ALTER TABLE `prefix_user_complaint`
ADD CONSTRAINT `prefix_user_complaint_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `prefix_user_complaint_ibfk_1` FOREIGN KEY (`target_user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- 27.01.2014
--
-- Структура таблицы `prefix_rbac_permission`
--
CREATE TABLE IF NOT EXISTS `prefix_rbac_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(50) NOT NULL,
`title` varchar(250) NOT NULL,
`msg_error` varchar(250) NOT NULL,
`date_create` datetime NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `code` (`code`),
KEY `date_create` (`date_create`),
KEY `state` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_rbac_role`
--
CREATE TABLE IF NOT EXISTS `prefix_rbac_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) DEFAULT NULL,
`code` varchar(50) NOT NULL,
`title` varchar(250) NOT NULL,
`date_create` datetime NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `pid` (`pid`),
KEY `state` (`state`),
KEY `date_create` (`date_create`),
KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_rbac_role_permission`
--
CREATE TABLE IF NOT EXISTS `prefix_rbac_role_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`role_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
`date_create` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `role_id` (`role_id`),
KEY `permission_id` (`permission_id`),
KEY `date_create` (`date_create`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_rbac_user_role`
--
CREATE TABLE IF NOT EXISTS `prefix_rbac_user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL,
`role_id` int(11) NOT NULL,
`date_create` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `role_id` (`role_id`),
KEY `date_create` (`date_create`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Ограничения внешнего ключа сохраненных таблиц
--
--
-- Ограничения внешнего ключа таблицы `prefix_rbac_role_permission`
--
ALTER TABLE `prefix_rbac_role_permission`
ADD CONSTRAINT `prefix_rbac_role_permission_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `prefix_rbac_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ограничения внешнего ключа таблицы `prefix_rbac_user_role`
--
ALTER TABLE `prefix_rbac_user_role`
ADD CONSTRAINT `prefix_rbac_user_role_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `prefix_rbac_user_role_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `prefix_rbac_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- 28.01.2014
ALTER TABLE `prefix_user_complaint` ADD `state` TINYINT NOT NULL DEFAULT '1',
ADD INDEX ( `state` ) ;
-- 31.01.2014
--
-- Структура таблицы `prefix_storage`
--
CREATE TABLE IF NOT EXISTS `prefix_storage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(50) NOT NULL,
`value` mediumtext NOT NULL,
`instance` varchar(50) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `key_instance` (`key`,`instance`),
KEY `instance` (`instance`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Дамп данных таблицы `prefix_property_target`
--
INSERT INTO `prefix_property_target` ( `type`, `date_create`, `date_update`, `state`, `params`) VALUES
('topic_topic', '2014-01-31 12:01:34', NULL, 1, 'a:2:{s:6:"entity";s:23:"ModuleTopic_EntityTopic";s:4:"name";s:35:"Топик - Стандартный";}');
-- 04.02.2014
--
-- Структура таблицы `prefix_poll`
--
CREATE TABLE IF NOT EXISTS `prefix_poll` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`target_type` varchar(50) NOT NULL,
`target_id` int(11) DEFAULT NULL,
`target_tmp` varchar(50) DEFAULT NULL,
`title` varchar(500) NOT NULL,
`count_answer_max` tinyint(4) NOT NULL DEFAULT '1',
`count_vote` int(11) NOT NULL DEFAULT '0',
`count_abstain` int(11) NOT NULL DEFAULT '0',
`date_create` datetime NOT NULL,
`date_end` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `target_type_target_id` (`target_type`,`target_id`),
KEY `target_tmp` (`target_tmp`),
KEY `count_vote` (`count_vote`),
KEY `count_abstain` (`count_abstain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_poll_answer`
--
CREATE TABLE IF NOT EXISTS `prefix_poll_answer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`poll_id` int(11) NOT NULL,
`title` varchar(500) CHARACTER SET utf8 NOT NULL,
`count_vote` int(11) NOT NULL DEFAULT '0',
`date_create` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `poll_id` (`poll_id`),
KEY `count_vote` (`count_vote`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_poll_vote`
--
CREATE TABLE IF NOT EXISTS `prefix_poll_vote` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`poll_id` int(11) NOT NULL,
`answer_id` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`date_create` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `poll_id` (`poll_id`),
KEY `answer_id` (`answer_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Ограничения внешнего ключа сохраненных таблиц
--
--
-- Ограничения внешнего ключа таблицы `prefix_poll_answer`
--
ALTER TABLE `prefix_poll_answer`
ADD CONSTRAINT `prefix_poll_answer_ibfk_1` FOREIGN KEY (`poll_id`) REFERENCES `prefix_poll` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ограничения внешнего ключа таблицы `prefix_poll_vote`
--
ALTER TABLE `prefix_poll_vote`
ADD CONSTRAINT `prefix_poll_vote_ibfk_1` FOREIGN KEY (`poll_id`) REFERENCES `prefix_poll` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `prefix_poll_vote_ibfk_2` FOREIGN KEY (`answer_id`) REFERENCES `prefix_poll_answer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- 05.02.2014
ALTER TABLE `prefix_poll_vote` DROP FOREIGN KEY `prefix_poll_vote_ibfk_2` ;
ALTER TABLE `prefix_poll_vote` DROP `answer_id` ;
ALTER TABLE `prefix_poll_vote` ADD `answers` VARCHAR( 500 ) NOT NULL AFTER `user_id` ;
-- 11.02.2014
ALTER TABLE `prefix_property` CHANGE `type` `type` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'text';
ALTER TABLE `prefix_property_value` ADD `value_date` DATETIME NULL DEFAULT NULL AFTER `value_varchar` ,
ADD INDEX ( `value_date` ) ;
-- 17.02.2014
ALTER TABLE `prefix_media` ADD `target_type` VARCHAR( 50 ) NOT NULL AFTER `type` ,
ADD INDEX ( `target_type` ) ;
-- 21.03.2014
ALTER TABLE `prefix_media_target` ADD `is_preview` TINYINT( 1 ) NOT NULL DEFAULT '0',
ADD INDEX ( `is_preview` ) ;
ALTER TABLE `prefix_media_target` ADD `data` TEXT NOT NULL ;
-- 24.04.2014
ALTER TABLE `prefix_comment` ADD `comment_text_source` TEXT NOT NULL AFTER `comment_text` ;
ALTER TABLE `prefix_comment` ADD `comment_date_edit` DATETIME NULL DEFAULT NULL AFTER `comment_date` ,
ADD INDEX ( `comment_date_edit` ) ;
ALTER TABLE `prefix_comment` ADD `comment_count_edit` INT NOT NULL DEFAULT '0' AFTER `comment_count_favourite` ,
ADD INDEX ( `comment_count_edit` ) ;
-- 29.05.2014
UPDATE `prefix_stream_user_type` set `event_type`='vote_comment_topic' WHERE `event_type`='vote_comment';
UPDATE `prefix_stream_event` set `event_type`='vote_comment_topic' WHERE `event_type`='vote_comment';
-- 26.05.2014
--
-- Структура таблицы `prefix_category`
--
CREATE TABLE IF NOT EXISTS `prefix_category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) DEFAULT NULL,
`type_id` int(11) NOT NULL,
`title` varchar(250) NOT NULL,
`description` text NOT NULL,
`url` varchar(250) NOT NULL,
`url_full` varchar(250) NOT NULL,
`date_create` datetime NOT NULL,
`order` int(11) NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `pid` (`pid`),
KEY `title` (`title`),
KEY `order` (`order`),
KEY `state` (`state`),
KEY `url` (`url`),
KEY `url_full` (`url_full`),
KEY `type_id` (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_category_target`
--
CREATE TABLE IF NOT EXISTS `prefix_category_target` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`type_id` int(11) NOT NULL,
`target_type` varchar(50) NOT NULL,
`target_id` int(11) NOT NULL,
`date_create` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `target_type` (`target_type`),
KEY `target_id` (`target_id`),
KEY `category_id` (`category_id`),
KEY `type_id` (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Структура таблицы `prefix_category_type`
--
CREATE TABLE IF NOT EXISTS `prefix_category_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`target_type` varchar(50) NOT NULL,
`title` varchar(200) NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '1',
`date_create` datetime NOT NULL,
`date_update` datetime DEFAULT NULL,
`params` text NOT NULL,
PRIMARY KEY (`id`),
KEY `title` (`title`),
KEY `state` (`state`),
KEY `target_type` (`target_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 10.07.2014
ALTER TABLE `prefix_category` ADD `data` VARCHAR( 500 ) NOT NULL ;
ALTER TABLE `prefix_category` ADD `count_target` INT NOT NULL DEFAULT '0' AFTER `state` ,
ADD INDEX ( `count_target` ) ;
ALTER TABLE `prefix_blog_category` DROP FOREIGN KEY `prefix_blog_category_ibfk_1` ;
ALTER TABLE `prefix_blog` DROP FOREIGN KEY `prefix_blog_ibfk_1` ;
ALTER TABLE `prefix_blog` DROP `category_id` ;
DROP TABLE `prefix_blog_category`;
INSERT INTO `prefix_category_type` (
`id` ,
`target_type` ,
`title` ,
`state` ,
`date_create` ,
`date_update` ,
`params`
)
VALUES (
NULL , 'blog', 'Блоги', '1', '2014-07-14 00:00:00', NULL , ''
);
-- 22.07.2014
ALTER TABLE `prefix_topic` ADD `topic_date_edit_content` DATETIME NULL DEFAULT NULL AFTER `topic_date_edit` ,
ADD INDEX ( `topic_date_edit_content` ) ;
-- 23.07.2014
CREATE TABLE IF NOT EXISTS `prefix_cron_task` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(500) NOT NULL,
`method` varchar(500) NOT NULL,
`plugin` varchar(50) NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '1',
`count_run` int(11) NOT NULL DEFAULT '0',
`period_run` int(11) NOT NULL,
`date_create` datetime NOT NULL,
`date_run_last` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `count_run` (`count_run`),
KEY `state` (`state`),
KEY `plugin` (`plugin`),
KEY `method` (`method`(255)),
KEY `period_run` (`period_run`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 17.08.2014
INSERT INTO `prefix_cron_task` (`id`, `title`, `method`, `plugin`, `state`, `count_run`, `period_run`, `date_create`, `date_run_last`) VALUES (NULL, 'Отложенная отправка емайлов', 'Tools_SystemTaskNotify', '', '1', '0', '2', '2014-08-17 00:00:00', NULL);
INSERT INTO `prefix_cron_task` (`id`, `title`, `method`, `plugin`, `state`, `count_run`, `period_run`, `date_create`, `date_run_last`) VALUES (NULL, 'Удаление старого кеша данных', 'Cache_ClearOldCache', '', '1', '0', '1500', '2014-08-17 00:00:00', NULL);
-- 19.08.2014
ALTER TABLE `prefix_rbac_permission` ADD `plugin` VARCHAR( 50 ) NOT NULL AFTER `code` ,
ADD INDEX ( `plugin` );
CREATE TABLE IF NOT EXISTS `prefix_rbac_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(50) NOT NULL,
`title` varchar(250) NOT NULL,
PRIMARY KEY (`id`),
KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `prefix_rbac_role_permission` DROP FOREIGN KEY `prefix_rbac_role_permission_ibfk_1` ;
ALTER TABLE `prefix_rbac_user_role` DROP FOREIGN KEY `prefix_rbac_user_role_ibfk_2` ;
ALTER TABLE `prefix_rbac_user_role` DROP FOREIGN KEY `prefix_rbac_user_role_ibfk_1` ;
ALTER TABLE `prefix_rbac_permission` ADD `group_id` INT NULL DEFAULT NULL AFTER `id` ,
ADD INDEX ( `group_id` );
ALTER TABLE `prefix_rbac_group` ADD `date_create` DATETIME NOT NULL ;
RENAME TABLE `prefix_rbac_user_role` TO `prefix_rbac_role_user`;
-- 14.09.2014
CREATE TABLE IF NOT EXISTS `prefix_plugin_migration` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(50) NOT NULL,
`version` varchar(50) NOT NULL,
`date_create` datetime NOT NULL,
`file` varchar(500) NOT NULL,
PRIMARY KEY (`id`),
KEY `file` (`file`(255)),
KEY `code` (`code`),
KEY `version` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `prefix_plugin_version` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(50) NOT NULL,
`version` varchar(50) NOT NULL,
`date_update` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `code` (`code`),
KEY `version` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 07.12.2014
--
-- Дамп данных таблицы `prefix_rbac_group`
--
INSERT INTO `prefix_rbac_group` (`id`, `code`, `title`, `date_create`) VALUES
(1, 'topic', 'Топики', '2014-12-07 07:51:14'),
(2, 'blog', 'Блоги', '2014-12-07 07:51:41'),
(3, 'comment', 'Комментарии', '2014-12-07 07:52:01'),
(4, 'user', 'Пользователи', '2014-12-07 07:52:18');
--
-- Дамп данных таблицы `prefix_rbac_permission`
--
INSERT INTO `prefix_rbac_permission` (`id`, `group_id`, `code`, `plugin`, `title`, `msg_error`, `date_create`, `state`) VALUES
(1, 1, 'create_topic', '', 'rbac.permission.create_topic.title', 'rbac.permission.create_topic.error', '2014-08-31 07:59:56', 1),
(2, 2, 'create_blog', '', 'rbac.permission.create_blog.title', 'rbac.permission.create_blog.error', '2014-10-02 16:08:54', 1),
(3, 1, 'create_topic_comment', '', 'rbac.permission.create_topic_comment.title', 'rbac.permission.create_topic_comment.error', '2014-10-05 11:02:31', 1),
(4, 4, 'create_talk', '', 'rbac.permission.create_talk.title', 'rbac.permission.create_talk.error', '2014-10-05 11:54:22', 1),
(5, 4, 'create_talk_comment', '', 'rbac.permission.create_talk_comment.title', 'rbac.permission.create_talk_comment.error', '2014-10-05 14:08:15', 1),
(6, 3, 'vote_comment', '', 'rbac.permission.vote_comment.title', 'rbac.permission.vote_comment.error', '2014-10-05 14:31:29', 1),
(7, 2, 'vote_blog', '', 'rbac.permission.vote_blog.title', 'rbac.permission.vote_blog.error', '2014-10-05 16:51:53', 1),
(8, 1, 'vote_topic', '', 'rbac.permission.vote_topic.title', 'rbac.permission.vote_topic.error', '2014-10-05 17:22:56', 1),
(9, 4, 'vote_user', '', 'rbac.permission.vote_user.title', 'rbac.permission.vote_user.error', '2014-10-05 17:27:19', 1),
(10, 4, 'create_invite', '', 'rbac.permission.create_invite.title', 'rbac.permission.create_invite.error', '2014-10-05 17:28:46', 1),
(11, 3, 'create_comment_favourite', '', 'rbac.permission.create_comment_favourite.title', 'rbac.permission.create_comment_favourite.error', '2014-10-05 17:56:23', 1),
(12, 1, 'remove_topic', '', 'rbac.permission.remove_topic.title', 'rbac.permission.remove_topic.error', '2014-10-05 18:06:09', 1);
--
-- Дамп данных таблицы `prefix_rbac_role`
--
INSERT INTO `prefix_rbac_role` (`id`, `pid`, `code`, `title`, `date_create`, `state`) VALUES
(1, NULL, 'guest', 'Гость', '2014-08-22 00:00:00', 1),
(2, NULL, 'user', 'Пользователь', '2014-08-22 00:00:00', 1);
--
-- Дамп данных таблицы `prefix_rbac_role_permission`
--
INSERT INTO `prefix_rbac_role_permission` (`id`, `role_id`, `permission_id`, `date_create`) VALUES
(1, 2, 2, '2014-12-07 08:03:38'),
(2, 2, 7, '2014-12-07 08:03:44'),
(3, 2, 11, '2014-12-07 08:03:47'),
(4, 2, 6, '2014-12-07 08:03:49'),
(5, 2, 10, '2014-12-07 08:03:52'),
(6, 2, 4, '2014-12-07 08:03:55'),
(7, 2, 5, '2014-12-07 08:03:59'),
(8, 2, 9, '2014-12-07 08:04:02'),
(9, 2, 1, '2014-12-07 08:04:09'),
(10, 2, 3, '2014-12-07 08:04:11'),
(11, 2, 12, '2014-12-07 08:04:15'),
(12, 2, 8, '2014-12-07 08:04:17');
--
-- Дамп данных таблицы `prefix_rbac_role_user`
--
INSERT INTO `prefix_rbac_role_user` (`id`, `user_id`, `role_id`, `date_create`) VALUES
(1, 1, 2, '2014-12-07 08:06:11');
--
-- Дамп данных таблицы `prefix_topic_type`
--
INSERT INTO `prefix_topic_type` (`id`, `name`, `name_many`, `code`, `allow_remove`, `date_create`, `state`, `sort`, `params`) VALUES
(1, 'Топик', 'Топики', 'topic', 0, '2014-01-11 00:00:00', 1, 0, 'a:3:{s:10:"allow_poll";b:1;s:10:"allow_text";b:1;s:10:"allow_tags";b:1;}');
-- 17.12.2014
ALTER TABLE `prefix_user` CHANGE `user_settings_timezone` `user_settings_timezone` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `prefix_user` ADD `user_admin` TINYINT(1) NOT NULL DEFAULT '0' AFTER `user_mail`, ADD INDEX (`user_admin`) ;
-- 27.12.2014
ALTER TABLE `prefix_session` DROP FOREIGN KEY `prefix_session_fk`;
ALTER TABLE `prefix_session` DROP INDEX user_id;
ALTER TABLE `prefix_session` ADD INDEX(`user_id`);
ALTER TABLE `prefix_session` ADD `session_date_close` DATETIME NULL DEFAULT NULL , ADD INDEX (`session_date_close`) ;
-- 28.12.2014
ALTER TABLE `prefix_blog` CHANGE `blog_type` `blog_type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'personal';
ALTER TABLE `prefix_comment` CHANGE `target_type` `target_type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'topic';
ALTER TABLE `prefix_comment_online` CHANGE `target_type` `target_type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'topic';
ALTER TABLE `prefix_favourite` CHANGE `target_type` `target_type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'topic';
ALTER TABLE `prefix_favourite_tag` CHANGE `target_type` `target_type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_user` CHANGE `user_profile_sex` `user_profile_sex` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'other';
ALTER TABLE `prefix_vote` CHANGE `target_type` `target_type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'topic';
ALTER TABLE `prefix_blog` DROP FOREIGN KEY `prefix_blog_fk`;
ALTER TABLE `prefix_blog_user` DROP FOREIGN KEY `prefix_blog_user_fk`;
ALTER TABLE `prefix_blog_user` DROP FOREIGN KEY `prefix_blog_user_fk1`;
ALTER TABLE `prefix_comment` DROP FOREIGN KEY `prefix_topic_comment_fk`;
ALTER TABLE `prefix_comment` DROP FOREIGN KEY `topic_comment_fk1`;
ALTER TABLE `prefix_comment_online` DROP FOREIGN KEY `prefix_topic_comment_online_fk1`;
ALTER TABLE `prefix_favourite` DROP FOREIGN KEY `prefix_favourite_target_fk`;
ALTER TABLE `prefix_favourite_tag` DROP FOREIGN KEY `prefix_favourite_tag_ibfk_1`;
ALTER TABLE `prefix_friend` DROP FOREIGN KEY `prefix_friend_from_fk`;
ALTER TABLE `prefix_friend` DROP FOREIGN KEY `prefix_friend_to_fk`;
ALTER TABLE `prefix_geo_city` DROP FOREIGN KEY `prefix_geo_city_ibfk_1`;
ALTER TABLE `prefix_geo_city` DROP FOREIGN KEY `prefix_geo_city_ibfk_2`;
ALTER TABLE `prefix_geo_region` DROP FOREIGN KEY `prefix_geo_region_ibfk_1`;
ALTER TABLE `prefix_geo_target` DROP FOREIGN KEY `prefix_geo_target_ibfk_1`;
ALTER TABLE `prefix_geo_target` DROP FOREIGN KEY `prefix_geo_target_ibfk_2`;
ALTER TABLE `prefix_geo_target` DROP FOREIGN KEY `prefix_geo_target_ibfk_3`;
ALTER TABLE `prefix_invite` DROP FOREIGN KEY `prefix_invite_fk`;
ALTER TABLE `prefix_invite` DROP FOREIGN KEY `prefix_invite_fk1`;
ALTER TABLE `prefix_media_target` DROP FOREIGN KEY `prefix_media_target_ibfk_1`;
ALTER TABLE `prefix_poll_answer` DROP FOREIGN KEY `prefix_poll_answer_ibfk_1`;
ALTER TABLE `prefix_poll_vote` DROP FOREIGN KEY `prefix_poll_vote_ibfk_1`;
ALTER TABLE `prefix_reminder` DROP FOREIGN KEY `prefix_reminder_fk`;
ALTER TABLE `prefix_stream_event` DROP FOREIGN KEY `prefix_stream_event_ibfk_1`;
ALTER TABLE `prefix_stream_subscribe` DROP FOREIGN KEY `prefix_stream_subscribe_ibfk_1`;
ALTER TABLE `prefix_stream_user_type` DROP FOREIGN KEY `prefix_stream_user_type_ibfk_1`;
ALTER TABLE `prefix_talk` DROP FOREIGN KEY `prefix_talk_fk`;
ALTER TABLE `prefix_talk_blacklist` DROP FOREIGN KEY `prefix_talk_blacklist_fk_user`;
ALTER TABLE `prefix_talk_blacklist` DROP FOREIGN KEY `prefix_talk_blacklist_fk_target`;
ALTER TABLE `prefix_talk_user` DROP FOREIGN KEY `prefix_talk_user_fk`;
ALTER TABLE `prefix_talk_user` DROP FOREIGN KEY `prefix_talk_user_fk1`;
ALTER TABLE `prefix_topic` DROP FOREIGN KEY `prefix_topic_fk`;
ALTER TABLE `prefix_topic` DROP FOREIGN KEY `prefix_topic_fk1`;
ALTER TABLE `prefix_topic_content` DROP FOREIGN KEY `prefix_topic_content_fk`;
ALTER TABLE `prefix_topic_read` DROP FOREIGN KEY `prefix_topic_read_fk`;
ALTER TABLE `prefix_topic_read` DROP FOREIGN KEY `prefix_topic_read_fk1`;
ALTER TABLE `prefix_topic_tag` DROP FOREIGN KEY `prefix_topic_tag_fk`;
ALTER TABLE `prefix_topic_tag` DROP FOREIGN KEY `prefix_topic_tag_fk1`;
ALTER TABLE `prefix_topic_tag` DROP FOREIGN KEY `prefix_topic_tag_fk2`;
ALTER TABLE `prefix_userfeed_subscribe` DROP FOREIGN KEY `prefix_userfeed_subscribe_ibfk_1`;
ALTER TABLE `prefix_user_changemail` DROP FOREIGN KEY `prefix_user_changemail_ibfk_1`;
ALTER TABLE `prefix_user_complaint` DROP FOREIGN KEY `prefix_user_complaint_ibfk_1`;
ALTER TABLE `prefix_user_complaint` DROP FOREIGN KEY `prefix_user_complaint_ibfk_2`;
ALTER TABLE `prefix_user_field_value` DROP FOREIGN KEY `prefix_user_field_value_ibfk_1`;
ALTER TABLE `prefix_user_field_value` DROP FOREIGN KEY `prefix_user_field_value_ibfk_2`;
ALTER TABLE `prefix_user_note` DROP FOREIGN KEY `prefix_user_note_ibfk_1`;
ALTER TABLE `prefix_user_note` DROP FOREIGN KEY `prefix_user_note_ibfk_2`;
ALTER TABLE `prefix_vote` DROP FOREIGN KEY `prefix_topic_vote_fk1`;
ALTER TABLE `prefix_wall` DROP FOREIGN KEY `prefix_wall_ibfk_1`;
ALTER TABLE `prefix_wall` DROP FOREIGN KEY `prefix_wall_ibfk_2`;
ALTER TABLE `prefix_comment` CHANGE `comment_user_ip` `comment_user_ip` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_session` CHANGE `session_ip_create` `session_ip_create` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_session` CHANGE `session_ip_last` `session_ip_last` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_subscribe` CHANGE `ip` `ip` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_talk` CHANGE `talk_user_ip` `talk_user_ip` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_topic` CHANGE `topic_user_ip` `topic_user_ip` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_user` CHANGE `user_ip_register` `user_ip_register` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_vote` CHANGE `vote_ip` `vote_ip` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
ALTER TABLE `prefix_wall` CHANGE `ip` `ip` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_topic` ADD `topic_skip_index` TINYINT(1) NOT NULL DEFAULT '0' AFTER `topic_publish_index`, ADD INDEX (`topic_skip_index`) ;
-- 30.12.2014
ALTER TABLE `prefix_topic` ADD `blog_id2` INT UNSIGNED NULL DEFAULT NULL AFTER `blog_id`, ADD `blog_id3` INT UNSIGNED NULL DEFAULT NULL AFTER `blog_id2`, ADD `blog_id4` INT UNSIGNED NULL DEFAULT NULL AFTER `blog_id3`, ADD `blog_id5` INT UNSIGNED NULL DEFAULT NULL AFTER `blog_id4`;
ALTER TABLE `prefix_topic` ADD INDEX(`blog_id2`);
ALTER TABLE `prefix_topic` ADD INDEX(`blog_id3`);
ALTER TABLE `prefix_topic` ADD INDEX(`blog_id4`);
ALTER TABLE `prefix_topic` ADD INDEX(`blog_id5`);
-- 10.02.2015
ALTER TABLE `prefix_session` ADD `session_extra` TEXT NULL ;
-- 26.02.2015
ALTER TABLE `prefix_poll` ADD `is_guest_allow` TINYINT(1) NOT NULL DEFAULT '0' AFTER `title`, ADD `is_guest_check_ip` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_guest_allow`;
ALTER TABLE `prefix_poll_vote` ADD `guest_key` VARCHAR(32) NULL AFTER `user_id`, ADD `ip` VARCHAR(40) NOT NULL AFTER `guest_key`, ADD INDEX (`guest_key`) ;
ALTER TABLE `prefix_poll_vote` ADD INDEX(`ip`);
ALTER TABLE `prefix_poll_vote` CHANGE `user_id` `user_id` INT(11) NULL DEFAULT NULL;
-- 27.02.2015
DROP TABLE `prefix_invite`;
ALTER TABLE `prefix_user` ADD `user_referal_code` VARCHAR(32) NULL DEFAULT NULL AFTER `user_activate_key`, ADD INDEX (`user_referal_code`) ;
CREATE TABLE IF NOT EXISTS `prefix_invite_code` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`code` varchar(32) NOT NULL,
`date_create` datetime NOT NULL,
`date_expired` datetime DEFAULT NULL,
`count_allow_use` int(11) NOT NULL DEFAULT '1',
`count_use` int(11) NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `prefix_invite_use` (
`id` int(11) NOT NULL,
`type` tinyint(4) NOT NULL DEFAULT '1',
`code_id` int(11) DEFAULT NULL,
`from_user_id` int(11) DEFAULT NULL,
`to_user_id` int(11) NOT NULL,
`date_create` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
ALTER TABLE `prefix_invite_code`
ADD PRIMARY KEY (`id`), ADD KEY `code` (`code`), ADD KEY `count_allow_use` (`count_allow_use`), ADD KEY `count_use` (`count_use`), ADD KEY `active` (`active`), ADD KEY `date_create` (`date_create`), ADD KEY `user_id` (`user_id`);
ALTER TABLE `prefix_invite_use`
ADD PRIMARY KEY (`id`), ADD KEY `type` (`type`), ADD KEY `code_id` (`code_id`), ADD KEY `from_user_id` (`from_user_id`), ADD KEY `to_user_id` (`to_user_id`);
-- 07.03.2015
ALTER TABLE `prefix_user` CHANGE `user_referal_code` `user_referral_code` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
-- 17.03.2015
ALTER TABLE `prefix_topic` ADD `topic_slug` VARCHAR(500) NOT NULL DEFAULT '' AFTER `topic_title`, ADD INDEX (`topic_slug`) ;
-- 27.03.2015
ALTER TABLE `prefix_topic` ADD `topic_date_publish` DATETIME NOT NULL AFTER `topic_date_edit_content`, ADD INDEX (`topic_date_publish`) ;
UPDATE `prefix_topic` SET `topic_date_publish` = `topic_date_add`;
-- 09.09.2015
ALTER TABLE `prefix_blog` ADD `blog_skip_index` TINYINT(1) NOT NULL DEFAULT '0' , ADD INDEX (`blog_skip_index`) ;
-- 30.09.2016
ALTER TABLE `prefix_subscribe` CHANGE `target_type` `target_type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `prefix_subscribe` CHANGE `target_id` `target_id` VARCHAR(50) NULL DEFAULT NULL;
ALTER TABLE `prefix_property` CHANGE `sort` `sort` INT(11) NOT NULL DEFAULT '0';
ALTER TABLE `prefix_property` CHANGE `description` `description` VARCHAR(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `prefix_property_target` CHANGE `params` `params` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `prefix_rbac_permission` CHANGE `msg_error` `msg_error` VARCHAR(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `prefix_category` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_category` CHANGE `type_id` `type_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_category` CHANGE `pid` `pid` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_category_target` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_category_target` CHANGE `category_id` `category_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_category_target` CHANGE `type_id` `type_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_category_type` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_cron_task` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_geo_city` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_geo_city` CHANGE `country_id` `country_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_geo_city` CHANGE `region_id` `region_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_geo_country` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_geo_region` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_geo_region` CHANGE `country_id` `country_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_geo_target` CHANGE `geo_id` `geo_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_geo_target` CHANGE `country_id` `country_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_geo_target` CHANGE `region_id` `region_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_geo_target` CHANGE `city_id` `city_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_invite_code` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_invite_code` CHANGE `user_id` `user_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_invite_use` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_invite_use` CHANGE `code_id` `code_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_invite_use` CHANGE `from_user_id` `from_user_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_invite_use` CHANGE `to_user_id` `to_user_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_media` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_media` CHANGE `user_id` `user_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_media_target` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_media_target` CHANGE `media_id` `media_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_plugin_migration` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_plugin_version` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_poll` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_poll` CHANGE `user_id` `user_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_poll_answer` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_poll_answer` CHANGE `poll_id` `poll_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_poll_vote` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_poll_vote` CHANGE `poll_id` `poll_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_poll_vote` CHANGE `user_id` `user_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_property` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_property_select` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_property_select` CHANGE `property_id` `property_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_property_target` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_property_value` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_property_value` CHANGE `property_id` `property_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_property_value_select` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_property_value_select` CHANGE `property_id` `property_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_property_value_select` CHANGE `select_id` `select_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_property_value_tag` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_property_value_tag` CHANGE `property_id` `property_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_rbac_group` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_rbac_permission` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_rbac_permission` CHANGE `group_id` `group_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_rbac_role` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_rbac_role` CHANGE `pid` `pid` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_rbac_role_permission` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_rbac_role_permission` CHANGE `role_id` `role_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_rbac_role_permission` CHANGE `permission_id` `permission_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_rbac_role_user` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_rbac_role_user` CHANGE `role_id` `role_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_storage` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_stream_event` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_stream_subscribe` CHANGE `target_user_id` `target_user_id` INT(11) UNSIGNED NOT NULL;
ALTER TABLE `prefix_subscribe` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_talk_user` CHANGE `comment_id_last` `comment_id_last` INT(11) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `prefix_topic_type` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_user_changemail` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_user_complaint` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_user_field` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_user_field_value` CHANGE `field_id` `field_id` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_user_note` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_wall` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_wall` CHANGE `pid` `pid` INT(11) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE `prefix_invite_code` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `prefix_invite_use` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
-- 12.10.2016
ALTER TABLE `prefix_session` CHANGE `session_date_create` `session_date_create` DATETIME NULL DEFAULT NULL;
ALTER TABLE `prefix_reminder` CHANGE `reminder_date_used` `reminder_date_used` DATETIME NULL DEFAULT NULL;
-- 27.01.2017
ALTER TABLE `prefix_notify_task` ADD `notify_text_alt` TEXT NULL DEFAULT NULL AFTER `notify_text`;
-- 28.01.2017
ALTER TABLE `prefix_user` CHANGE `user_mail` `user_mail` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
-- 30.01.2017
ALTER TABLE `prefix_cron_task` ADD `time_start` TIME NULL DEFAULT NULL AFTER `date_run_last`, ADD INDEX (`time_start`);
ALTER TABLE `prefix_cron_task` ADD `time_end` TIME NULL DEFAULT NULL AFTER `time_start`, ADD INDEX (`time_end`);

View File

@ -1,2 +0,0 @@
-- 01.02.2017
ALTER TABLE `prefix_user` CHANGE `user_password` `user_password` VARCHAR(255) NOT NULL;

View File

@ -1,16 +0,0 @@
ALTER TABLE `prefix_page` CHANGE `page_id` `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ;
ALTER TABLE `prefix_page` CHANGE `page_pid` `pid` INT( 11 ) UNSIGNED NULL DEFAULT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_url` `url` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_url_full` `url_full` VARCHAR( 254 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_title` `title` VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_text` `text` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_date_add` `date_add` DATETIME NOT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_date_edit` `date_edit` DATETIME NULL DEFAULT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_seo_keywords` `seo_keywords` VARCHAR( 250 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_seo_description` `seo_description` VARCHAR( 250 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_active` `active` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
ALTER TABLE `prefix_page` CHANGE `page_main` `main` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `prefix_page` CHANGE `page_sort` `sort` INT( 11 ) NOT NULL ;
ALTER TABLE `prefix_page` CHANGE `page_auto_br` `auto_br` TINYINT( 1 ) NOT NULL DEFAULT '1';
ALTER TABLE `prefix_page` ADD `text_source` TEXT NULL DEFAULT NULL AFTER `text`;
UPDATE `prefix_page` SET text_source = text;

View File

@ -1,159 +0,0 @@
<?php
return array(
'groups' => array(
'install' => array(
'title' => 'Новая установка',
'description' => '',
),
'update' => array(
'title' => 'Обновление со старой версии',
'description' => '',
),
),
'steps' => array(
'checkRequirements' => array(
'title' => 'Проверка требований для установки',
'writable_solution' => 'Для быстрого исправления ошибки с правами на запись выполните в консоли вашего сервера:',
'requirements' => array(
'php_version' => array(
'title' => 'Версия PHP',
'solution' => 'Минимально допустимая версия PHP 5.5. Обратитесь к хостингу для обновления версии.',
),
'safe_mode' => array(
'title' => 'SAFE MODE',
'solution' => 'Для корректной работы необходимо отключить SAFE MODE. Обратитесь к хостингу.',
),
'utf8' => array(
'title' => 'Поддержка UTF-8',
'solution' => 'Для корректной работы необходима поддержка UTF-8. Обратитесь к хостингу.',
),
'mbstring' => array(
'title' => 'Поддержка многобайтовых строк',
'solution' => 'Для корректной работы необходимо расширение mbstring. Обратитесь к хостингу.',
),
'mbstring_func_overload' => array(
'title' => 'Режим перегрузки строковых функций (func_overload)',
'solution' => 'Для корректной работы необходимо отключить перегрузку строковых функций. Обратитесь к хостингу.',
),
'xml' => array(
'title' => 'Поддержка XML (SimpleXML)',
'solution' => 'Для корректной работы необходимо расширение SimpleXML. Обратитесь к хостингу.',
),
'xdebug' => array(
'title' => 'Использование Xdebug',
'solution' => 'Для корректной работы необходимо отключить Xdebug или повысить значение <b>xdebug.max_nesting_level</b> до 1000. Обратитесь к хостингу.',
),
'dir_uploads' => array(
'title' => 'Каталог /uploads',
'solution' => '',
),
'dir_plugins' => array(
'title' => 'Каталог /application/plugins',
'solution' => '',
),
'dir_tmp' => array(
'title' => 'Каталог /application/tmp',
'solution' => '',
),
'dir_logs' => array(
'title' => 'Каталог /application/logs',
'solution' => '',
),
'file_config_local' => array(
'title' => 'Файл /application/config/config.local.php',
'solution' => 'Необходимо переименовать файл config.local.php.dist в config.local.php и дать ему права на запись',
),
),
),
'installDb' => array(
'title' => 'Настройка базы данных',
'form' => array(
'db_host' => array(
'title' => 'Имя сервера БД'
),
'db_port' => array(
'title' => 'Порт сервера БД'
),
'db_name' => array(
'title' => 'Название БД'
),
'db_create' => array(
'title' => 'Автоматически создать БД'
),
'db_user' => array(
'title' => 'Пользователь БД'
),
'db_passwd' => array(
'title' => 'Пароль от пользователя БД'
),
'db_prefix' => array(
'title' => 'Префикс таблиц в БД'
),
),
'errors' => array(
'db_not_found' => 'Не удалось выбрать необходимую базу данных, проверьте имя базы данных',
'db_not_create' => 'Не удалось создать базу данных, проверьте права доступа к БД',
'db_table_prefix' => 'Неверный формат префикс таблиц, допустимы только латински буквы, цифры и знак "_"',
),
),
'installAdmin' => array(
'title' => 'Данные администратора сайта',
'form' => array(
'mail' => array(
'title' => 'E-mail'
),
'passwd' => array(
'title' => 'Пароль'
),
),
'errors' => array(
'mail' => 'Неверный формат e-mail адреса',
'passwd' => 'Пароль должен быть от 3-х символов',
),
),
'installComplete' => array(
'title' => 'Установка завершена!',
),
'updateVersion' => array(
'title' => 'Выбор текущей версии',
'errors' => array(
'not_found_convert' => 'Для данной версии нет возможности обновления',
),
),
'updateDb' => array(
'title' => 'Настройка базы данных',
),
'updateComplete' => array(
'title' => 'Обновление успешно завершено!',
),
),
'config' => array(
'errors' => array(
'file_not_found' => 'Файл конфига не найден',
'file_not_writable' => 'Файл конфига не доступен для записи',
),
),
'db' => array(
'errors' => array(
'db_connect' => 'Не удалось установить соединение с БД. Проверьте параметры подключения к БД.',
'db_version' => 'Версия сервера БД должна быть от 5.0.0',
'db_query' => 'Не удалось выполнить запрос к БД',
),
),
'console' => array(
'command_empty' => 'Необходимо указать команду. Сейчас поддерживается только команда "run"',
'command_successful' => 'Команда успешно выполнена',
'command_failed' => 'Не удалось выполнить команду',
'command' => array(
'run' => array(
'params_step_empty' => 'Необходимо указать параметр: название шага',
'params_version_empty' => 'Необходимо указать параметр: номер текущей версии',
)
),
),
'install_reset' => 'Начать сначала',
'yes' => 'Да',
'no' => 'Нет',
'is_not_writable' => 'Не доступен для записи',
);

View File

@ -1,70 +0,0 @@
/**
* Уведомления
*
* @module ls/alerts
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
.alert {
position: relative;
border: 1px solid #eed3d7;
background-color: #f2dede;
color: #b94a48;
padding: 10px 15px;
margin-bottom: 15px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.alert:last-child {
margin-bottom: 0;
}
.alert li {
margin-bottom: 5px;
}
/* Заголовок */
.alert-title {
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
}
/**
* @modifier error Ошибка
*/
.alert.alert--error {
background-color: #f2dede;
color: #b94a48;
border-color: #eed3d7;
}
/**
* @modifier success Успешно завершено
*/
.alert.alert--success {
background-color: #dff0d8;
color: #468847;
border-color: #d6e9c6;
}
/**
* @modifier info Информация
*/
.alert.alert--info {
background-color: #d9edf7;
color: #3a87ad;
border-color: #bce8f1;
}
/**
* @modifier empty Пусто
*/
.alert.alert--empty {
background-color: #fafafa;
color: #777;
border-color: #eee;
}

View File

@ -1,82 +0,0 @@
/**
* Buttons
*
* @module ls/button
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
.button {
display: inline-block;
padding: 7px 13px;
margin: 0;
border: 1px solid #ddd;
text-align: center;
vertical-align: middle;
text-decoration: none;
font-size: 13px;
line-height: normal;
color: #444;
background: transparent;
font-family: Arial, sans-serif;
cursor: pointer;
position: relative;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: background .2s, color .2s;
-moz-transition: background .2s, color .2s;
transition: background .2s, color .2s;
}
.button:hover { text-decoration: none; background: #fafafa; color: #333; }
.button:active {
position: relative;
top: 1px;
}
.button:focus { outline: none; }
.button.active {
background: #eaeaea;
}
.button.pull-right { margin-left: 5px; }
/**
* Button Disabled
*/
.button.disabled,
.button.disabled:hover,
.button[disabled],
.button[disabled]:hover {
border-color: #ccc;
background: #eee;
color: #999;
}
.button.disabled:active,
.button[disabled]:active {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/**
* Button Primary
*/
.button--primary { border-color: #74A2FF; color: #777DFF; }
.button--primary:hover { background: #91B6FF; color: #fff; }
.button--primary.active { background: #006DCC; }
/**
* Button Large
*/
.button--large { height: 34px; font-size: 14px; }
a.button--large { padding-top: 8px; }
.button.button--large.button-icon { padding-left: 9px; padding-right: 9px; }

View File

@ -1,67 +0,0 @@
/**
* Forms
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
/* Input Text */
select,
input[type="password"],
input[type="text"] {
padding: 7px 8px;
border: 1px solid #ddd;
vertical-align: middle;
border-radius: 3px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
input[type="text"]:focus,
input[type="password"]:focus {
border-color: #4d90fe;
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,.07) inset, 0 0 3px #4d90fe;
box-shadow: 0 2px 4px rgba(0,0,0,.07) inset, 0 0 3px #4d90fe;
outline: none;
}
select,
input[type="password"],
input[type="text"] {
line-height: 18px;
}
/* Checkboxes */
input[type="checkbox"] {
position: relative;
top: 1px;
margin: 0 2px 0 1px;
}
form p {
margin-bottom: 25px;
}
form label {
display: block;
margin-bottom: 4px;
color: #444;
}
/* Note */
.note {
display: block;
margin-top: 3px;
font-size: 12px;
color: #aaa;
}
/* Placeholder */
:-moz-placeholder { color: #afafaf; }
::-moz-placeholder { color: #afafaf; opacity: 1; }
::-webkit-input-placeholder { color: #afafaf; }
:-ms-input-placeholder { color: #afafaf; }

View File

@ -1,65 +0,0 @@
/**
* Helpers
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
/* Margins */
.mt-10 { margin-top: 10px !important; }
.mt-15 { margin-top: 15px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-30 { margin-top: 30px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-15 { margin-bottom: 15px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-30 { margin-bottom: 30px !important; }
.m-0 { margin: 0 !important; }
/* Text Align */
.ta-c { text-align: center !important; }
.ta-r { text-align: right !important; }
/* Floats */
.fl-r, .float-right, .pull-right { float: right !important; }
.fl-l, .float-left, .pull-left { float: left !important; }
/* Clearfix */
.clearfix:before,
.clearfix:after { content: ""; display: table; line-height: 0; }
.clearfix:after { clear: both; }
/* Width */
.width-full { width: 100% !important; }
.width-50 { width: 50px !important; }
.width-100 { width: 100px !important; }
.width-150 { width: 150px !important; }
.width-200 { width: 200px !important; }
.width-250 { width: 250px !important; }
.width-300 { width: 300px !important; }
.width-350 { width: 350px !important; }
.width-400 { width: 400px !important; }
.width-450 { width: 450px !important; }
.width-500 { width: 500px !important; }
.width-550 { width: 550px !important; }
.width-600 { width: 600px !important; }
.width-650 { width: 650px !important; }
/* Loader */
/* TODO: Change gif */
.loading {
height: 100px;
margin-bottom: 20px;
background-image: url(../images/loader.gif);
background-position: 50% 50%;
background-repeat: no-repeat;
}

View File

@ -1,88 +0,0 @@
body {
font: 13px/1.3em Arial,sans-serif;
background: #fafafa;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Open Sans', Arial;
font-weight: 300;
}
a {
color: #1A80DB;
text-decoration: none;
}
a:hover {
color: #058;
}
/**
* Page header
*/
.page-header {
margin-bottom: 20px;
padding-bottom: 4px;
font-size: 18px;
border-bottom: 1px solid #eee;
}
.container {
max-width: 500px;
margin: 40px auto 40px;
padding: 30px;
background: #fff;
box-shadow: 0 1px 5px rgba(0,0,0,.3)
}
/**
* Header
*/
.header {
padding: 10px 20px;
margin-bottom: 30px;
text-align: center;
}
.header h1 {
font-size: 25px;
}
.header h2 {
margin-top: 5px;
font-size: 16px;
color: #777;
}
/**
* Content
*/
.step-buttons {
padding-top: 20px;
}
/**
* Complete
*/
.complete h2, .complete p {
text-align: center;
}
.complete h2 {
font-size: 18px;
margin-bottom: 15px;
}
/**
* Index
*/
.groups {
padding-bottom: 15px;
text-align: center;
}
.groups li {
margin-bottom: 10px;
font-size: 18px;
font-family: 'Open Sans', Arial;
}
.groups li:last-child {
margin-bottom: 0;
}

View File

@ -1,397 +0,0 @@
/* Adapted from git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
/**
* Correct `inline-block` display not defined in IE 8/9.
*/
audio,
canvas,
video {
display: inline-block;
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address styling not present in IE 8/9.
*/
[hidden] {
display: none;
}
/* ==========================================================================
Base
========================================================================== */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
/**
* Address `outline` inconsistency between Chrome and other browsers.
*/
a:focus {
outline: 0;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* ==========================================================================
Typography
========================================================================== */
/**
* Address variable `h1` font size within `section` and `article` contexts in
* Firefox 4+, Safari 5, and Chrome.
*/
h1, h2, h3, h4, h5, h6 {
font-size: 1em;
line-height: 1.6em;
font-weight: normal;
margin: 0;
font-family: sans-serif;
}
p { margin: 0; }
/**
* Address styling not present in IE 8/9, Safari 5, and Chrome.
*/
abbr[title],
acronym[title] {
border-bottom: 1px dotted;
cursor: help;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Correct font family set oddly in Safari 5 and Chrome.
*/
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
/**
* Improve readability of pre-formatted text in all browsers.
*/
/* pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
} */
/**
* Set consistent quote types.
*/
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* =============================================================================
Lists
========================================================================== */
ul, ol, dl, dd, dt { margin: 0; padding: 0; }
ul, ol {
list-style: none;
list-style-image: none;
}
/* ==========================================================================
Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9.
*/
img {
border: 0;
}
/**
* Correct overflow displayed oddly in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
iframe {
border: 0;
}
/* ==========================================================================
Figures
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari 5.
*/
figure {
margin: 0;
}
/* ==========================================================================
Forms
========================================================================== */
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 0;
margin: 0 2px;
padding: 0;
}
/**
* 1. Correct `color` not being inherited in IE 8/9.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Correct font family not being inherited in all browsers.
* 2. Correct font size not being inherited in all browsers.
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
*/
button,
input,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 2 */
margin: 0; /* 3 */
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
button,
input {
line-height: normal;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* 1. Address box sizing set to `content-box` in IE 8/9.
* 2. Remove excess padding in IE 8/9.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari 5 and Chrome
* on OS X.
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* 1. Remove default vertical scrollbar in IE 8/9.
* 2. Improve readability and alignment in all browsers.
*/
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
/* ==========================================================================
Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
var install = (function ($) {
this.goNextStep = function() {
$('#action_next').click();
};
return this;
}).call(install || {}, jQuery);

View File

@ -1,3 +0,0 @@
<div class="alert alert--error">
Ошибка: <?php echo $this->get('msg'); ?>
</div>

View File

@ -1,9 +0,0 @@
<ul class="groups">
<?php foreach ($this->get('groups') as $group) { ?>
<li>
<h2><a href="?group=<?php echo $group; ?>">
<?php echo $this->lang("groups.{$group}.title"); ?>
</a></h2>
</li>
<?php } ?>
</ul>

View File

@ -1,76 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Установка LiveStreet <?php echo VERSION; ?></title>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,700&subset=cyrillic,latin' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="./frontend/template/assets/css/reset.css"/>
<link rel="stylesheet" type="text/css" href="./frontend/template/assets/css/helpers.css"/>
<link rel="stylesheet" type="text/css" href="./frontend/template/assets/css/button.css"/>
<link rel="stylesheet" type="text/css" href="./frontend/template/assets/css/alert.css"/>
<link rel="stylesheet" type="text/css" href="./frontend/template/assets/css/forms.css"/>
<link rel="stylesheet" type="text/css" href="./frontend/template/assets/css/main.css"/>
<script type="text/javascript" src="./frontend/template/assets/js/jquery.min.js"></script>
<script type="text/javascript" src="./frontend/template/assets/js/main.js"></script>
</head>
<body>
<div class="container">
<div class="header">
<h1>Установка LiveStreet <?php echo VERSION; ?></h1>
<?php if ($currentStep = $this->get('currentStep')) { ?>
<h2><?php echo $currentStep->getGroupTitle(); ?></h2>
<?php } ?>
</div>
<div class="content">
<?php if ($currentStep = $this->get('currentStep')) { ?>
<h2 class="page-header">
<?php echo $currentStep->getStepTitle(); ?>
</h2>
<?php if ($errors = $currentStep->getErrors()) { ?>
<div class="alert alert--error">
<?php foreach ($errors as $sMsg) { ?>
<?php echo $sMsg; ?><br/>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
<form action="" method="post">
<div class="content-body">
<?php echo $this->get('content'); ?>
</div>
<div class="step-buttons clearfix">
<?php if (!$this->get('install_reset_hide')) { ?>
<a href="./?reset=1" class="button"><?php echo $this->lang('install_reset'); ?></a>
<?php } ?>
<?php if (!$this->get('next_step_hide')) { ?>
<button type="submit" class="button button--primary pull-right" name="action_next" id="action_next"
<?php if ($this->get('next_step_disable')) { ?>disabled="disabled" <?php } ?> >Дальше
</button>
<?php } ?>
<?php if (!$this->get('previous_step_hide')) { ?>
<button type="submit" class="button pull-right" name="action_previous" id="action_previous"
<?php if ($this->get('previous_step_disable')) { ?>disabled="disabled" <?php } ?> >Назад
</button>
<?php } ?>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,42 +0,0 @@
<?php if ($requirements = $this->get('requirements')) { ?>
<div class="alert alert--error">
<div class="alert-title">Хостинг не удовлетворяет минимальным требованиям.</div>
<ul>
<?php foreach ($requirements as $requirement) { ?>
<li>
<div>
<?php echo $this->lang('steps.checkRequirements.requirements.' . $requirement['name'] . '.title'); ?> &mdash; <?php echo $requirement['current']; ?>
</div>
<div>
<i><?php echo $this->lang('steps.checkRequirements.requirements.' . $requirement['name'] . '.solution'); ?></i>
</div>
</li>
<?php } ?>
</ul>
</div>
<?php
$additionalSolution = $this->get('additionalSolution');
if ($additionalSolution) { ?>
<div class="alert alert--error">
<ul>
<li><?php echo($additionalSolution); ?></li>
</ul>
</div>
<?php } ?>
<?php } else { ?>
<div class="loading"></div>
<script type="text/javascript">
jQuery(function ($) {
setTimeout(install.goNextStep, 1000);
});
</script>
<?php } ?>

View File

@ -1,5 +0,0 @@
<p><label for=""><?php echo $this->lang('steps.installAdmin.form.mail.title'); ?></label>
<input type="text" name="admin_mail" value="<?php echo htmlspecialchars(InstallCore::getRequestStr('admin_mail')); ?>"></p>
<p><label for=""><?php echo $this->lang('steps.installAdmin.form.passwd.title'); ?></label>
<input type="password" name="admin_passwd" value="<?php echo htmlspecialchars(InstallCore::getRequestStr('admin_passwd')); ?>"></p>

View File

@ -1,5 +0,0 @@
<div class="complete">
<p>
Теперь обязательно удалите каталог <b>/application/install/</b> и можете <a href="<?php echo InstallConfig::get('path.root.web'); ?>">перейти на сайт</a>.
</p>
</div>

View File

@ -1,24 +0,0 @@
<?php $oCurrentStep = $this->get('currentStep'); ?>
<p><label for=""><?php echo $this->lang('steps.installDb.form.db_host.title'); ?></label>
<input type="text" name="db.params.host" class="width-full" value="<?php echo $oCurrentStep->getValue('db.params.host', 'localhost'); ?>"></p>
<p><label for=""><?php echo $this->lang('steps.installDb.form.db_port.title'); ?></label>
<input type="text" name="db.params.port" class="width-full" value="<?php echo $oCurrentStep->getValue('db.params.port', 3306); ?>"></p>
<p><label for=""><?php echo $this->lang('steps.installDb.form.db_name.title'); ?></label>
<input type="text" name="db.params.dbname" class="width-full" value="<?php echo $oCurrentStep->getValue('db.params.dbname', 'social'); ?>"></p>
<?php if (!$oCurrentStep->getParam('hide_create_db')) { ?>
<p><label><input type="checkbox" name="db_create" value="1">
<?php echo $this->lang('steps.installDb.form.db_create.title'); ?></label></p>
<?php } ?>
<p><label for=""><?php echo $this->lang('steps.installDb.form.db_user.title'); ?></label>
<input type="text" name="db.params.user" class="width-full" value="<?php echo $oCurrentStep->getValue('db.params.user', 'root'); ?>"></p>
<p><label for=""><?php echo $this->lang('steps.installDb.form.db_passwd.title'); ?></label>
<input type="password" name="db.params.pass" class="width-full" value="<?php echo $oCurrentStep->getValue('db.params.pass', ''); ?>"></p>
<p><label for=""><?php echo $this->lang('steps.installDb.form.db_prefix.title'); ?></label>
<input type="text" name="db.table.prefix" class="width-full" value="<?php echo $oCurrentStep->getValue('db.table.prefix', 'prefix_'); ?>"></p>

View File

@ -1,7 +0,0 @@
<div class="complete">
<p>
Теперь обязательно удалите каталог <b>/application/install/</b> и можете <a href="<?php echo InstallConfig::get('path.root.web'); ?>">перейти на сайт</a>.
<br/>
Приятного использования новой версией LiveStreet!
</p>
</div>

View File

@ -1,14 +0,0 @@
<div class="alert alert--info">
<div class="alert-title">Внимание!</div>
Перед обновлением обязательно сделайте бекап БД
</div>
<p><label for="">Ваша текущая версия:</label>
<select name="from_version" class="width-100">
<?php foreach ($this->get('convert_versions') as $version) { ?>
<option <?php if ($this->get('from_version') == $version) { ?> selected="selected" <?php } ?> >
<?php echo $version ?>
</option>
<?php } ?>
</select></p>

View File

@ -1,30 +0,0 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_time_limit(0);
header('Content-Type: text/html; charset=utf-8');
require_once('bootstrap.php');
/**
* Определяем группы с шагами
*/
$aGroups = array(
'install' => array(
'checkRequirements',
'installDb',
'installAdmin',
'installComplete'
),
'update' => array(
'checkRequirements',
'updateDb' => array('hide_create_db' => true),
'updateVersion',
'updateComplete'
),
);
$oInstall = new InstallCore($aGroups);
$oInstall->run();