Skip to content

Commit 317335c

Browse files
Added page for OperationHelper
1 parent 3eeea3f commit 317335c

File tree

6 files changed

+98
-0
lines changed

6 files changed

+98
-0
lines changed

docs/do.tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
</toc-element>
3030
<toc-element toc-title="Helpers">
3131
<toc-element topic="artisan-commands.topic" />
32+
<toc-element topic="operation-helper.topic" />
3233
<toc-element topic="events.topic" />
3334
<toc-element topic="execution-status.topic" />
3435
</toc-element>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use DragonCode\LaravelDeployOperations\Helpers\OperationHelper;
6+
7+
OperationHelper::run();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use DragonCode\LaravelDeployOperations\Helpers\OperationHelper;
6+
7+
OperationHelper::run('foo');
8+
9+
// also you can use a real path
10+
OperationHelper::run(__DIR__ . '/../foo', realpath: true);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use DragonCode\LaravelDeployOperations\Helpers\OperationHelper;
6+
7+
OperationHelper::run('foo/2022_10_14_000002_test2');
8+
// or
9+
OperationHelper::run('foo/2022_10_14_000002_test2.php');
10+
11+
// also you can use a real path
12+
OperationHelper::run(__DIR__ . '/../foo/2022_10_14_000002_test2', realpath: true);
13+
// or
14+
OperationHelper::run(__DIR__ . '/../foo/2022_10_14_000002_test2.php', realpath: true);

docs/snippets/operations_helper.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2022_10_14_000001_test1
2+
foo/2022_10_14_000002_test2
3+
foo/2022_10_14_000003_test3
4+
bar/2022_10_14_000004_test4
5+
2022_10_14_000004_test5

docs/topics/operation-helper.topic

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE topic
3+
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
4+
<topic
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
7+
title="Operation Helper" id="operation-helper">
8+
9+
<link-summary>Information about launching operations with the help of the helper</link-summary>
10+
<card-summary>Information about launching operations with the help of the helper</card-summary>
11+
<web-summary>Information about launching operations with the help of the helper</web-summary>
12+
13+
<show-structure depth="2" />
14+
15+
<p>
16+
To quickly call operations from other code, you can use the <code>OperationHelper</code> helper function.
17+
</p>
18+
19+
<chapter title="Execution of all" id="execution_of_all">
20+
<p>
21+
This will execute any operations not performed earlier:
22+
</p>
23+
24+
<code-block lang="php" src="operation_helper_all.php" include-lines="5-" />
25+
26+
<p>
27+
For example,
28+
</p>
29+
30+
<code-block lang="bash" src="operations_helper.sh" />
31+
</chapter>
32+
33+
<chapter title="Performing operations in a folder" id="performing_operations_in_a_folder">
34+
<p>
35+
This will execute all previously unexecuted operations in the specified folder:
36+
</p>
37+
38+
<code-block lang="php" src="operation_helper_directory.php" include-lines="5-" />
39+
40+
<p>
41+
For example,
42+
</p>
43+
44+
<code-block lang="bash" src="operations_helper.sh" include-lines="2-3" />
45+
</chapter>
46+
47+
<chapter title="Performing a specific operation" id="performing_a_specific_operation">
48+
<warning>
49+
This will execute the defined operation file even if it was previously called.
50+
Be careful about calling it again.
51+
</warning>
52+
53+
<code-block lang="php" src="operation_helper_file.php" include-lines="5-" />
54+
55+
<p>
56+
For example,
57+
</p>
58+
59+
<code-block lang="bash" src="operations_helper.sh" include-lines="2" />
60+
</chapter>
61+
</topic>

0 commit comments

Comments
 (0)