]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix merge conflicts
authorGeorg Ehrke <developer@georgehrke.com>
Thu, 6 Mar 2014 10:55:45 +0000 (11:55 +0100)
committerGeorg Ehrke <developer@georgehrke.com>
Thu, 6 Mar 2014 10:55:45 +0000 (11:55 +0100)
1  2 
lib/private/preview/office.php

index 269e1dad74efab0875d02425153e0cd0939d71f8,131bc9a0dc423f76b7c6ea770b458fc508a987d0..882c4426e6d245c692f1e3a7a9b8c7e54f400202
@@@ -6,27 -6,19 +6,27 @@@
   * See the COPYING-README file.
   */
  //both, libreoffice backend and php fallback, need imagick
 -if (extension_loaded('imagick') && count(@\Imagick::queryFormats("PDF")) === 1) {
 -      $isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
 +if (extension_loaded('imagick')) {
  
 -      // LibreOffice preview is currently not supported on Windows
 -      if (!\OC_Util::runningOnWindows()) {
 -              $whichLibreOffice = ($isShellExecEnabled ? shell_exec('command -v libreoffice') : '');
 -              $isLibreOfficeAvailable = !empty($whichLibreOffice);
 -              $whichOpenOffice = ($isShellExecEnabled ? shell_exec('command -v libreoffice') : '');
 -              $isOpenOfficeAvailable = !empty($whichOpenOffice);
 -              //let's see if there is libreoffice or openoffice on this machine
 -              if($isShellExecEnabled && ($isLibreOfficeAvailable || $isOpenOfficeAvailable || is_string(\OC_Config::getValue('preview_libreoffice_path', null)))) {
 -                      require_once('office-cl.php');
 -              }else{
 +      $checkImagick = new Imagick();
 +
 +      if(count($checkImagick->queryFormats('PDF')) === 1) {
 +              $isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
 +
 +              // LibreOffice preview is currently not supported on Windows
 +              if (!\OC_Util::runningOnWindows()) {
-                       $whichLibreOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
++                      $whichLibreOffice = ($isShellExecEnabled ? shell_exec('command -v libreoffice') : '');
 +                      $isLibreOfficeAvailable = !empty($whichLibreOffice);
-                       $whichOpenOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
++                      $whichOpenOffice = ($isShellExecEnabled ? shell_exec('command -v libreoffice') : '');
 +                      $isOpenOfficeAvailable = !empty($whichOpenOffice);
 +                      //let's see if there is libreoffice or openoffice on this machine
 +                      if($isShellExecEnabled && ($isLibreOfficeAvailable || $isOpenOfficeAvailable || is_string(\OC_Config::getValue('preview_libreoffice_path', null)))) {
 +                              require_once('office-cl.php');
 +                      }else{
 +                              //in case there isn't, use our fallback
 +                              require_once('office-fallback.php');
 +                      }
 +              } else {
                        //in case there isn't, use our fallback
                        require_once('office-fallback.php');
                }