Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Dec 18, 2023
2 parents 8f492f9 + c18e363 commit 416e89a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ about writing changes to this log.

## [Unreleased]

## [1.2.1] 2023-12-15

* Normalized file name for Windows

## [1.2.0] 2023-03-10

* Added methods for relating documents in GO.
Expand All @@ -30,11 +34,12 @@ about writing changes to this log.

## [1.0.0] 2022-06-07

[Unreleased]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.2.0...HEAD
[Unreleased]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.2.1...HEAD
[1.2.1]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.1.3...1.2.0
[1.1.3]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.1.2...1.1.3
[1.1.2]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.0.1...1.1.0
[1.0.1]: https://github.com/itk-dev/getorganized-api-client-php/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/itk-dev/getorganized-api-client-php/releases/tag/1.0.0
[1.0.0]: https://github.com/itk-dev/getorganized-api-client-php/releases/tag/1.0.0
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GetOrganized API client
# GetOrganized API client

## Installation

Expand Down Expand Up @@ -56,11 +56,31 @@ class Tiles extends Service

## Development

### Tests

```sh
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest vendor/bin/phpunit
```

### Coding standards

The following commands let you test that the coding standards:
The following commands let you test that the code adheres to the coding standards:

```sh
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php7.4-fpm:latest composer coding-standards-check
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-check
```

Automatically fix some coding standards issues by running

```sh
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-apply
```

### Code analysis

```sh
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer code-analysis
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
CaseId: 'GEO-2022-000114'
ListName: 'Dokumenter'
FolderPath: ''
FileName: ''
FileName: 'pipfugl.png'
Metadata: '<z:row xmlns:z="#RowsetSchema"/>'
Overwrite: true
response:
Expand Down
8 changes: 8 additions & 0 deletions src/Service/Documents.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public function AddToDocumentLibrary(string $filePath, string $caseId, string $f

$bytes = self::fileToIntArray($filePath);

if (empty($fileName)) {
$fileName = basename($filePath);
}

// Make sure that the file name is valid in Windows (cf.
// https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions).
$fileName = preg_replace('@[<>:"/\\\\|?*]@', '_', $fileName);

$result = $this->getData(
'POST',
$this->getApiBasePath().__FUNCTION__,
Expand Down

0 comments on commit 416e89a

Please sign in to comment.