Skip to content

Commit

Permalink
try to fix api php autoloader for debian
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Dec 22, 2024
1 parent b8723f0 commit e421fbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions debian/multiflexi-api.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ if [ "$1" = "configure" ] ; then

# Add require deb/multiflexi-api in any version
jq '.require += {
"deb/multiflexi-api": "*"
"deb/multiflexi-api": "*",
"php-di/slim-bridge": "^3.4",
"slim/psr7": "^1.5",
"dyorg/slim-token-authentication": "dev-slim4",
"tuupola/slim-basic-auth": "^3.0"
}' /usr/lib/multiflexi/composer.json > /usr/lib/multiflexi/composer.json.tmp
mv /usr/lib/multiflexi/composer.json.tmp /usr/lib/multiflexi/composer.json

composer-debian multiflexi

# Use sed to add the include statement before $builder = new ContainerBuilder();
sed -i "/\$builder = new ContainerBuilder();/i require_once '\/usr\/share\/php\/Symfony\/Component\/DependencyInjection\/autoload.php';" /usr/share/multiflexi/api/index.php


fi
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ override_dh_install:
rm debian/multiflexi/usr/lib/multiflexi/zabbixcompanylld.php
rm debian/multiflexi/usr/lib/multiflexi/zabbixlld.php
rm debian/multiflexi/usr/lib/multiflexi/zabbixlldactions.php
sed -i "/require_once __DIR__/crequire_once '/var/lib/composer/multiflexi/autoload.php'; require_once '/usr/share/php/Symfony/Component/DependencyInjection/autoload.php'; " debian/multiflexi-api/usr/share/multiflexi/api/index.php
sed -i "/require_once __DIR__/crequire_once '/var/lib/composer/multiflexi/autoload.php'; " debian/multiflexi-api/usr/share/multiflexi/api/index.php
sed -i "/loadConfig/c\\\\\Ease\\\\Shared::singleton()->loadConfig('/etc/multiflexi/multiflexi.env', true);" debian/multiflexi-api/usr/share/multiflexi/api/index.php
sed -i "/setBasePath/c\$$app->setBasePath('/api');" debian/multiflexi-api/usr/share/multiflexi/api/index.php
sed -i "s/\/MultiFlexi\/src//" debian/multiflexi-api/usr/share/multiflexi/api/index.php

0 comments on commit e421fbd

Please sign in to comment.