]> source.dussan.org Git - nextcloud-server.git/commitdiff
Replace some more "command -v" calls with the Helper method
authorJoas Schilling <nickvergessen@gmx.de>
Tue, 25 Nov 2014 10:06:26 +0000 (11:06 +0100)
committerJoas Schilling <nickvergessen@gmx.de>
Tue, 25 Nov 2014 17:10:03 +0000 (18:10 +0100)
apps/files_external/lib/smb.php
lib/private/installer.php

index 6e53c4a99310c9805ac8b5e76b886cb3a91bf4a8..3f0b0f45bfb0eef63858d7895f2440f262d99a05 100644 (file)
@@ -139,13 +139,8 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
         * check if smbclient is installed
         */
        public static function checkDependencies() {
-               if (function_exists('shell_exec')) {
-                       $output=shell_exec('command -v smbclient 2> /dev/null');
-                       if (!empty($output)) {
-                               return true;
-                       }
-               }
-               return array('smbclient');
+               $smbClientExists = (bool) \OC_Helper::findBinaryPath('smbclient');
+               return $smbClientExists ? true : array('smbclient');
        }
 
 }
index cd1d8ce392ff638228093f571f4ff5b2b9b3e526..f43969691c7bfec319000734afd79933877ed821 100644 (file)
@@ -558,8 +558,8 @@ class OC_Installer{
                // is the code checker enabled?
                if(OC_Config::getValue('appcodechecker', true)) {
                        // check if grep is installed
-                       $grep = exec('command -v grep');
-                       if($grep=='') {
+                       $grep = \OC_Helper::findBinaryPath('grep');
+                       if (!$grep) {
                                OC_Log::write('core',
                                        'grep not installed. So checking the code of the app "'.$appname.'" was not possible',
                                        OC_Log::ERROR);