Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

PHP Fatal error when installing in custom apps path #219

Open
enbrnz opened this issue Jan 30, 2023 · 2 comments
Open

PHP Fatal error when installing in custom apps path #219

enbrnz opened this issue Jan 30, 2023 · 2 comments

Comments

@enbrnz
Copy link

enbrnz commented Jan 30, 2023

When installing data_exporter in /var/www/owncloud/custom any occ command fails with:

PHP Fatal error:  require(): Failed opening required '/mnt/data/apps/data_exporter/lib/../../../version.php' (include_path='/var/www/owncloud/apps:/var/www/owncloud/custom') in /mnt/data/apps/data_exporter/lib/Platform.php on line 51

Steps to reproduce

  1. Start standard ownCloud docker server container
  2. Install data_exporter in /mnt/data/apps (the docker container has a symlink in /var/www/owncloud/custom pointing to /mnt/data/apps)

Expected behaviour

Data exporter should work

Actual behaviour

Exception being thrown

@jnweiger
Copy link
Contributor

data_exporter 0.2.1 works fine, when installed in /var/www/owncloud/apps-external/data_exporter

Was that with docker?

@jnweiger
Copy link
Contributor

Trivial reproducer without docker:

  • install data_exporter in /var/www/owncloud/apps-external
  • occ app:ena data_exporter -> occ instance:export:user alice /tmp/export -> OK
  • mkdir /tmp/owncloud; mv /var/www/owncloud/apps-external /tmp/owncloud
  • vi config.php -> change /var/www/owncloud/apps-external into /tmp/owncloud/apps-external
  • occ
    PHP Fatal error: require(): Failed opening required '/tmp/owncloud/apps-external/data_exporter/lib/../../../version.php' (include_path='/var/www/owncloud/apps:/tmp/owncloud/apps-external') in /tmp/owncloud/apps-external/data_exporter/lib/Platform.php on line 51

Code in data_exporter/lib/Platform.php expects all apps folders to be in-core:

       public function __construct(IAppManager $appManager, $versionFile = __DIR__ . '/../../../version.php') {
                $this->loadVersion($versionFile);
                $this->appManager = $appManager;
        }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants