Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 018a47e

Browse files
committed
Add lib faker, change structure on module
1 parent 4b59aa8 commit 018a47e

File tree

14 files changed

+125
-14
lines changed

14 files changed

+125
-14
lines changed

src/Fred/FishGenerator/ElementFishGenerator.php renamed to ggrachdev.fish_generator/classes/general/FishGenerator/ElementFishGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?
22

3-
namespace Fred\FishGenerator;
3+
namespace GGrach\FishGenerator;
44

5-
use Fred\FishGenerator\Exceptions\GeneratePhotoException;
6-
use Fred\FishGenerator\Exceptions\BitrixRedactionException;
5+
use GGrach\FishGenerator\Exceptions\GeneratePhotoException;
6+
use GGrach\FishGenerator\Exceptions\BitrixRedactionException;
77

88
/**
99
* @todo Add https://dummyimage.com/
@@ -108,7 +108,7 @@ class PhotoGenerator extends Debug {
108108
* Установить категорию фото
109109
*
110110
* @param string|array $categoryPhoto
111-
* @return \Fred\Generators\ElementFishGenerator
111+
* @return \GGrach\Generators\ElementFishGenerator
112112
*/
113113
public function setCategoryPhoto($categoryPhoto): ElementFishGenerator {
114114

src/Fred/FishGenerator/Exceptions/BitrixRedactionException.php renamed to ggrachdev.fish_generator/classes/general/FishGenerator/Exceptions/BitrixRedactionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?
22

3-
namespace Fred\FishGenerator\Exceptions;
3+
namespace GGrach\FishGenerator\Exceptions;
44

55
use \Exception;
66

src/Fred/FishGenerator/Exceptions/GenerateElementException.php renamed to ggrachdev.fish_generator/classes/general/FishGenerator/Exceptions/GenerateElementException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?
22

3-
namespace Fred\FishGenerator\Exceptions;
3+
namespace GGrach\FishGenerator\Exceptions;
44

55
use \Exception;
66

src/Fred/FishGenerator/Exceptions/GeneratePhotoException.php renamed to ggrachdev.fish_generator/classes/general/FishGenerator/Exceptions/GeneratePhotoException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?
22

3-
namespace Fred\FishGenerator\Exceptions;
3+
namespace GGrach\FishGenerator\Exceptions;
44

55
use \Exception;
66

src/Fred/FishGenerator/Exceptions/GeneratorTypeException.php renamed to ggrachdev.fish_generator/classes/general/FishGenerator/Exceptions/GeneratorTypeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?
22

3-
namespace Fred\FishGenerator\Exceptions;
3+
namespace GGrach\FishGenerator\Exceptions;
44

55
use \Exception;
66

src/Fred/FishGenerator/Exceptions/SearchIblockException.php renamed to ggrachdev.fish_generator/classes/general/FishGenerator/Exceptions/SearchIblockException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?
22

3-
namespace Fred\FishGenerator\Exceptions;
3+
namespace GGrach\FishGenerator\Exceptions;
44

55
use \Exception;
66

src/Fred/FishGenerator/Generators/ElementGenerator.php renamed to ggrachdev.fish_generator/classes/general/FishGenerator/Generators/ElementGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?
22

3-
namespace Fred\FishGenerator\Generators;
3+
namespace GGrach\FishGenerator\Generators;
44

5-
use Fred\FishGenerator\Exceptions\GenerateElementException;
6-
use Fred\FishGenerator\Exceptions\SearchIblockException;
7-
use Fred\FishGenerator\Exceptions\GeneratorTypeException;
8-
use Fred\FishGenerator\PropertyRulesElementFilter;
5+
use GGrach\FishGenerator\Exceptions\GenerateElementException;
6+
use GGrach\FishGenerator\Exceptions\SearchIblockException;
7+
use GGrach\FishGenerator\Exceptions\GeneratorTypeException;
8+
use GGrach\FishGenerator\PropertyRulesElementFilter;
99

1010
/**
1111
* Логика генерации элемента
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 5ffe7db6c80f441f150fc88008d64e64af66634b
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?
2+
3+
include_once 'classes/general/Libs/faker/src/autoload.php';
4+
5+
\Bitrix\Main\Loader::registerAutoLoadClasses('ggrachdev.fish_generator', [
6+
"\GGrach\CouponsPdf\Generator\CouponGenerator" => "classes/general/CouponsPdf/Generator/CouponGenerator.php"
7+
]);
8+
?>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?
2+
3+
global $MESS;
4+
$strPath2Lang = str_replace("\\", "/", __FILE__);
5+
$strPath2Lang = substr($strPath2Lang, 0, strlen($strPath2Lang) - 18);
6+
@include(GetLangFileName($strPath2Lang . "/lang/", "/install/index.php"));
7+
IncludeModuleLangFile($strPath2Lang . "/install/index.php");
8+
9+
class ggrachdev_fish_generator extends CModule {
10+
11+
public $MODULE_ID = 'ggrachdev.fish_generator';
12+
public $MODULE_VERSION;
13+
public $MODULE_VERSION_DATE;
14+
public $MODULE_NAME;
15+
public $MODULE_DESCRIPTION;
16+
17+
/**
18+
* Инициализация модуля для страницы "Управление модулями"
19+
*/
20+
function __construct() {
21+
include($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/{$this->MODULE_ID}/install/version.php");
22+
$this->MODULE_NAME = GetMessage('GGRACHDEV_FISH_GENERATOR_MODULNAME');
23+
$this->MODULE_DESCRIPTION = GetMessage('GGRACHDEV_FISH_GENERATOR_DESC');
24+
$this->MODULE_VERSION = $arModuleVersion['VERSION'];
25+
$this->MODULE_VERSION_DATE = $arModuleVersion['VERSION_DATE'];
26+
$this->PARTNER_NAME = GetMessage("GGRACHDEV_FISH_GENERATOR_PARTNER_NAME");
27+
$this->PARTNER_URI = GetMessage("GGRACHDEV_FISH_GENERATOR_PARTNER_URI");
28+
}
29+
30+
/**
31+
* Устанавливаем модуль
32+
*/
33+
public function DoInstall() {
34+
RegisterModule($this->MODULE_ID);
35+
}
36+
37+
/**
38+
* Удаляем модуль
39+
*/
40+
public function DoUninstall() {
41+
UnRegisterModule($this->MODULE_ID);
42+
}
43+
44+
/**
45+
* Добавляем почтовые события
46+
*
47+
* @return bool
48+
*/
49+
public function InstallEvents() {
50+
return true;
51+
}
52+
53+
/**
54+
* Удаляем почтовые события
55+
*
56+
* @return bool
57+
*/
58+
public function UnInstallEvents() {
59+
return true;
60+
}
61+
62+
/**
63+
* Копируем файлы административной части
64+
*
65+
* @return bool
66+
*/
67+
public function InstallFiles() {
68+
return true;
69+
}
70+
71+
/**
72+
* Удаляем файлы административной части
73+
*
74+
* @return bool
75+
*/
76+
public function UnInstallFiles() {
77+
return true;
78+
}
79+
80+
}
81+
82+
?>

0 commit comments

Comments
 (0)