-
Notifications
You must be signed in to change notification settings - Fork 198
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
Makes temp dir configurable #165
Conversation
These changes make it posible to set the temp dir used by the glide server to store images for processing. Since this must be a local path we check if the path exists and is writable by php. Otherwise an exception is thrown. By default the tempDir property is set to sys_get_temp_dir() so no changes are required for existing systems.
@jaapio Out of curiosity, what host were you having these issues with? I honestly thought there was a standard way of getting the available temp directory on any PHP based web server. |
We are using mod-ruid to let the application run as the owner of the files. This user has a base_dir restriction so php is not allowed to access /tmp |
I also get this issue when working in my local environment OSX. It's fine when working with Host. Can we merge this pull request so that dev can adjust the tmp dir dynamically. Thank you |
Can anyone explain me how I would go about using this fix to set the tmp folder in the root of my laravel project for example? |
We've also got the issue. Could you merge this pr, please? |
I wonder why Travis builds failed here. |
Nasty workaround: <?php
namespace League\Glide {
/**
* Monkey patch temp dir on shared hosting (open_base conflict)
* @return string
*/
function sys_get_temp_dir(): string
{
$nativeSysTempDir = \sys_get_temp_dir();
// Your detection mechanism
if (strpos($nativeSysTempDir, '/home/fcgid/') !== 0) {
return $nativeSysTempDir;
}
return ini_get('upload_tmp_dir');
}
} |
This sould be fixed by #304, can anyone confirm? |
These changes make it posible to set the temp dir used by
the glide server to store images for processing.
Since this must be a local path we check if the path exists and is
writable by php. Otherwise an exception is thrown.
By default the tempDir property is set to
sys_get_temp_dir()
so nochanges are required for existing systems.
Fixes #156