Skip to content
Snippets Groups Projects
Commit 0274dcba authored by Joas Schilling's avatar Joas Schilling
Browse files

Replace some more "command -v" calls with the Helper method

parent 6fb2477f
No related branches found
No related tags found
No related merge requests found
...@@ -139,13 +139,8 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ ...@@ -139,13 +139,8 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
* check if smbclient is installed * check if smbclient is installed
*/ */
public static function checkDependencies() { public static function checkDependencies() {
if (function_exists('shell_exec')) { $smbClientExists = (bool) \OC_Helper::findBinaryPath('smbclient');
$output=shell_exec('command -v smbclient 2> /dev/null'); return $smbClientExists ? true : array('smbclient');
if (!empty($output)) {
return true;
}
}
return array('smbclient');
} }
} }
...@@ -558,8 +558,8 @@ class OC_Installer{ ...@@ -558,8 +558,8 @@ class OC_Installer{
// is the code checker enabled? // is the code checker enabled?
if(OC_Config::getValue('appcodechecker', true)) { if(OC_Config::getValue('appcodechecker', true)) {
// check if grep is installed // check if grep is installed
$grep = exec('command -v grep'); $grep = \OC_Helper::findBinaryPath('grep');
if($grep=='') { if (!$grep) {
OC_Log::write('core', OC_Log::write('core',
'grep not installed. So checking the code of the app "'.$appname.'" was not possible', 'grep not installed. So checking the code of the app "'.$appname.'" was not possible',
OC_Log::ERROR); OC_Log::ERROR);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment