fixed bugs
This commit is contained in:
@@ -44,7 +44,7 @@ class Aria2
|
||||
$this->bin = Helper::findBinaryPath('aria2c', __DIR__ . "/../../bin/aria2c");
|
||||
}
|
||||
if ($this->isInstalled() && !$this->isExecutable()) {
|
||||
chmod($this->bin, 755);
|
||||
chmod($this->bin, 0744);
|
||||
}
|
||||
$this->setDownloadDir($dir);
|
||||
$this->setTorrentsDir($torrents_dir);
|
||||
|
||||
@@ -209,8 +209,10 @@ class Helper
|
||||
$exeSniffer = new ExecutableFinder();
|
||||
// Returns null if nothing is found
|
||||
$result = $exeSniffer->find($program, $default, $paths);
|
||||
// store the value for 5 minutes
|
||||
$memcache->set($program, $result, 300);
|
||||
if ($result) {
|
||||
// store the value for 5 minutes
|
||||
$memcache->set($program, $result, 300);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -324,4 +326,9 @@ class Helper
|
||||
return self::doSignal($pid, 9);
|
||||
}
|
||||
|
||||
public static function pythonInstalled()
|
||||
{
|
||||
return (bool) self::findBinaryPath('python');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class Youtube
|
||||
$this->bin = Helper::findBinaryPath('youtube-dl', __DIR__ . "/../../bin/youtube-dl");
|
||||
}
|
||||
if ($this->isInstalled() && !$this->isExecutable()) {
|
||||
chmod($this->bin, 755);
|
||||
chmod($this->bin, 0744);
|
||||
}
|
||||
$this->setDownloadDir($downloadDir);
|
||||
if (!empty($settings)) {
|
||||
@@ -246,6 +246,11 @@ class Youtube
|
||||
return @is_executable($this->bin);
|
||||
}
|
||||
|
||||
public function isReadable()
|
||||
{
|
||||
return @is_readable($this->bin);
|
||||
}
|
||||
|
||||
public function getBin()
|
||||
{
|
||||
return $this->bin;
|
||||
|
||||
Reference in New Issue
Block a user