Skip to content

Commit

Permalink
Merge pull request #796 from LibreSign/backport/793/stable22
Browse files Browse the repository at this point in the history
[stable22] remove more parts of tcpdi
  • Loading branch information
vitormattos authored May 5, 2022
2 parents d70fd08 + e3caf34 commit d4a8db5
Show file tree
Hide file tree
Showing 11 changed files with 464 additions and 94 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/app-check-code.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ jobs:
--database-pass=rootpassword \
--admin-user=admin \
--admin-pass=password
- name: Enable app
run: |
./occ app:enable ${{ env.APP_NAME }}
- name: Start built in server
run: |
php -S localhost:8080 &
- name: Set up dependencies apps
run: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Types of changes:
- *Security* in case of vulnerabilities.

<!-- changelog-linker -->
## 3.1.1 - 2022-05-05

# Fixed
- Replaced more usages of TCPDI by LibreSignCLI

## 3.1.0 - 2022-04-26

# Added
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]]>
</description>
<version>3.1.0</version>
<version>3.1.1</version>
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://librecode.coop">Libre Code</author>
<documentation>
Expand Down
73 changes: 37 additions & 36 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 9 additions & 20 deletions lib/Migration/Version2040Date20211027183759.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@

use Closure;
use Doctrine\DBAL\Types\Types;
use OC\SystemConfig;
use OCA\Libresign\AppInfo\Application;
use OCA\Libresign\Command\Install;
use OCA\Libresign\Service\PdfParserService;
use OCP\DB\ISchemaWrapper;
use OCP\Files\File;
use OCP\Files\IRootFolder;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
Expand All @@ -22,28 +19,20 @@
class Version2040Date20211027183759 extends SimpleMigrationStep {
/** @var IRootFolder*/
private $root;
/** @var IDBConnection */
private $connection;
/** @var Install */
private $install;
/** @var IConfig */
private $config;
/** @var SystemConfig */
private $systemConfig;
/** @var PdfParserService */
private $PdfParserService;
/** @var array */
private $rows;
public function __construct(IRootFolder $root,
IDBConnection $connection,
IRootFolder $rootfolder,
Install $install,
IConfig $config,
SystemConfig $systemConfig) {
public function __construct(IDBConnection $connection,
IRootFolder $root,
PdfParserService $PdfParserService) {
$this->connection = $connection;
$this->install = $install;
$this->config = $config;
$this->systemConfig = $systemConfig;
$this->rootFolder = $rootfolder;
$this->root = $root;
$this->PdfParserService = $PdfParserService;
}

public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {
Expand Down Expand Up @@ -81,15 +70,15 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array
/** @var File[] */
$file = $userFolder->getById($row['node_id']);
if (count($file) >= 1) {
$data = $this->getMetadataFromCli($cli, $file[0]->getPath());
$data = $this->PdfParserService->getMetadata($file[0]->getPath());
$json = json_encode($data);
$query = $this->connection->getQueryBuilder();
$query
->update('libresign_file')
->set('metadata', $query->createNamedParameter($json))
->where($query->expr()->eq('id', $query->createNamedParameter($row['id'])));

$query->execute();
$query->executeStatement();
}
}
}
Expand Down
Loading

0 comments on commit d4a8db5

Please sign in to comment.