Skip to content

Commit 6cdc3b5

Browse files
committed
Доработка инсталлятора
1 parent 30eed70 commit 6cdc3b5

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ class UploadPictureConsumer implements ConsumerInterface
168168
* `bitrix-abbitmq:setup-fabric` Sets up the Rabbit MQ fabric
169169
* `bitrix-rabbitmq:stdin-producer` Executes a producer that reads data from STDIN
170170

171-
В папке `/install/bin` модуля лежит файл `rabbitmq`. После установки модуля нужно скопировать его в `php/bin`.
171+
В папке `/install/bin` модуля лежит файл `rabbitmq`. При установке модуля система попробует скопировать его в директорию,
172+
`bin`, лежащую двумя уровнями выше `DOCUMENT_ROOT`. Если такой директории не существует, то сделано ничего не будет. Придется
173+
создать папку руками и скопировать туда файл вручную.
172174

173175
Запуск:
174176

install/index.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,39 @@ public function DoUninstall()
9393
}
9494
}
9595

96+
/**
97+
* @inheritDoc
98+
*/
99+
public function InstallFiles()
100+
{
101+
parent::InstallFiles();
102+
103+
$rootDir = Application::getDocumentRoot().'/';
104+
$binFile = '/rabbitmq';
105+
106+
if (is_dir($rootDir . '../../bin')) {
107+
$src = __DIR__. '/bin' . $binFile;
108+
copy($src, $rootDir . '../../bin' . $binFile);
109+
}
110+
111+
return true;
112+
}
113+
114+
/**
115+
* @inheritDoc
116+
*/
117+
public function UnInstallFiles()
118+
{
119+
parent::UnInstallFiles();
120+
121+
$rootDir = Application::getDocumentRoot().'/';
122+
$binFile = '/rabbitmq';
123+
124+
@unlink($rootDir . '../../bin' . $binFile);
125+
126+
return true;
127+
}
128+
96129
/**
97130
* @return boolean
98131
*/

0 commit comments

Comments
 (0)