diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-04 17:04:35 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-12-11 12:02:11 +0100 |
commit | 08f1db445134e98188f3e1e5b6b84a6eac1f6346 (patch) | |
tree | 1df2c7365690ecd7277e46b14116bd8b8ca806f9 /lib/private/app/platform.php | |
parent | b33d8a3d60555de3e6e99a92eed3a303e55a3380 (diff) | |
download | nextcloud-server-08f1db445134e98188f3e1e5b6b84a6eac1f6346.tar.gz nextcloud-server-08f1db445134e98188f3e1e5b6b84a6eac1f6346.zip |
adding dependencies for command line tools
Diffstat (limited to 'lib/private/app/platform.php')
-rw-r--r-- | lib/private/app/platform.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/private/app/platform.php b/lib/private/app/platform.php index 39f8a2979f9..da515a235a2 100644 --- a/lib/private/app/platform.php +++ b/lib/private/app/platform.php @@ -12,16 +12,32 @@ namespace OC\App; use OCP\IConfig; +/** + * Class Platform + * + * This class basically abstracts any kind of information which can be retrieved from the underlying system. + * + * @package OC\App + */ class Platform { + /** + * @param IConfig $config + */ function __construct(IConfig $config) { $this->config = $config; } + /** + * @return string + */ public function getPhpVersion() { return phpversion(); } + /** + * @return string + */ public function getDatabase() { $dbType = $this->config->getSystemValue('dbtype', 'sqlite'); if ($dbType === 'sqlite3') { @@ -30,4 +46,20 @@ class Platform { return $dbType; } + + /** + * @return string + */ + public function getOS() { + return php_uname('s'); + } + + /** + * @param $command + * @return bool + */ + public function isCommandKnown($command) { + $path = \OC_Helper::findBinaryPath($command); + return ($path !== null); + } } |