Skip to content

Commit

Permalink
docs: added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKoehnen committed Dec 13, 2022
1 parent 942fed4 commit 9aef8f2
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 1 deletion.
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
# Ambimax PhpLibrary File
This Library is a abstraction for interactions with files

## Installation
## Remotes
Remote are extensions of the base File Class which are used to other systems.

### Implementet Protocols:
- Sftp [SftpFile.php](src/Remote/SftpFile.php)

## Quick Start
### Installation
```shell
composer require ambimax/php-lib-file
```

## Basic Usage

### Create File Object
Creating of a File Object goes mostly analogous to [fopen](https://www.php.net/manual/de/function.fopen.php)

__1. Argument:__
fopen compatible filename

__2. Argument:__
Any of the File::MODE_* consts
This consts are the available options of the [fopen](https://www.php.net/manual/de/function.fopen.php) `mode`parameter.

```php
use \Ambimax\File\File;

// fopenCompatibleFilename Any File::MODE_*
$file = new File( '/tmp/filename' , File::MODE_READ );
```

## Remotes
For additional informations on how use this with files that are not in the local filesystem check the [Remotes Documentation](docs/remotes/README.md).

## Helper scripts

You can find out more about them [here](docs/tools.md).

## Addtitional Documentation

Add a list of links to additional documentation in `./docs`.

* [Changelog](./CHANGELOG.md)
* [Tools](./tools.md)
* [Plugin Template](plugin-template.md)


## Author(s)
- Fabian Köhnen, [ambimax® GmbH](https://www.ambimax.de)
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Docs

## General
- [Github Actions](github-actions.md)

## Dev
- [Development](development.md)
- [Tools](tools.md)
10 changes: 10 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Development
## Setup
To develop this plugin, you should install the composer dependencies by running `composer update` **inside the root of this plugin**.

This is required to install the composer tools and have all the dependencies for the tests around like they are in the github action tests.

Also see the [Shopware6 Project Development documentations](https://github.com/ambimax/shopware6-project-ambimax/blob/staging/docs/project-development.md)

## Additional infos
- [Tools](tools.md)
10 changes: 10 additions & 0 deletions docs/github-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Github Actions
## release
- runs on workflow dispatch only. __you will need to trigger the release manually__
- runs the semantic-release tool to create a new tag and release
- __make sure to name your commits according to the [semantic-release rules](https://guide.ambimax.xyz/best-practices/semantic-release/index.html)__

## test
- installs the composer dependencies of the plugin
- runs `composer check`
- **Tip:** you can see the code coverage of your test at step ``run tests``
2 changes: 2 additions & 0 deletions docs/remotes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Remotes
- [Sftp File](sftp-file.md)
15 changes: 15 additions & 0 deletions docs/remotes/sftp-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Sftp File
Class: [SftpFile](../../src/Remote/SftpFile.php)

## Differnce to Base File
### Sftp File creation
```php
use Ambimax\File\Remote\SftpFile;

$sftpFile = new SftpFile(
'SftpHostname',
'SftpUsername',
'SftpPassword',
//... like the base file class
);
```
22 changes: 22 additions & 0 deletions docs/tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Tools
## Composer Scripts
You can run each tool with `composer <tool_name>` inside the plugin root directory.
**To run these tools you need to have the composer dependencies. [check here](development.md#Setup)**

### cs-check
check the code style of your plugin with the Symfony Ruleset of php-cs-fixer

### cs-fix
same as cs-check, but fixes the code style automatically

### unit
run the unit tests of your plugin

### unit-coverage
runs the unit tests of your plugin and generates a code coverage report

### stan
inspect the source code of your plugin with [PHPStan](https://phpstan.org/) on level 7

### check
combines cs-check, unit-coverage and stan

0 comments on commit 9aef8f2

Please sign in to comment.