Skip to content

Commit 25ae404

Browse files
author
flow-php
committed
1 parent 304ffc1 commit 25ae404

File tree

16 files changed

+195
-35
lines changed

16 files changed

+195
-35
lines changed

changelog/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ <h2>[Unreleased] - 2024-12-28</h2>
212212
<h3>Added</h3>
213213
<ul>
214214
<li>
215+
<a rel="noopener noreferrer" target="_blank" href="https://github.com/flow-php/flow/pull/1294">#1294</a> - <strong>Documentation building step to github actions workflow</strong> - <a rel="noopener noreferrer" target="_blank" href="https://github.com/norberttech">@norberttech</a>
216+
</li>
217+
<li>
215218
<a rel="noopener noreferrer" target="_blank" href="https://github.com/flow-php/flow/pull/1281">#1281</a> - <strong>S3 Filesystem based on Async AWS library</strong> - <a rel="noopener noreferrer" target="_blank" href="https://github.com/norberttech">@norberttech</a>
216219
</li>
217220
<li>
@@ -365,6 +368,9 @@ <h3>Changed</h3>
365368
<h3>Fixed</h3>
366369
<ul>
367370
<li>
371+
<a rel="noopener noreferrer" target="_blank" href="https://github.com/flow-php/flow/pull/1294">#1294</a> - <strong>Fixed broken documentation building script</strong> - <a rel="noopener noreferrer" target="_blank" href="https://github.com/norberttech">@norberttech</a>
372+
</li>
373+
<li>
368374
<a rel="noopener noreferrer" target="_blank" href="https://github.com/flow-php/flow/pull/1281">#1281</a> - <strong>Meilisearch pagination</strong> - <a rel="noopener noreferrer" target="_blank" href="https://github.com/norberttech">@norberttech</a>
369375
</li>
370376
<li>

data_reading/http_dynamic/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ <h2 class="text-xl mt-5 mb-5">Output</h2>
362362
<button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#output" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 shadow-2xl shadow-gray rounded border-gray border-2"><code id="output" class="language-bash overflow-auto" data-controller="syntax-highlight">+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
363363
| name | html_url | blog | login | public_repos | followers | created_at |
364364
+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
365-
| Flow PHP | https://github.com/flow-php | http://flow-php.com | flow-php | 36 | 106 | 2020-10-26T18:40:27Z |
365+
| Flow PHP | https://github.com/flow-php | http://flow-php.com | flow-php | 37 | 106 | 2020-10-26T18:40:27Z |
366366
+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
367367
1 rows
368368
</code></pre> </div>

documentation/components/bridges/filesystem-async-aws-bridge/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,26 @@ <h1>Filesystem Async AWS</h1>
365365

366366
$fstab = fstab($aws);
367367
</code></pre>
368+
<h2>Usage with Flow</h2>
369+
<p>To use the AWS S3 filesystem with Flow, you need to mount the filesystem to the configuration.
370+
This operation will mount the S3 filesystem to fstab instance available in the DataFrame runtime.</p>
371+
<pre class="language-php"><code class="language-php" data-controller="syntax-highlight">$config = config_builder()
372+
-&gt;mount(
373+
aws_s3_filesystem(
374+
$_ENV['AWS_S3_BUCKET'],
375+
aws_s3_client([
376+
'region' =&gt; $_ENV['AWS_S3_REGION'],
377+
'accessKeyId' =&gt; $_ENV['AWS_S3_KEY'],
378+
'accessKeySecret' =&gt; $_ENV['AWS_S3_SECRET'],
379+
])
380+
)
381+
);
382+
383+
data_frame($config)
384+
-&gt;read(from_csv(path('aws-s3://test.csv')))
385+
-&gt;write(to_stream(__DIR__ . '/output.txt', truncate: false))
386+
-&gt;run();
387+
</code></pre>
368388

369389

370390
<hr class="!mt-8 !mb-8"/>

documentation/components/bridges/filesystem-azure-bridge/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,30 @@ <h2>Usage</h2>
386386
$logger
387387
);
388388
</code></pre>
389+
<h2>Usage with Flow</h2>
390+
<p>To use the Azure Blob filesystem with Flow, you need to mount the filesystem to the configuration.
391+
This operation will mount the Azure Blob filesystem to fstab instance available in the DataFrame runtime.</p>
392+
<pre class="language-php"><code class="language-php" data-controller="syntax-highlight">$config = config_builder()
393+
-&gt;mount(
394+
azure_filesystem(
395+
azure_blob_service(
396+
azure_blob_service_config(
397+
$_ENV['AZURE_ACCOUNT'],
398+
$_ENV['AZURE_CONTAINER']
399+
),
400+
azure_shared_key_authorization_factory(
401+
$_ENV['AZURE_ACCOUNT'],
402+
$_ENV['AZURE_ACCOUNT_KEY']
403+
),
404+
)
405+
)
406+
);
407+
408+
data_frame($config)
409+
-&gt;read(from_csv(path('azure-blob://test.csv')))
410+
-&gt;write(to_stream(__DIR__ . '/output.txt', truncate: false))
411+
-&gt;run();
412+
</code></pre>
389413

390414

391415
<hr class="!mt-8 !mb-8"/>

documentation/example/data_reading/http_dynamic/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ <h2 class="text-xl mt-5 mb-5">Output</h2>
395395
<button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#output" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 shadow-2xl shadow-gray rounded border-gray border-2"><code id="output" class="language-bash overflow-auto" data-controller="syntax-highlight">+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
396396
| name | html_url | blog | login | public_repos | followers | created_at |
397397
+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
398-
| Flow PHP | https://github.com/flow-php | http://flow-php.com | flow-php | 36 | 106 | 2020-10-26T18:40:27Z |
398+
| Flow PHP | https://github.com/flow-php | http://flow-php.com | flow-php | 37 | 106 | 2020-10-26T18:40:27Z |
399399
+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
400400
1 rows
401401
</code></pre> </div>

documentation/example/filesystem/azure/index.html

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ <h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button c
352352
declare(strict_types=1);
353353

354354
use function Flow\Azure\SDK\DSL\{azure_blob_service, azure_blob_service_config, azure_shared_key_authorization_factory};
355-
use function Flow\ETL\Adapter\CSV\to_csv;
356-
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite};
355+
use function Flow\ETL\Adapter\CSV\{from_csv, to_csv};
356+
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite, to_stream};
357357
use function Flow\Filesystem\Bridge\Azure\DSL\azure_filesystem;
358358
use function Flow\Filesystem\DSL\path;
359359
use Symfony\Component\Dotenv\Dotenv;
@@ -395,8 +395,40 @@ <h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button c
395395
-&gt;saveMode(overwrite())
396396
-&gt;write(to_csv(path(&#039;azure-blob://test.csv&#039;)))
397397
-&gt;run();
398+
399+
data_frame($config)
400+
-&gt;read(from_csv(path(&#039;azure-blob://test.csv&#039;)))
401+
-&gt;write(to_stream(__DIR__ . &#039;/output.txt&#039;, truncate: false))
402+
-&gt;run();
398403
</code></pre></div> </div>
399404

405+
<h2 class="text-xl mt-5 mb-5">Output</h2>
406+
<div id="output" class="relative">
407+
<button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#output" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 shadow-2xl shadow-gray rounded border-gray border-2"><code id="output" class="language-bash overflow-auto" data-controller="syntax-highlight">+----+------+
408+
| id | name |
409+
+----+------+
410+
| 1 | test |
411+
+----+------+
412+
1 rows
413+
+----+------+
414+
| id | name |
415+
+----+------+
416+
| 2 | test |
417+
+----+------+
418+
1 rows
419+
+----+------+
420+
| id | name |
421+
+----+------+
422+
| 3 | test |
423+
+----+------+
424+
1 rows
425+
+----+------+
426+
| id | name |
427+
+----+------+
428+
| 4 | test |
429+
+----+------+
430+
1 rows
431+
</code></pre> </div>
400432

401433
<div class="mt-5">
402434
<script src="https://giscus.app/client.js"

documentation/example/filesystem/s3/index.html

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,21 +346,13 @@ <h2>Bridges</h2>
346346
<h1>Example: S3</h1>
347347
<h3>Topic: Filesystem</h3>
348348
<hr class="hidden lg:block"/>
349-
<h2 class="text-xl mt-5 mb-5">Description</h2>
350-
<article id="example-description"
351-
class="rounded px-4 pt-4 overflow-auto shadow-2xl shadow-gray rounded border-gray border-2 relative mb-10"
352-
data-controller="all-links-external"
353-
>
354-
<p>S3 or any S3 like filesystem is coming soon!</p>
355-
356-
</article>
357349

358350
<h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#code" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 overflow-auto shadow-2xl shadow-gray rounded border-gray border-2"><code id="code" class="language-php" data-controller="syntax-highlight" >&lt;?php
359351

360352
declare(strict_types=1);
361353

362-
use function Flow\ETL\Adapter\CSV\to_csv;
363-
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite};
354+
use function Flow\ETL\Adapter\CSV\{from_csv, to_csv};
355+
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite, to_stream};
364356
use function Flow\Filesystem\Bridge\AsyncAWS\DSL\{aws_s3_client, aws_s3_filesystem};
365357
use function Flow\Filesystem\DSL\path;
366358
use Symfony\Component\Dotenv\Dotenv;
@@ -398,8 +390,40 @@ <h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button c
398390
-&gt;saveMode(overwrite())
399391
-&gt;write(to_csv(path(&#039;aws-s3://test.csv&#039;)))
400392
-&gt;run();
393+
394+
data_frame($config)
395+
-&gt;read(from_csv(path(&#039;aws-s3://test.csv&#039;)))
396+
-&gt;write(to_stream(__DIR__ . &#039;/output.txt&#039;, truncate: false))
397+
-&gt;run();
401398
</code></pre></div> </div>
402399

400+
<h2 class="text-xl mt-5 mb-5">Output</h2>
401+
<div id="output" class="relative">
402+
<button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#output" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 shadow-2xl shadow-gray rounded border-gray border-2"><code id="output" class="language-bash overflow-auto" data-controller="syntax-highlight">+----+------+
403+
| id | name |
404+
+----+------+
405+
| 1 | test |
406+
+----+------+
407+
1 rows
408+
+----+------+
409+
| id | name |
410+
+----+------+
411+
| 2 | test |
412+
+----+------+
413+
1 rows
414+
+----+------+
415+
| id | name |
416+
+----+------+
417+
| 3 | test |
418+
+----+------+
419+
1 rows
420+
+----+------+
421+
| id | name |
422+
+----+------+
423+
| 4 | test |
424+
+----+------+
425+
1 rows
426+
</code></pre> </div>
403427

404428
<div class="mt-5">
405429
<script src="https://giscus.app/client.js"

documentation/example/filesystem/stdout/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,7 @@ <h2 class="text-xl mt-5 mb-5">Description</h2>
354354
<p>Stdout is a special type of filesystem allowing to
355355
write straight to stdout of the process.</p>
356356
<p><code>Stdout is a write-only filesystem. It is not possible to read from it.</code></p>
357-
<p>Its main purpose is to allow to allow web servers to stream
358-
data to the client without buffering it in memory.</p>
357+
<p>Its main purpose is to allow web servers to stream data to the client without buffering it in memory.</p>
359358

360359
</article>
361360

filesystem/azure/index.html

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ <h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button c
295295
declare(strict_types=1);
296296

297297
use function Flow\Azure\SDK\DSL\{azure_blob_service, azure_blob_service_config, azure_shared_key_authorization_factory};
298-
use function Flow\ETL\Adapter\CSV\to_csv;
299-
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite};
298+
use function Flow\ETL\Adapter\CSV\{from_csv, to_csv};
299+
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite, to_stream};
300300
use function Flow\Filesystem\Bridge\Azure\DSL\azure_filesystem;
301301
use function Flow\Filesystem\DSL\path;
302302
use Symfony\Component\Dotenv\Dotenv;
@@ -338,8 +338,40 @@ <h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button c
338338
-&gt;saveMode(overwrite())
339339
-&gt;write(to_csv(path(&#039;azure-blob://test.csv&#039;)))
340340
-&gt;run();
341+
342+
data_frame($config)
343+
-&gt;read(from_csv(path(&#039;azure-blob://test.csv&#039;)))
344+
-&gt;write(to_stream(__DIR__ . &#039;/output.txt&#039;, truncate: false))
345+
-&gt;run();
341346
</code></pre></div> </div>
342347

348+
<h2 class="text-xl mt-5 mb-5">Output</h2>
349+
<div id="output" class="relative">
350+
<button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#output" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 shadow-2xl shadow-gray rounded border-gray border-2"><code id="output" class="language-bash overflow-auto" data-controller="syntax-highlight">+----+------+
351+
| id | name |
352+
+----+------+
353+
| 1 | test |
354+
+----+------+
355+
1 rows
356+
+----+------+
357+
| id | name |
358+
+----+------+
359+
| 2 | test |
360+
+----+------+
361+
1 rows
362+
+----+------+
363+
| id | name |
364+
+----+------+
365+
| 3 | test |
366+
+----+------+
367+
1 rows
368+
+----+------+
369+
| id | name |
370+
+----+------+
371+
| 4 | test |
372+
+----+------+
373+
1 rows
374+
</code></pre> </div>
343375

344376
<div class="mt-5">
345377
<script src="https://giscus.app/client.js"

filesystem/s3/index.html

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,21 +289,13 @@ <h2 class="mb-4 text-2xl font-semibold tracking-wide">Examples:</h2>
289289
</nav>
290290

291291
<div id="example" class="-mt-36 pt-36">
292-
<h2 class="text-xl mt-5 mb-5">Description</h2>
293-
<article id="example-description"
294-
class="rounded px-4 pt-4 overflow-auto shadow-2xl shadow-gray rounded border-gray border-2 relative mb-10"
295-
data-controller="all-links-external"
296-
>
297-
<p>S3 or any S3 like filesystem is coming soon!</p>
298-
299-
</article>
300292

301293
<h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#code" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 overflow-auto shadow-2xl shadow-gray rounded border-gray border-2"><code id="code" class="language-php" data-controller="syntax-highlight" >&lt;?php
302294

303295
declare(strict_types=1);
304296

305-
use function Flow\ETL\Adapter\CSV\to_csv;
306-
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite};
297+
use function Flow\ETL\Adapter\CSV\{from_csv, to_csv};
298+
use function Flow\ETL\DSL\{config_builder, data_frame, from_array, overwrite, to_stream};
307299
use function Flow\Filesystem\Bridge\AsyncAWS\DSL\{aws_s3_client, aws_s3_filesystem};
308300
use function Flow\Filesystem\DSL\path;
309301
use Symfony\Component\Dotenv\Dotenv;
@@ -341,8 +333,40 @@ <h2 class="text-xl mt-5 mb-5">Code</h2><div id="code" class="relative"><button c
341333
-&gt;saveMode(overwrite())
342334
-&gt;write(to_csv(path(&#039;aws-s3://test.csv&#039;)))
343335
-&gt;run();
336+
337+
data_frame($config)
338+
-&gt;read(from_csv(path(&#039;aws-s3://test.csv&#039;)))
339+
-&gt;write(to_stream(__DIR__ . &#039;/output.txt&#039;, truncate: false))
340+
-&gt;run();
344341
</code></pre></div> </div>
345342

343+
<h2 class="text-xl mt-5 mb-5">Output</h2>
344+
<div id="output" class="relative">
345+
<button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#output" data-controller="clipboard"><img src="https://flow-php.com/assets/images/icons/copy-c890d86c179d4c56059b8a0e9c88cd23.svg" alt="copy code" width="20" height="20" class="inline"></button><pre class="rounded p-4 shadow-2xl shadow-gray rounded border-gray border-2"><code id="output" class="language-bash overflow-auto" data-controller="syntax-highlight">+----+------+
346+
| id | name |
347+
+----+------+
348+
| 1 | test |
349+
+----+------+
350+
1 rows
351+
+----+------+
352+
| id | name |
353+
+----+------+
354+
| 2 | test |
355+
+----+------+
356+
1 rows
357+
+----+------+
358+
| id | name |
359+
+----+------+
360+
| 3 | test |
361+
+----+------+
362+
1 rows
363+
+----+------+
364+
| id | name |
365+
+----+------+
366+
| 4 | test |
367+
+----+------+
368+
1 rows
369+
</code></pre> </div>
346370

347371
<div class="mt-5">
348372
<script src="https://giscus.app/client.js"

0 commit comments

Comments
 (0)