mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
fix: isolate all dependencies
prevent conflicts with other apps Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
parent
881e237a29
commit
e407305967
15 changed files with 47 additions and 39 deletions
|
|
@ -36,13 +36,16 @@
|
|||
"openapi": "generate-spec --verbose && (npm run typescript:generate || echo 'Please manually regenerate the typescript OpenAPI models')",
|
||||
"psalm": "psalm --no-cache --threads=$(nproc)",
|
||||
"psalm:update-baseline": "psalm --threads=$(nproc) --update-baseline --set-baseline=tests/psalm-baseline.xml",
|
||||
"pre-autoload-dump": [
|
||||
"mkdir -p lib/Vendor"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"@composer bin all install --ansi",
|
||||
"php -d error_reporting=E_ALL\\&~E_DEPRECATED\\&~E_USER_DEPRECATED vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --force",
|
||||
"php -d error_reporting=E_ALL\\&~E_DEPRECATED\\&~E_USER_DEPRECATED vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --force && > lib/Vendor/.gitkeep",
|
||||
"composer dump-autoload -o"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"php -d error_reporting=E_ALL\\&~E_DEPRECATED\\&~E_USER_DEPRECATED vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --force",
|
||||
"php -d error_reporting=E_ALL\\&~E_DEPRECATED\\&~E_USER_DEPRECATED vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --force && > lib/Vendor/.gitkeep",
|
||||
"composer dump-autoload"
|
||||
],
|
||||
"test:unit": "vendor/bin/phpunit -c tests/php/phpunit.xml --no-coverage --colors=always --fail-on-warning --fail-on-risky --display-deprecations --display-phpunit-deprecations",
|
||||
|
|
@ -56,11 +59,11 @@
|
|||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"OCA\\Libresign\\": "lib/",
|
||||
"OCA\\Libresign\\Vendor\\mikehaertl\\pdftk\\": "lib/Vendor/php-pdftk/src/",
|
||||
"OCA\\Libresign\\Vendor\\mikehaertl\\shellcommand\\": "lib/Vendor/php-shellcommand/src/",
|
||||
"OCA\\Libresign\\Vendor\\mikehaertl\\tmp\\": "lib/Vendor/php-tmpfile/src/"
|
||||
}
|
||||
"OCA\\Libresign\\": "lib/"
|
||||
},
|
||||
"classmap": [
|
||||
"lib/Vendor/"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ use Exception;
|
|||
use OC\Core\Command\Base;
|
||||
use OCA\Libresign\Service\Install\InstallService;
|
||||
use OCA\Libresign\Service\Install\SignSetupService;
|
||||
use OCA\Libresign\Vendor\phpseclib\Crypt\RSA;
|
||||
use OCA\Libresign\Vendor\phpseclib\File\X509;
|
||||
use OCP\IConfig;
|
||||
use phpseclib\Crypt\RSA;
|
||||
use phpseclib\File\X509;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ declare(strict_types=1);
|
|||
namespace OCA\Libresign\Db;
|
||||
|
||||
use Doctrine\DBAL\Query\QueryBuilder;
|
||||
use OCA\Libresign\Vendor\Pagerfanta\Adapter\AdapterInterface;
|
||||
use OCA\Libresign\Vendor\Pagerfanta\Exception\InvalidArgumentException;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use Pagerfanta\Adapter\AdapterInterface;
|
||||
use Pagerfanta\Exception\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Adapter which calculates pagination from a Doctrine DBAL QueryBuilder.
|
||||
|
|
|
|||
|
|
@ -8,28 +8,28 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCA\Libresign\Handler;
|
||||
|
||||
use BaconQrCode\Encoder\Encoder;
|
||||
use Endroid\QrCode\Bacon\ErrorCorrectionLevelConverter;
|
||||
use Endroid\QrCode\Color\Color;
|
||||
use Endroid\QrCode\Encoding\Encoding;
|
||||
use Endroid\QrCode\ErrorCorrectionLevel;
|
||||
use Endroid\QrCode\QrCode;
|
||||
use Endroid\QrCode\RoundBlockSizeMode;
|
||||
use Endroid\QrCode\Writer\PngWriter;
|
||||
use Mpdf\Mpdf;
|
||||
use OCA\Libresign\AppInfo\Application;
|
||||
use OCA\Libresign\Db\File as FileEntity;
|
||||
use OCA\Libresign\Exception\LibresignException;
|
||||
use OCA\Libresign\Service\PdfParserService;
|
||||
use OCA\Libresign\Vendor\BaconQrCode\Encoder\Encoder;
|
||||
use OCA\Libresign\Vendor\Endroid\QrCode\Bacon\ErrorCorrectionLevelConverter;
|
||||
use OCA\Libresign\Vendor\Endroid\QrCode\Color\Color;
|
||||
use OCA\Libresign\Vendor\Endroid\QrCode\Encoding\Encoding;
|
||||
use OCA\Libresign\Vendor\Endroid\QrCode\ErrorCorrectionLevel;
|
||||
use OCA\Libresign\Vendor\Endroid\QrCode\QrCode;
|
||||
use OCA\Libresign\Vendor\Endroid\QrCode\RoundBlockSizeMode;
|
||||
use OCA\Libresign\Vendor\Endroid\QrCode\Writer\PngWriter;
|
||||
use OCA\Libresign\Vendor\Mpdf\Mpdf;
|
||||
use OCA\Libresign\Vendor\Twig\Environment;
|
||||
use OCA\Libresign\Vendor\Twig\Error\SyntaxError;
|
||||
use OCA\Libresign\Vendor\Twig\Loader\FilesystemLoader;
|
||||
use OCP\Files\File;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\ITempManager;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\L10N\IFactory;
|
||||
use Twig\Environment;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Loader\FilesystemLoader;
|
||||
|
||||
class FooterHandler {
|
||||
private QrCode $qrCode;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ namespace OCA\Libresign\Handler\SignEngine;
|
|||
|
||||
use Imagick;
|
||||
use ImagickPixel;
|
||||
use Jeidison\JSignPDF\JSignPDF;
|
||||
use Jeidison\JSignPDF\Sign\JSignParam;
|
||||
use OCA\Libresign\AppInfo\Application;
|
||||
use OCA\Libresign\Exception\LibresignException;
|
||||
use OCA\Libresign\Handler\CertificateEngine\CertificateEngineFactory;
|
||||
|
|
@ -20,6 +18,8 @@ use OCA\Libresign\Service\Install\InstallService;
|
|||
use OCA\Libresign\Service\SignatureBackgroundService;
|
||||
use OCA\Libresign\Service\SignatureTextService;
|
||||
use OCA\Libresign\Service\SignerElementsService;
|
||||
use OCA\Libresign\Vendor\Jeidison\JSignPDF\JSignPDF;
|
||||
use OCA\Libresign\Vendor\Jeidison\JSignPDF\Sign\JSignParam;
|
||||
use OCP\Files\File;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\ITempManager;
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ use OCA\Libresign\Handler\CertificateEngine\CertificateEngineFactory;
|
|||
use OCA\Libresign\Handler\CertificateEngine\OrderCertificatesTrait;
|
||||
use OCA\Libresign\Handler\FooterHandler;
|
||||
use OCA\Libresign\Service\FolderService;
|
||||
use OCA\Libresign\Vendor\phpseclib3\File\ASN1;
|
||||
use OCP\Files\File;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\ITempManager;
|
||||
use phpseclib3\File\ASN1;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class Pkcs12Handler extends SignEngineHandler {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ declare(strict_types=1);
|
|||
namespace OCA\Libresign\Helper;
|
||||
|
||||
use OCA\Libresign\Db\PagerFantaQueryAdapter;
|
||||
use OCA\Libresign\Vendor\Pagerfanta\Pagerfanta;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IURLGenerator;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
|
||||
class Pagination extends Pagerfanta {
|
||||
private string $routeName;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ use OCA\Libresign\Exception\LibresignException;
|
|||
use OCA\Libresign\Helper\JSActions;
|
||||
use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\AbstractSignatureMethod;
|
||||
use OCA\Libresign\Service\SessionService;
|
||||
use OCA\Libresign\Vendor\Wobeto\EmailBlur\Blur;
|
||||
use OCP\IUser;
|
||||
use Wobeto\EmailBlur\Blur;
|
||||
|
||||
abstract class AbstractIdentifyMethod implements IIdentifyMethod {
|
||||
protected IdentifyMethod $entity;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace OCA\Libresign\Service\IdentifyMethod\SignatureMethod;
|
|||
use OCA\Libresign\Exception\LibresignException;
|
||||
use OCA\Libresign\Helper\JSActions;
|
||||
use OCA\Libresign\Service\IdentifyMethod\IdentifyService;
|
||||
use Wobeto\EmailBlur\Blur;
|
||||
use OCA\Libresign\Vendor\Wobeto\EmailBlur\Blur;
|
||||
|
||||
class EmailToken extends AbstractSignatureMethod implements IToken {
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ use OCA\Libresign\Exception\InvalidSignatureException;
|
|||
use OCA\Libresign\Exception\LibresignException;
|
||||
use OCA\Libresign\Exception\SignatureDataNotFoundException;
|
||||
use OCA\Libresign\Handler\CertificateEngine\CertificateHelper;
|
||||
use OCA\Libresign\Vendor\phpseclib\Crypt\RSA;
|
||||
use OCA\Libresign\Vendor\phpseclib\File\X509;
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\Files\AppData\IAppDataFactory;
|
||||
use OCP\Files\IAppData;
|
||||
|
|
@ -25,8 +27,6 @@ use OCP\Files\SimpleFS\ISimpleFolder;
|
|||
use OCP\IAppConfig;
|
||||
use OCP\IConfig;
|
||||
use OCP\ITempManager;
|
||||
use phpseclib\Crypt\RSA;
|
||||
use phpseclib\File\X509;
|
||||
|
||||
class SignSetupService {
|
||||
private array $exclude = [
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@ declare(strict_types=1);
|
|||
namespace OCA\Libresign\Service;
|
||||
|
||||
use OCA\Libresign\Exception\LibresignException;
|
||||
use OCA\Libresign\Vendor\Smalot\PdfParser\Document;
|
||||
use OCA\Libresign\Vendor\Smalot\PdfParser\Parser;
|
||||
use OCP\Files\File;
|
||||
use OCP\ITempManager;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Smalot\PdfParser\Document;
|
||||
|
||||
class PdfParserService {
|
||||
private string $content = '';
|
||||
|
|
@ -52,7 +53,7 @@ class PdfParserService {
|
|||
if (!$this->document) {
|
||||
$content = $this->getContent();
|
||||
try {
|
||||
$parser = new \Smalot\PdfParser\Parser();
|
||||
$parser = new Parser();
|
||||
$this->document = $parser->parseContent($content);
|
||||
return $this->document;
|
||||
} catch (\Throwable $th) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ use ImagickDraw;
|
|||
use ImagickPixel;
|
||||
use OCA\Libresign\AppInfo\Application;
|
||||
use OCA\Libresign\Exception\LibresignException;
|
||||
use OCA\Libresign\Vendor\Twig\Environment;
|
||||
use OCA\Libresign\Vendor\Twig\Error\SyntaxError;
|
||||
use OCA\Libresign\Vendor\Twig\Loader\FilesystemLoader;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\IDateTimeZone;
|
||||
use OCP\IL10N;
|
||||
|
|
@ -21,9 +24,6 @@ use OCP\IRequest;
|
|||
use OCP\IUserSession;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Sabre\DAV\UUIDUtil;
|
||||
use Twig\Environment;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Loader\FilesystemLoader;
|
||||
|
||||
class SignatureTextService {
|
||||
public const TEMPLATE_DEFAULT_FONT_SIZE = 10;
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCA\Libresign\Service;
|
||||
|
||||
use OCA\Libresign\Vendor\setasign\Fpdi\PdfParserService\Type\PdfTypeException;
|
||||
use OCP\Files\Node;
|
||||
use OCP\Http\Client\IClientService;
|
||||
use setasign\Fpdi\PdfParserService\Type\PdfTypeException;
|
||||
|
||||
trait TFile {
|
||||
/** @var ?string */
|
||||
|
|
|
|||
0
lib/Vendor/.gitkeep
vendored
Normal file
0
lib/Vendor/.gitkeep
vendored
Normal file
|
|
@ -18,8 +18,12 @@ return [
|
|||
'finders' => [
|
||||
Finder::create()->files()
|
||||
->exclude([
|
||||
'vendor-bin'
|
||||
'bamarni',
|
||||
'bin',
|
||||
'composer',
|
||||
'nextcloud',
|
||||
])
|
||||
->in('vendor/mikehaertl'),
|
||||
->notName('autoload.php')
|
||||
->in('vendor'),
|
||||
],
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue