Fixes
Some checks failed
Gitea Actions / Run-Tests-On-Arm64 (push) Failing after 1m58s
Gitea Actions / Run-Tests-On-Amd64 (push) Failing after 3m33s

This commit is contained in:
Thomas 2025-05-23 15:21:45 +02:00
parent 70d096f866
commit 140badb63e
9 changed files with 105 additions and 84 deletions

View File

@ -8,7 +8,16 @@ services:
- ${APPLICATION_CODE_PATH_HOST?}:${APPLICATION_CODE_PATH_CONTAINER?} - ${APPLICATION_CODE_PATH_HOST?}:${APPLICATION_CODE_PATH_CONTAINER?}
php-cron: php-cron:
environment: environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG?}
- APP_ENV=dev - APP_ENV=dev
networks:
- network
cap_add:
- "SYS_PTRACE"
security_opt:
- "seccomp=unconfined"
extra_hosts:
- host.docker.internal:host-gateway
volumes: volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?} - ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
web: web:
@ -28,18 +37,6 @@ services:
volumes: volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?} - ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
php-cron:
environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG?}
networks:
- network
cap_add:
- "SYS_PTRACE"
security_opt:
- "seccomp=unconfined"
extra_hosts:
- host.docker.internal:host-gateway
chrome: chrome:
ports: ports:
- "7900:7900" - "7900:7900"

View File

@ -21,7 +21,11 @@ class Kernel extends BaseKernel
try { try {
if (extension_loaded('mongodb')) { if (extension_loaded('mongodb')) {
if ($_ENV['APP_ENV'] == 'test') {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin;
} else {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin;
}
$plugins = $collection->find(array('installed' => true)); $plugins = $collection->find(array('installed' => true));

View File

@ -25,7 +25,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
*/ */
class PSCShopThemeBundle extends Bundle class PSCShopThemeBundle extends Bundle
{ {
public function build(ContainerBuilder $container) public function build(ContainerBuilder $container)
{ {
parent::build($container); parent::build($container);
@ -33,7 +32,12 @@ class PSCShopThemeBundle extends Bundle
try { try {
if (extension_loaded('mongodb')) { if (extension_loaded('mongodb')) {
if ($_ENV['APP_ENV'] == 'test') {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin;
} else {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin;
}
$plugins = $collection->find(array('installed' => true)); $plugins = $collection->find(array('installed' => true));
foreach ($plugins as $plugin) { foreach ($plugins as $plugin) {

View File

@ -18,7 +18,12 @@ class PluginCompiler implements CompilerPassInterface
public function process(ContainerBuilder $container) public function process(ContainerBuilder $container)
{ {
try { try {
if ($_ENV['APP_ENV'] == 'test') {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin;
} else {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin;
}
$plugins = $collection->find(array('installed' => true)); $plugins = $collection->find(array('installed' => true));
/** /**
* @var Plugin $plugin * @var Plugin $plugin

View File

@ -47,7 +47,12 @@ class PSCSystemPluginExtension extends Extension implements PrependExtensionInte
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yml'); $loader->load('services.yml');
try { try {
if ($_ENV['APP_ENV'] == 'test') {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin;
} else {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin;
}
$plugins = $collection->find(array('installed' => true)); $plugins = $collection->find(array('installed' => true));
foreach ($plugins as $plugin) { foreach ($plugins as $plugin) {
if (file_exists($container->getParameter('kernel.project_dir') . '/var/plugins/' . $plugin['path'] . '/Resources/config/services.yml')) { if (file_exists($container->getParameter('kernel.project_dir') . '/var/plugins/' . $plugin['path'] . '/Resources/config/services.yml')) {

View File

@ -25,7 +25,12 @@ class RequestListener
public function onKernelRequest(RequestEvent $event) public function onKernelRequest(RequestEvent $event)
{ {
try { try {
if ($_ENV['APP_ENV'] == 'test') {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin;
} else {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin;
}
} catch (\Exception $e) { } catch (\Exception $e) {
return; return;
} }

View File

@ -15,7 +15,7 @@ use Symfony\Component\Yaml\Yaml;
class PluginRouteLoader extends Loader class PluginRouteLoader extends Loader
{ {
protected $rootDir; protected $rootDir;
/** /**
* DynamicRouteLoader constructor. * DynamicRouteLoader constructor.
* *
*/ */
@ -37,7 +37,12 @@ class PluginRouteLoader extends Loader
{ {
$routes = new RouteCollection(); $routes = new RouteCollection();
try { try {
if ($_ENV['APP_ENV'] == 'test') {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin;
} else {
$collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin;
}
$plugins = $collection->find(array('installed' => true)); $plugins = $collection->find(array('installed' => true));
/** @var Plugin $plugin */ /** @var Plugin $plugin */
foreach ($plugins as $plugin) { foreach ($plugins as $plugin) {

View File

@ -157,8 +157,6 @@ trait RefreshDatabaseTrait
$doc->clear(); $doc->clear();
} }
return $kernel; return $kernel;
} }

View File

@ -35,7 +35,6 @@
*/ */
class PreflightController extends TP_Controller_Action class PreflightController extends TP_Controller_Action
{ {
protected $_extAllow = 'ppt,inx,idml,indd,qxd,ps,cdr,cdx,jpg,gif,pdf,xls,docx,png,doc,jpeg,tif,tiff,ai,eps,psd,phtml,zip,jrxml,ttf,otf,plt,csv,docx,xlsx,pptx,svg'; protected $_extAllow = 'ppt,inx,idml,indd,qxd,ps,cdr,cdx,jpg,gif,pdf,xls,docx,png,doc,jpeg,tif,tiff,ai,eps,psd,phtml,zip,jrxml,ttf,otf,plt,csv,docx,xlsx,pptx,svg';
protected function FileSize($file, $setup = null) protected function FileSize($file, $setup = null)
@ -47,8 +46,7 @@ class PreflightController extends TP_Controller_Action
return number_format($FZ / pow(1024, $I = floor(log($FZ, 1024))), ($i >= 1) ? 2 : 0) . ' ' . $FS[$I]; return number_format($FZ / pow(1024, $I = floor(log($FZ, 1024))), ($i >= 1) ? 2 : 0) . ' ' . $FS[$I];
} elseif ($setup == 'INT') { } elseif ($setup == 'INT') {
return number_format($FZ); return number_format($FZ);
} } else {
else {
return number_format($FZ / pow(1024, $setup), ($setup >= 1) ? 2 : 0) . ' ' . $FS[$setup]; return number_format($FZ / pow(1024, $setup), ($setup >= 1) ? 2 : 0) . ' ' . $FS[$setup];
} }
} }
@ -142,10 +140,10 @@ class PreflightController extends TP_Controller_Action
$xml = file_get_contents(APPLICATION_PATH . '/articles/' . $this->frontend, null); $xml = file_get_contents(APPLICATION_PATH . '/articles/' . $this->frontend, null);
} }
if($article->typ == 100) { if ($article->typ == 100) {
$xml = $article->getPluginSettings('saxoprint', 'uploadXML'); $xml = $article->getPluginSettings('saxoprint', 'uploadXML');
} }
if($article->typ == 101) { if ($article->typ == 101) {
$xml = $article->getPluginSettings('wmd', 'uploadXML'); $xml = $article->getPluginSettings('wmd', 'uploadXML');
} }
@ -162,7 +160,7 @@ class PreflightController extends TP_Controller_Action
$checksMessages = array(); $checksMessages = array();
foreach ($xml as $article) { foreach ($xml as $article) {
if((string)$article->name != $this->_getParam('kalk_artikel') || !$this->_getParam('kalk_artikel', false)) { if ((string)$article->name != $this->_getParam('kalk_artikel') || !$this->_getParam('kalk_artikel', false)) {
continue; continue;
} }
foreach ($article->uploads->children() as $upload) { foreach ($article->uploads->children() as $upload) {
@ -193,7 +191,7 @@ class PreflightController extends TP_Controller_Action
} }
} }
if ($isPdf && ((int)$check->check_site_count > 0 || $check->check_site_count_rel != "")) { if (false && $isPdf && ((int)$check->check_site_count > 0 || $check->check_site_count_rel != "")) {
try { try {
$p = new pdflib(); $p = new pdflib();
@ -221,10 +219,10 @@ class PreflightController extends TP_Controller_Action
} elseif (strpos($check->check_site_count_rel, '+')) { } elseif (strpos($check->check_site_count_rel, '+')) {
$sum = explode("+", $check->check_site_count_rel); $sum = explode("+", $check->check_site_count_rel);
$seitenCount = 0; $seitenCount = 0;
foreach($sum as $sumKey) { foreach ($sum as $sumKey) {
$seitenCount += $this->_getParam($sumKey); $seitenCount += $this->_getParam($sumKey);
} }
if($seitenCount != $anzahlSeiten) { if ($seitenCount != $anzahlSeiten) {
$checksMessages[] = array( $checksMessages[] = array(
'message' => str_replace("{value}", $seitenCount, $check->check_site_count_error_message), 'message' => str_replace("{value}", $seitenCount, $check->check_site_count_error_message),
'nr' => $check->nr 'nr' => $check->nr
@ -234,14 +232,14 @@ class PreflightController extends TP_Controller_Action
} elseif (strpos($check->check_site_count_rel, '*')) { } elseif (strpos($check->check_site_count_rel, '*')) {
$sum = explode("*", $check->check_site_count_rel); $sum = explode("*", $check->check_site_count_rel);
$seitenCount = 0; $seitenCount = 0;
foreach($sum as $sumKey) { foreach ($sum as $sumKey) {
if($seitenCount == 0) { if ($seitenCount == 0) {
$seitenCount = $this->_getParam($sumKey); $seitenCount = $this->_getParam($sumKey);
}else{ } else {
$seitenCount = $seitenCount * $this->_getParam($sumKey); $seitenCount = $seitenCount * $this->_getParam($sumKey);
} }
} }
if($seitenCount != $anzahlSeiten) { if ($seitenCount != $anzahlSeiten) {
$checksMessages[] = array( $checksMessages[] = array(
'message' => str_replace("{value}", $seitenCount, $check->check_site_count_error_message), 'message' => str_replace("{value}", $seitenCount, $check->check_site_count_error_message),
'nr' => $check->nr 'nr' => $check->nr
@ -372,7 +370,7 @@ class PreflightController extends TP_Controller_Action
$boxes[] = "ArtBox"; $boxes[] = "ArtBox";
} }
if ($isPdf && $check->check_fonts_embedded) { if (false && $isPdf && $check->check_fonts_embedded) {
$p = new pdflib(); $p = new pdflib();
$indoc = $p->open_pdi_document($file, ""); $indoc = $p->open_pdi_document($file, "");
@ -380,7 +378,7 @@ class PreflightController extends TP_Controller_Action
for ($i = 0; $i < $fontcount; $i++) { for ($i = 0; $i < $fontcount; $i++) {
if($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) { if ($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) {
$checksMessages[] = array( $checksMessages[] = array(
'message' => $check->check_fonts_embedded_error_message, 'message' => $check->check_fonts_embedded_error_message,
'nr' => $check->nr 'nr' => $check->nr
@ -391,7 +389,7 @@ class PreflightController extends TP_Controller_Action
} }
} }
if ($isPdf && count($boxes) > 0 && count($checks) > 0) { if (false && $isPdf && count($boxes) > 0 && count($checks) > 0) {
$isFormat = false; $isFormat = false;
@ -420,10 +418,10 @@ class PreflightController extends TP_Controller_Action
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to']) && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to'])
|| (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from'] || (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to'])) && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to']))
) { ) {
$isFormat = true; $isFormat = true;
@ -529,7 +527,7 @@ class PreflightController extends TP_Controller_Action
} }
} }
if ($isPdf && ((int)$check->check_site_count || $check->check_site_count_rel)) { if (false && $isPdf && ((int)$check->check_site_count || $check->check_site_count_rel)) {
$p = new pdflib(); $p = new pdflib();
$indoc = $p->open_pdi_document($file, ""); $indoc = $p->open_pdi_document($file, "");
@ -673,7 +671,7 @@ class PreflightController extends TP_Controller_Action
$boxes[] = "ArtBox"; $boxes[] = "ArtBox";
} }
if ($isPdf && $check->check_fonts_embedded) { if (false && $isPdf && $check->check_fonts_embedded) {
$p = new pdflib(); $p = new pdflib();
$indoc = $p->open_pdi_document($file, ""); $indoc = $p->open_pdi_document($file, "");
@ -681,7 +679,7 @@ class PreflightController extends TP_Controller_Action
for ($i = 0; $i < $fontcount; $i++) { for ($i = 0; $i < $fontcount; $i++) {
if($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) { if ($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) {
$checksMessages[] = array( $checksMessages[] = array(
'message' => $check->check_fonts_embedded_error_message, 'message' => $check->check_fonts_embedded_error_message,
'nr' => $check->nr 'nr' => $check->nr
@ -692,7 +690,7 @@ class PreflightController extends TP_Controller_Action
} }
} }
if ($isPdf && count($boxes) > 0 && count($checks) > 0) { if (false && $isPdf && count($boxes) > 0 && count($checks) > 0) {
$isFormat = false; $isFormat = false;
@ -717,14 +715,14 @@ class PreflightController extends TP_Controller_Action
foreach ($boxes as $key => $box) { foreach ($boxes as $key => $box) {
try { try {
if (!$isFormat && (( round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) >= $ck['width_from'] if (!$isFormat && ((round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) >= $ck['width_from']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to']) && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to'])
|| (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from'] || (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from']
&& round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to'])) && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to']))
) { ) {
$isFormat = true; $isFormat = true;
@ -1009,10 +1007,10 @@ class PreflightController extends TP_Controller_Action
if($article->typ == 100) { if ($article->typ == 100) {
$xml = $article->getPluginSettings('saxoprint', 'uploadXML'); $xml = $article->getPluginSettings('saxoprint', 'uploadXML');
} }
if($article->typ == 101) { if ($article->typ == 101) {
$xml = $article->getPluginSettings('wmd', 'uploadXML'); $xml = $article->getPluginSettings('wmd', 'uploadXML');
} }
@ -1021,25 +1019,25 @@ class PreflightController extends TP_Controller_Action
$uploads = array(); $uploads = array();
$params = $this->_getAllParams(); $params = $this->_getAllParams();
if($config = $article->getPluginSettings('uploads', 'config')) { if ($config = $article->getPluginSettings('uploads', 'config')) {
$config = json_decode($config, true); $config = json_decode($config, true);
if(is_array($config['uploads'])) { if (is_array($config['uploads'])) {
foreach ($config['uploads'] as $upload) { foreach ($config['uploads'] as $upload) {
$up[] = array( $up[] = array(
'id' => (string)$upload['id'], 'id' => (string)$upload['id'],
'name' => (string)$upload['name'], 'name' => (string)$upload['name'],
'description' => (string)$upload['description']??'' 'description' => (string)$upload['description'] ?? ''
); );
if($this->_getParam('which', false)) { if ($this->_getParam('which', false)) {
$uploads[$this->_getParam('which', 'false')] = $up; $uploads[$this->_getParam('which', 'false')] = $up;
}else{ } else {
$uploads['Kalk'] = $up; $uploads['Kalk'] = $up;
} }
} }
} }
} }
if(empty($uploads)) { if (empty($uploads)) {
foreach ($xml as $article) { foreach ($xml as $article) {
$up = array(); $up = array();
foreach ($article->uploads->children() as $upload) { foreach ($article->uploads->children() as $upload) {
@ -1059,11 +1057,11 @@ class PreflightController extends TP_Controller_Action
$this->view->clearVars(); $this->view->clearVars();
if($this->_getParam('which', false)) { if ($this->_getParam('which', false)) {
$this->view->uploads = $uploads[$this->_getParam('which')]; $this->view->uploads = $uploads[$this->_getParam('which')];
}elseif(count($uploads) > 0) { } elseif (count($uploads) > 0) {
$this->view->uploads = array_shift($uploads); $this->view->uploads = array_shift($uploads);
}else{ } else {
$this->view->uploads = []; $this->view->uploads = [];
} }
$this->view->success = true; $this->view->success = true;