Skip to content
Snippets Groups Projects
Commit e3489b36 authored by Thomas Müller's avatar Thomas Müller
Browse files

any preview requiring the which command will not be used on Windows

parent 86f6f0ca
Branches
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
*/ */
namespace OC\Preview; namespace OC\Preview;
// movie preview is currently not supported on Windows
if (!\OC_Util::runningOnWindows()) {
$isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions'))); $isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions')));
$whichAVCONV = shell_exec('which avconv'); $whichAVCONV = shell_exec('which avconv');
$isAVCONVAvailable = !empty($whichAVCONV); $isAVCONVAvailable = !empty($whichAVCONV);
...@@ -45,3 +47,5 @@ if($isShellExecEnabled && $isAVCONVAvailable) { ...@@ -45,3 +47,5 @@ if($isShellExecEnabled && $isAVCONVAvailable) {
\OC\Preview::registerProvider('OC\Preview\Movie'); \OC\Preview::registerProvider('OC\Preview\Movie');
} }
}
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
*/ */
namespace OC\Preview; namespace OC\Preview;
// office preview is currently not supported on Windows
if (!\OC_Util::runningOnWindows()) {
//we need imagick to convert //we need imagick to convert
class Office extends Provider { class Office extends Provider {
...@@ -132,3 +135,4 @@ class StarOffice extends Office { ...@@ -132,3 +135,4 @@ class StarOffice extends Office {
} }
\OC\Preview::registerProvider('OC\Preview\StarOffice'); \OC\Preview::registerProvider('OC\Preview\StarOffice');
}
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
//both, libreoffice backend and php fallback, need imagick //both, libreoffice backend and php fallback, need imagick
if (extension_loaded('imagick')) { if (extension_loaded('imagick')) {
$isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions'))); $isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions')));
// movie preview is currently not supported on Windows
if (!\OC_Util::runningOnWindows()) {
$whichLibreOffice = shell_exec('which libreoffice'); $whichLibreOffice = shell_exec('which libreoffice');
$isLibreOfficeAvailable = !empty($whichLibreOffice); $isLibreOfficeAvailable = !empty($whichLibreOffice);
$whichOpenOffice = shell_exec('which libreoffice'); $whichOpenOffice = shell_exec('which libreoffice');
...@@ -19,4 +22,8 @@ if (extension_loaded('imagick')) { ...@@ -19,4 +22,8 @@ if (extension_loaded('imagick')) {
//in case there isn't, use our fallback //in case there isn't, use our fallback
require_once('office-fallback.php'); require_once('office-fallback.php');
} }
} else {
//in case there isn't, use our fallback
require_once('office-fallback.php');
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment