-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
942fed4
commit 9aef8f2
Showing
7 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Remotes | ||
- [Sftp File](sftp-file.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |