|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace OCA\Files\Panels; |
|
4
|
|
|
|
|
5
|
|
|
use OC\Settings\Panels\Helper; |
|
6
|
|
|
use OCP\Settings\ISettings; |
|
7
|
|
|
use OCP\Template; |
|
8
|
|
|
use OCP\IURLGenerator; |
|
9
|
|
|
|
|
10
|
|
|
class Admin implements ISettings { |
|
11
|
|
|
|
|
12
|
|
|
/** @var IURLGenerator */ |
|
13
|
|
|
protected $urlGenerator; |
|
14
|
|
|
/** @var Helper */ |
|
15
|
|
|
protected $helper; |
|
16
|
|
|
|
|
17
|
|
|
public function __construct(IURLGenerator $urlGenerator, |
|
18
|
|
|
Helper $helper) { |
|
19
|
|
|
$this->urlGenerator = $urlGenerator; |
|
20
|
|
|
$this->helper = $helper; |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
public function getSectionID() { |
|
24
|
|
|
return 'storage'; |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public function getPriority() { |
|
28
|
|
|
return 0; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function getPanel() { |
|
32
|
|
|
$htaccessWorking=(getenv('htaccessWorking')=='true'); |
|
33
|
|
|
$upload_max_filesize = \OC::$server->getIniWrapper()->getBytes('upload_max_filesize'); |
|
34
|
|
|
$post_max_size = \OC::$server->getIniWrapper()->getBytes('post_max_size'); |
|
35
|
|
|
$maxUploadFilesize = \OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size)); |
|
36
|
|
|
$htaccessWritable=is_writable(\OC::$SERVERROOT.'/.htaccess'); |
|
37
|
|
|
$userIniWritable=is_writable(\OC::$SERVERROOT.'/.user.ini'); |
|
38
|
|
|
$tmpl = new Template( 'files', 'admin' ); |
|
39
|
|
|
$tmpl->assign('urlGenerator', $this->urlGenerator); |
|
|
|
|
|
|
40
|
|
|
$tmpl->assign( 'uploadChangeable', ($htaccessWorking and $htaccessWritable) or $userIniWritable ); |
|
41
|
|
|
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); |
|
42
|
|
|
// max possible makes only sense on a 32 bit system |
|
43
|
|
|
$tmpl->assign( 'displayMaxPossibleUploadSize', PHP_INT_SIZE===4); |
|
44
|
|
|
$tmpl->assign( 'maxPossibleUploadSize', \OCP\Util::humanFileSize(PHP_INT_MAX)); |
|
45
|
|
|
return $tmpl; |
|
|
|
|
|
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
} |
|
49
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: