Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

determine the vendor root dir based on the composer classloader #499

Merged
merged 2 commits into from
May 10, 2023

Conversation

mollux
Copy link
Contributor

@mollux mollux commented Apr 30, 2023

When the vendor folder is not in the %kernel.project_dir%, the elfinder:install command fails:

./bin/console elfinder:install

elFinder Installer
==================

 // Trying to install elfinder to public directory

 ! [NOTE] Starting to install elfinder to /var/www/html/docroot/public/bundles/fmelfinder folder


In Filesystem.php line 544:

  The origin directory specified "/var/www/html/docroot/vendor/studio-42/elfinder/css" was not found.

This is typically the case when the vendor folder is outside of the webroot dir, which is from security point of view a best practice.

This PR ensures the vendor folder location is determined based on the composer classloader.
This both works for application with the vendor inside and outside the webroot dir.

@helios-ag
Copy link
Owner

great, thank you!

@escopecz
Copy link

Is there any chance that this will be merged any time soon? It's complicating things on our side.

@helios-ag helios-ag merged commit 735b9b0 into helios-ag:main May 10, 2023
4 checks passed
@helios-ag
Copy link
Owner

hi, sure

@helios-ag
Copy link
Owner

tagged as 12.3

escopecz added a commit to escopecz/mautic that referenced this pull request May 11, 2023
... See helios-ag/FMElfinderBundle#499

Revert this commit once that PR is merged.
mautibot pushed a commit to mautic/core-lib that referenced this pull request May 11, 2023
... See helios-ag/FMElfinderBundle#499

Revert this commit once that PR is merged.
@zdebol
Copy link

zdebol commented Jan 18, 2024

I have problem when vendor dir is example /var/www/some-name/vendor/some-hash-id and line $vendorRootDir = dirname($reflection->getFileName(), 3); return /var/www/some-name/vendor and concat with ELFINDER_CSS_DIR gives to /var/www/some-name/vendor/vendor/studio-42/elfinder/css and error in install. Change level in dirname to 4 return correct dir but this is not solution.

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

Successfully merging this pull request may close these issues.

None yet

4 participants