Skip to content

Commit

Permalink
upd to 1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfriend committed Jun 29, 2022
1 parent 2fcc69e commit ad36484
Show file tree
Hide file tree
Showing 17 changed files with 121 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# github: [darkfriend]
custom: [
'yasobe.ru/na/thankyou_bitrix',
'paypal.me/darkfriend'
'https://sobe.ru/na/thankyou_bitrix',
'https://paypal.me/darkfriend',
'https://www.tinkoff.ru/cf/36wVfnMf7mo'
]
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Лог обновлений модуля

## Версия 1.1.9 (29 июня 2022)

### Изменения
* исправлен баг при сохранении настроек модуля

### Миграция используя github
* скачать версию 1.1.9 из [releases](https://github.com/darkfriend/dev2fun.multidomain/releases)
* на сервере заменить файлы в папке `/bitrix/modules/dev2fun.multidomain` на новые файлы из папки в нужной (в которой работает ваш сайт) кодировке
* готово

## Версия 1.1.8 (22 мая 2022)

### Изменения
Expand Down
42 changes: 42 additions & 0 deletions migrations/1.1.9.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* @author dev2fun (darkfriend)
* @copyright darkfriend <[email protected]>
* @version 1.1.9
*/

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";

\Bitrix\Main\Loader::includeModule('main');
\Bitrix\Main\Loader::includeModule('dev2fun.multidomain');
\Bitrix\Main\Loader::registerAutoLoadClasses(
"dev2fun.multidomain",
array(
'Dev2fun\MultiDomain\Base' => 'include.php',
'Dev2fun\MultiDomain\SubDomain' => 'classes/general/SubDomain.php',
'Dev2fun\MultiDomain\Seo' => 'classes/general/Seo.php',
'Dev2fun\MultiDomain\Geo' => 'classes/general/Geo.php',
'Dev2fun\MultiDomain\HLHelpers' => 'lib/HLHelpers.php',
'Dev2fun\MultiDomain\Config' => 'classes/general/Config.php',
'Dev2fun\MultiDomain\TemplateSeo' => 'classes/general/TemplateSeo.php',
'Dev2fun\MultiDomain\TabOptions' => 'classes/general/TabOptions.php',
'Dev2fun\MultiDomain\LangData' => 'classes/general/LangData.php',
)
);

$moduleId = \Dev2fun\MultiDomain\Base::$module_id;

// path to module dev2fun.multidomain
$pathToModule = $_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/dev2fun.multidomain';

// remove old vue-js files
DeleteDirFilesEx($_SERVER["DOCUMENT_ROOT"] . "/bitrix/js/" . $moduleId.'/vue');

// copy vue-js files
if (!CopyDirFiles($pathToModule . "/frontend/dist", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/js/" . $moduleId.'/vue', true, true)) {
throw new Exception('ERRORS_SAVE_FILE '.$_SERVER['DOCUMENT_ROOT'] . 'bitrix/js/' . $moduleId.'/vue');
}

\Dev2fun\MultiDomain\Base::ShowThanksNotice();

die("1.1.9 - Success");
26 changes: 25 additions & 1 deletion utf8/dev2fun.multidomain/classes/general/Site.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author darkfriend
* @version 1.1.8
* @version 1.1.9
* @since 1.0.0
*/

Expand All @@ -12,6 +12,8 @@ class Site
{
/** @var array */
protected static $currentSite;
/** @var string */
protected static $defaultSite;

/**
* @param array $filter
Expand Down Expand Up @@ -58,4 +60,26 @@ public static function getCurrent()

return self::$currentSite;
}

/**
* @return string
* @throws \Bitrix\Main\SystemException
*/
public static function getDefault()
{
if(self::$defaultSite === null) {
$currentSite = current(
array_filter(
static::all(['DEF'=>'Y']),
function($item) {
return $item['DEF'] === 'Y';
}
)
);

self::$defaultSite = isset($currentSite['LID']) ? $currentSite['LID'] : '';
}

return self::$defaultSite;
}
}
2 changes: 1 addition & 1 deletion utf8/dev2fun.multidomain/frontend/config/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = '1.1.2';
module.exports = '1.1.3';
2 changes: 1 addition & 1 deletion utf8/dev2fun.multidomain/include/staticVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Time: 1:18
*/

return '1.1.2';
return '1.1.3';
4 changes: 2 additions & 2 deletions utf8/dev2fun.multidomain/install/version.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$arModuleVersion = [
"VERSION" => "1.1.8",
"VERSION_DATE" => "2022-05-22 17:20",
"VERSION" => "1.1.9",
"VERSION_DATE" => "2022-06-29 21:20",
];
6 changes: 4 additions & 2 deletions utf8/dev2fun.multidomain/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author dev2fun (darkfriend)
* @copyright darkfriend
* @version 1.1.0
* @version 1.1.9
*/

defined('B_PROLOG_INCLUDED') and (B_PROLOG_INCLUDED === true) or die();
Expand Down Expand Up @@ -360,10 +360,12 @@
// "/bitrix/modules/dev2fun.multidomain/frontend/dist/js/polyfill.{$staticVersion}.bundle.js",
//];
foreach ($vueScripts as $script) {
// echo '<script src="'.$script.'"></script>';
$assets->addJs($script);
}
$config = Config::getInstance();
$siteId = \Dev2fun\MultiDomain\Site::getCurrent();
$siteId = \Dev2fun\MultiDomain\Site::getDefault();

$mappingList = $config->get("mapping_list", [['KEY' => '', 'SUBNAME' => '']], $siteId);
$excludeList = $config->get("exclude_path", ['\/(bitrix|local)\/(admin|tools)\/'], $siteId);
$hl = \Darkfriend\HLHelpers::getInstance();
Expand Down
26 changes: 25 additions & 1 deletion win1251/dev2fun.multidomain/classes/general/Site.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author darkfriend
* @version 1.1.8
* @version 1.1.9
* @since 1.0.0
*/

Expand All @@ -12,6 +12,8 @@ class Site
{
/** @var array */
protected static $currentSite;
/** @var string */
protected static $defaultSite;

/**
* @param array $filter
Expand Down Expand Up @@ -58,4 +60,26 @@ public static function getCurrent()

return self::$currentSite;
}

/**
* @return string
* @throws \Bitrix\Main\SystemException
*/
public static function getDefault()
{
if(self::$defaultSite === null) {
$currentSite = current(
array_filter(
static::all(['DEF'=>'Y']),
function($item) {
return $item['DEF'] === 'Y';
}
)
);

self::$defaultSite = isset($currentSite['LID']) ? $currentSite['LID'] : '';
}

return self::$defaultSite;
}
}
2 changes: 1 addition & 1 deletion win1251/dev2fun.multidomain/frontend/config/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = '1.1.2';
module.exports = '1.1.3';
2 changes: 1 addition & 1 deletion win1251/dev2fun.multidomain/include/staticVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Time: 1:18
*/

return '1.1.2';
return '1.1.3';
4 changes: 2 additions & 2 deletions win1251/dev2fun.multidomain/install/version.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$arModuleVersion = [
"VERSION" => "1.1.8",
"VERSION_DATE" => "2022-05-22 17:20",
"VERSION" => "1.1.9",
"VERSION_DATE" => "2022-06-29 21:20",
];
6 changes: 4 additions & 2 deletions win1251/dev2fun.multidomain/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @author dev2fun (darkfriend)
* @copyright darkfriend
* @version 1.1.0
* @version 1.1.9
*/

defined('B_PROLOG_INCLUDED') and (B_PROLOG_INCLUDED === true) or die();
Expand Down Expand Up @@ -360,10 +360,12 @@
// "/bitrix/modules/dev2fun.multidomain/frontend/dist/js/polyfill.{$staticVersion}.bundle.js",
//];
foreach ($vueScripts as $script) {
// echo '<script src="'.$script.'"></script>';
$assets->addJs($script);
}
$config = Config::getInstance();
$siteId = \Dev2fun\MultiDomain\Site::getCurrent();
$siteId = \Dev2fun\MultiDomain\Site::getDefault();

$mappingList = $config->get("mapping_list", [['KEY' => '', 'SUBNAME' => '']], $siteId);
$excludeList = $config->get("exclude_path", ['\/(bitrix|local)\/(admin|tools)\/'], $siteId);
$hl = \Darkfriend\HLHelpers::getInstance();
Expand Down

0 comments on commit ad36484

Please sign in to comment.