Skip to content

Commit 6e9ec0e

Browse files
committed
feat: update autoloading and metadata configuration, improve validation paths
1 parent 1f68ef9 commit 6e9ec0e

6 files changed

Lines changed: 8 additions & 21 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,10 @@
33
"Pohoda"
44
],
55
"workbench.colorCustomizations": {
6-
"activityBar.background": "#ba3b14",
7-
"titleBar.activeBackground": "#ba3b14",
8-
"titleBar.activeForeground": "#000000",
9-
"titleBar.inactiveBackground": "#ba3b14",
10-
"titleBar.inactiveForeground": "#000000",
11-
"titleBar.border": "#ba3b14",
12-
"activityBar.foreground": "#000000",
13-
"statusBar.background": "#ba3b14",
14-
"statusBar.foreground": "#000000",
15-
"statusBar.debuggingBackground": "#ba3b14",
16-
"statusBar.debuggingForeground": "#000000",
17-
"tab.activeBorder": "#ba3b14",
186
"iLoveWorkSpaceColors": true,
197
"iLoveWorkSpaceRandom": false,
20-
"activityBar.inactiveForeground": "#b69ed6",
218
"activityBar.activeBorder": "#f8fbf5",
22-
"activityBar.activeBackground": "#AB0552",
23-
"activityBar.border": "#AB0552",
24-
"statusBar.border": "#AB0552"
9+
"activityBar.border": "#AB0552"
2510
},
2611
"php.version": "8.4"
2712
}

debian/autoload.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
require_once '/usr/share/php/Composer/InstalledVersions.php';
66
require_once '/usr/share/php/Ease/autoload.php';
7+
require_once '/usr/share/php/Lightools/Xml/autoload.php';
8+
require_once '/usr/share/php/Riesenia/Pohoda/autoload.php';
9+
require_once '/usr/share/php/PohodaSer/autoload.php';
710

811
spl_autoload_register(function (string $class): void {
912
$prefix = 'mServer\\';

debian/io.github.vitexsoftware.php_vitexsoftware_pohoda_connector.metainfo.xml renamed to debian/php-vitexsoftware-pohoda-connector.metainfo.xml

File renamed without changes.

debian/rules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ override_dh_install:
1616
sed -i "s|'library'|'$(PKG_TYPE)'|g" debian/php-vitexsoftware-pohoda-connector/usr/share/php/mServer/autoload.php
1717
# Version stamp from main composer.json
1818
jq '.version = "$(PKG_VERSION)"' composer.json | sponge debian/php-vitexsoftware-pohoda-connector/usr/share/php/mServer/composer.json
19-
sed -i -e "s/\/\.\.\/\.\.\//\//g" debian/php-vitexsoftware-pohoda-connector/usr/share/php/mServer/Client.php
2019

2120
override_dh_auto_test:
2221
appstreamcli validate --pedantic --no-net \
23-
debian/io.github.vitexsoftware.php_vitexsoftware_pohoda_connector.metainfo.xml
22+
debian/php-vitexsoftware-pohoda-connector.metainfo.xml

src/mServer/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ public function processResponse(int $httpCode): bool
561561
}
562562

563563
if ($this->debug) {
564-
$this->addStatusMessage('validate request by: xmllint --schema '.\dirname(__DIR__, 3).'/pohodaser/xsd/data.xsd '.$this->xmlCache.' --noout', 'debug');
564+
$this->addStatusMessage('validate request by: xmllint --schema '.\Composer\InstalledVersions::getInstallPath('vitexsoftware/pohodaser').'/xsd/data.xsd '.$this->xmlCache.' --noout', 'debug');
565565
}
566566

567567
libxml_use_internal_errors(false);
@@ -665,7 +665,7 @@ public function commit(): bool
665665
$this->setPostFields(file_get_contents($this->xmlCache));
666666

667667
if ($this->debug) {
668-
$this->addStatusMessage('validate request by: xmllint --schema '.\dirname(__DIR__, 3).'/pohodaser/xsd/data.xsd '.$this->xmlCache.' --noout', 'debug');
668+
$this->addStatusMessage('validate request by: xmllint --schema '.\Composer\InstalledVersions::getInstallPath('vitexsoftware/pohodaser').'/xsd/data.xsd '.$this->xmlCache.' --noout', 'debug');
669669
}
670670

671671
return $this->performRequest('/xml');

src/mServer/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ public static function deserialize(string $rawXml): ?\Pohoda\Response\ResponsePa
675675
{
676676
$responsePack = null;
677677
$serializerBuilder = SerializerBuilder::create();
678-
$serializerBuilder->addMetadataDir(\dirname(__DIR__, 2).'/vendor/vitexsoftware/pohodaser/metadata/', 'Pohoda');
678+
$serializerBuilder->addMetadataDir(\Composer\InstalledVersions::getInstallPath('vitexsoftware/pohodaser').'/metadata/', 'Pohoda');
679679
$serializerBuilder->configureHandlers(static function (HandlerRegistryInterface $handler) use ($serializerBuilder): void {
680680
$serializerBuilder->addDefaultHandlers();
681681
$handler->registerSubscribingHandler(new BaseTypesHandler()); // XMLSchema List handling

0 commit comments

Comments
 (0)