Skip to content

Commit 377cec6

Browse files
author
Vitaliy
authored
Merge branch '1.0.1-develop' into master
2 parents dea4b99 + a0de703 commit 377cec6

File tree

75 files changed

+2403
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2403
-84
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Run automated tests
55

66
on:
77
pull_request:
8-
branches: [ master, 1.0.0-develop ]
8+
branches: [ master, 1.0.0-develop, 1.0.1-develop ]
99

1010
jobs:
1111
build-linux:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group 'com.magento.idea'
11-
version '1.0.0'
11+
version '1.0.1'
1212

1313
apply plugin: 'org.jetbrains.intellij'
1414
apply plugin: 'java'

resources/META-INF/plugin.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<idea-plugin>
88
<id>com.magento.idea.magento2plugin</id>
99
<name>Magento PhpStorm</name>
10-
<version>1.0.0</version>
10+
<version>1.0.1</version>
1111
<vendor url="https://github.com/magento/magento2-phpstorm-plugin">Magento Inc.</vendor>
1212

1313
<description><![CDATA[
@@ -57,6 +57,7 @@
5757
<!-- Module file generators -->
5858
<group id="MagentoNewModuleFileGroup" class="com.magento.idea.magento2plugin.actions.groups.NewModuleFileGroup" text="Module File" popup="true">
5959
<action id="MagentoCreateABlock" class="com.magento.idea.magento2plugin.actions.generation.NewBlockAction" />
60+
<action id="MagentoCreateACronjob" class="com.magento.idea.magento2plugin.actions.generation.NewCronjobAction" />
6061
<action id="MagentoCreateAViewModel" class="com.magento.idea.magento2plugin.actions.generation.NewViewModelAction" />
6162
<action id="MagentoCreateAGraphQlResolver" class="com.magento.idea.magento2plugin.actions.generation.NewGraphQlResolverAction" />
6263
<add-to-group group-id="NewGroup" anchor="last"/>
@@ -95,6 +96,7 @@
9596
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.EventNameIndex" />
9697
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.VirtualTypeIndex" />
9798
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.PluginIndex" />
99+
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.CronGroupIndexer" />
98100
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.BlockNameIndex" />
99101
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.ContainerNameIndex" />
100102
<fileBasedIndex implementation="com.magento.idea.magento2plugin.stubs.indexes.WebApiTypeIndex" />
@@ -157,6 +159,8 @@
157159
<internalFileTemplate name="Magento Observer Class"/>
158160
<internalFileTemplate name="Magento Module Events Xml"/>
159161
<internalFileTemplate name="Magento GraphQL Resolver Class"/>
162+
<internalFileTemplate name="Magento Cronjob Class"/>
163+
<internalFileTemplate name="Magento Crontab Xml"/>
160164
</extensions>
161165

162166
<extensions defaultExtensionNs="com.jetbrains.php">
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#if (${CRON_GROUP})
2+
<group id="${CRON_GROUP}">
3+
#end
4+
<job name="${CRONJOB_NAME}" instance="${CRONJOB_INSTANCE}" method="execute">
5+
#if (${CRONJOB_SCHEDULE})
6+
<schedule>${CRONJOB_SCHEDULE}</schedule>
7+
#end
8+
#if (${CRONJOB_SCHEDULE_CONFIG_PATH})
9+
<config_path>${CRONJOB_SCHEDULE_CONFIG_PATH}</config_path>
10+
#end
11+
</job>
12+
#if (${CRON_GROUP})
13+
</group>
14+
#end
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td>
12+
<font face="verdana" size="-1">Each cronjob should be registered in crontab.xml in order to be executed on schedule.</font>
13+
</td>
14+
</tr>
15+
<tr>
16+
<td>
17+
<font face="verdana" size="-1">
18+
<a href="https://devdocs.magento.com/guides/v2.3/config-guide/cron/custom-cron-tut.html">Configure a custom cron job and cron group (tutorial)</a>
19+
</font>
20+
</td>
21+
</tr>
22+
</table>
23+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
24+
<tr>
25+
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
26+
</tr>
27+
<tr>
28+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CRON_GROUP}</b></font></nobr></td>
29+
<td width="10">&nbsp;</td>
30+
<td width="100%" valign="top"><font face="verdana" size="-1">A cron group in scope of which the cronjob will be executed.</font></td>
31+
</tr>
32+
<tr>
33+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CRONJOB_NAME}</b></font></nobr></td>
34+
<td width="10">&nbsp;</td>
35+
<td width="100%" valign="top"><font face="verdana" size="-1">An arbitrary cronjob identifier. Also used to merge the configurations for cronjobs.</font></td>
36+
</tr>
37+
<tr>
38+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CRONJOB_INSTANCE}</b></font></nobr></td>
39+
<td width="10">&nbsp;</td>
40+
<td width="100%" valign="top"><font face="verdana" size="-1">Classname of the cronjob</font></td>
41+
</tr>
42+
<tr>
43+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CRONJOB_SCHEDULE}</b></font></nobr></td>
44+
<td width="10">&nbsp;</td>
45+
<td width="100%" valign="top"><font face="verdana" size="-1">The valid fixed cron schedule expression which defines when cronjob is planned to execute</font></td>
46+
</tr>
47+
<tr>
48+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${CRONJOB_SCHEDULE_CONFIG_PATH}</b></font></nobr></td>
49+
<td width="10">&nbsp;</td>
50+
<td width="100%" valign="top"><font face="verdana" size="-1">A valid Magento config path which defines a cron schedule expression which may be configured from Magento Admin</font></td>
51+
</tr>
52+
</table>
53+
</body>
54+
</html>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
4+
#if (${NAMESPACE})
5+
6+
namespace ${NAMESPACE};
7+
8+
#end
9+
10+
class ${NAME}
11+
{
12+
/**
13+
* Cronjob Description
14+
*
15+
* @return void
16+
*/
17+
public function execute(): void
18+
{
19+
// todo: implement cronjob logic here
20+
}
21+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html lang="en">
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td>
12+
<font face="verdana" size="-1">
13+
Cronjob class is a component that is being executed on schedule.
14+
It's a plain PHP class which should have one method and should be responsible for single background work.
15+
</font>
16+
</td>
17+
</tr>
18+
<tr>
19+
<td>
20+
<font face="verdana" size="-1">
21+
<a href="https://devdocs.magento.com/guides/v2.3/config-guide/cron/custom-cron-tut.html">Configure a custom cron job and cron group (tutorial)</a>
22+
</font>
23+
</td>
24+
</tr>
25+
</table>
26+
27+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
28+
<tr>
29+
<td colspan="3"><font face="verdana" size="-1">Template's variables:</font></td>
30+
</tr>
31+
<tr>
32+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
33+
<td width="10">&nbsp;</td>
34+
<td width="100%" valign="top"><font face="verdana" size="-1">Created PHP cronjob class namespace.</font></td>
35+
</tr>
36+
<tr>
37+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAME}</b></font></nobr></td>
38+
<td width="10">&nbsp;</td>
39+
<td width="100%" valign="top"><font face="verdana" size="-1">PHP class for the cronjob name.</font></td>
40+
</tr>
41+
</table>
42+
</body>
43+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
3+
</config>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html lang="en">
8+
<body>
9+
<font face="verdana" size="-1">
10+
<p>
11+
crontab.xml file is the place where cronjobs are declared to adjust the system.
12+
</p>
13+
<p>
14+
Read more about <a href="https://devdocs.magento.com/guides/v2.3/config-guide/cron/custom-cron-ref.html">Custom cron job and cron group reference</a>.
15+
</p>
16+
</font>
17+
18+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
19+
<tr>
20+
<td colspan="3"><font face="verdana" size="-1">crontab.xml should be defined in the global area</font></td>
21+
</tr>
22+
</table>
23+
</body>
24+
</html>

resources/fileTemplates/internal/Magento Module Composer.json.ft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
"${PACKAGE}\\\\${MODULE_NAME}\\": ""
2222
}
2323
}
24-
}
24+
}

0 commit comments

Comments
 (0)