@@ -38,69 +38,69 @@ |
||
38 | 38 | |
39 | 39 | class HasPhotoPlugin extends ServerPlugin { |
40 | 40 | |
41 | - /** @var Server */ |
|
42 | - protected $server; |
|
41 | + /** @var Server */ |
|
42 | + protected $server; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Initializes the plugin and registers event handlers |
|
46 | - * |
|
47 | - * @param Server $server |
|
48 | - * @return void |
|
49 | - */ |
|
50 | - public function initialize(Server $server) { |
|
51 | - $server->on('propFind', [$this, 'propFind']); |
|
52 | - } |
|
44 | + /** |
|
45 | + * Initializes the plugin and registers event handlers |
|
46 | + * |
|
47 | + * @param Server $server |
|
48 | + * @return void |
|
49 | + */ |
|
50 | + public function initialize(Server $server) { |
|
51 | + $server->on('propFind', [$this, 'propFind']); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Adds all CardDAV-specific properties |
|
56 | - * |
|
57 | - * @param PropFind $propFind |
|
58 | - * @param INode $node |
|
59 | - * @return void |
|
60 | - */ |
|
61 | - public function propFind(PropFind $propFind, INode $node) { |
|
62 | - $ns = '{http://nextcloud.com/ns}'; |
|
54 | + /** |
|
55 | + * Adds all CardDAV-specific properties |
|
56 | + * |
|
57 | + * @param PropFind $propFind |
|
58 | + * @param INode $node |
|
59 | + * @return void |
|
60 | + */ |
|
61 | + public function propFind(PropFind $propFind, INode $node) { |
|
62 | + $ns = '{http://nextcloud.com/ns}'; |
|
63 | 63 | |
64 | - if ($node instanceof Card) { |
|
65 | - $propFind->handle($ns . 'has-photo', function () use ($node) { |
|
66 | - $vcard = Reader::read($node->get()); |
|
67 | - return $vcard instanceof VCard |
|
68 | - && $vcard->PHOTO |
|
69 | - // Either the PHOTO is a url (doesn't start with data:) or the mimetype has to start with image/ |
|
70 | - && (strpos($vcard->PHOTO->getValue(), 'data:') !== 0 |
|
71 | - || strpos($vcard->PHOTO->getValue(), 'data:image/') === 0) |
|
72 | - ; |
|
73 | - }); |
|
74 | - } |
|
75 | - } |
|
64 | + if ($node instanceof Card) { |
|
65 | + $propFind->handle($ns . 'has-photo', function () use ($node) { |
|
66 | + $vcard = Reader::read($node->get()); |
|
67 | + return $vcard instanceof VCard |
|
68 | + && $vcard->PHOTO |
|
69 | + // Either the PHOTO is a url (doesn't start with data:) or the mimetype has to start with image/ |
|
70 | + && (strpos($vcard->PHOTO->getValue(), 'data:') !== 0 |
|
71 | + || strpos($vcard->PHOTO->getValue(), 'data:image/') === 0) |
|
72 | + ; |
|
73 | + }); |
|
74 | + } |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * Returns a plugin name. |
|
79 | - * |
|
80 | - * Using this name other plugins will be able to access other plugins |
|
81 | - * using \Sabre\DAV\Server::getPlugin |
|
82 | - * |
|
83 | - * @return string |
|
84 | - */ |
|
85 | - public function getPluginName() { |
|
86 | - return 'vcard-has-photo'; |
|
87 | - } |
|
77 | + /** |
|
78 | + * Returns a plugin name. |
|
79 | + * |
|
80 | + * Using this name other plugins will be able to access other plugins |
|
81 | + * using \Sabre\DAV\Server::getPlugin |
|
82 | + * |
|
83 | + * @return string |
|
84 | + */ |
|
85 | + public function getPluginName() { |
|
86 | + return 'vcard-has-photo'; |
|
87 | + } |
|
88 | 88 | |
89 | - /** |
|
90 | - * Returns a bunch of meta-data about the plugin. |
|
91 | - * |
|
92 | - * Providing this information is optional, and is mainly displayed by the |
|
93 | - * Browser plugin. |
|
94 | - * |
|
95 | - * The description key in the returned array may contain html and will not |
|
96 | - * be sanitized. |
|
97 | - * |
|
98 | - * @return array |
|
99 | - */ |
|
100 | - public function getPluginInfo() { |
|
101 | - return [ |
|
102 | - 'name' => $this->getPluginName(), |
|
103 | - 'description' => 'Return a boolean stating if the vcard have a photo property set or not.' |
|
104 | - ]; |
|
105 | - } |
|
89 | + /** |
|
90 | + * Returns a bunch of meta-data about the plugin. |
|
91 | + * |
|
92 | + * Providing this information is optional, and is mainly displayed by the |
|
93 | + * Browser plugin. |
|
94 | + * |
|
95 | + * The description key in the returned array may contain html and will not |
|
96 | + * be sanitized. |
|
97 | + * |
|
98 | + * @return array |
|
99 | + */ |
|
100 | + public function getPluginInfo() { |
|
101 | + return [ |
|
102 | + 'name' => $this->getPluginName(), |
|
103 | + 'description' => 'Return a boolean stating if the vcard have a photo property set or not.' |
|
104 | + ]; |
|
105 | + } |
|
106 | 106 | } |
@@ -37,45 +37,45 @@ |
||
37 | 37 | * @package OCA\DAV\CalDAV\Proxy |
38 | 38 | */ |
39 | 39 | class ProxyMapper extends QBMapper { |
40 | - public const PERMISSION_READ = 1; |
|
41 | - public const PERMISSION_WRITE = 2; |
|
40 | + public const PERMISSION_READ = 1; |
|
41 | + public const PERMISSION_WRITE = 2; |
|
42 | 42 | |
43 | - /** |
|
44 | - * ProxyMapper constructor. |
|
45 | - * |
|
46 | - * @param IDBConnection $db |
|
47 | - */ |
|
48 | - public function __construct(IDBConnection $db) { |
|
49 | - parent::__construct($db, 'dav_cal_proxy', Proxy::class); |
|
50 | - } |
|
43 | + /** |
|
44 | + * ProxyMapper constructor. |
|
45 | + * |
|
46 | + * @param IDBConnection $db |
|
47 | + */ |
|
48 | + public function __construct(IDBConnection $db) { |
|
49 | + parent::__construct($db, 'dav_cal_proxy', Proxy::class); |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @param string $proxyId The principal uri that can act as a proxy for the resulting calendars |
|
54 | - * |
|
55 | - * @return Proxy[] |
|
56 | - */ |
|
57 | - public function getProxiesFor(string $proxyId): array { |
|
58 | - $qb = $this->db->getQueryBuilder(); |
|
52 | + /** |
|
53 | + * @param string $proxyId The principal uri that can act as a proxy for the resulting calendars |
|
54 | + * |
|
55 | + * @return Proxy[] |
|
56 | + */ |
|
57 | + public function getProxiesFor(string $proxyId): array { |
|
58 | + $qb = $this->db->getQueryBuilder(); |
|
59 | 59 | |
60 | - $qb->select('*') |
|
61 | - ->from($this->getTableName()) |
|
62 | - ->where($qb->expr()->eq('proxy_id', $qb->createNamedParameter($proxyId))); |
|
60 | + $qb->select('*') |
|
61 | + ->from($this->getTableName()) |
|
62 | + ->where($qb->expr()->eq('proxy_id', $qb->createNamedParameter($proxyId))); |
|
63 | 63 | |
64 | - return $this->findEntities($qb); |
|
65 | - } |
|
64 | + return $this->findEntities($qb); |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * @param string $ownerId The principal uri that has the resulting proxies for their calendars |
|
69 | - * |
|
70 | - * @return Proxy[] |
|
71 | - */ |
|
72 | - public function getProxiesOf(string $ownerId): array { |
|
73 | - $qb = $this->db->getQueryBuilder(); |
|
67 | + /** |
|
68 | + * @param string $ownerId The principal uri that has the resulting proxies for their calendars |
|
69 | + * |
|
70 | + * @return Proxy[] |
|
71 | + */ |
|
72 | + public function getProxiesOf(string $ownerId): array { |
|
73 | + $qb = $this->db->getQueryBuilder(); |
|
74 | 74 | |
75 | - $qb->select('*') |
|
76 | - ->from($this->getTableName()) |
|
77 | - ->where($qb->expr()->eq('owner_id', $qb->createNamedParameter($ownerId))); |
|
75 | + $qb->select('*') |
|
76 | + ->from($this->getTableName()) |
|
77 | + ->where($qb->expr()->eq('owner_id', $qb->createNamedParameter($ownerId))); |
|
78 | 78 | |
79 | - return $this->findEntities($qb); |
|
80 | - } |
|
79 | + return $this->findEntities($qb); |
|
80 | + } |
|
81 | 81 | } |
@@ -25,31 +25,31 @@ discard block |
||
25 | 25 | /** @var array $_ */ |
26 | 26 | |
27 | 27 | $mail_smtpauthtype = [ |
28 | - '' => $l->t('None'), |
|
29 | - 'LOGIN' => $l->t('Login'), |
|
30 | - 'PLAIN' => $l->t('Plain'), |
|
31 | - 'NTLM' => $l->t('NT LAN Manager'), |
|
28 | + '' => $l->t('None'), |
|
29 | + 'LOGIN' => $l->t('Login'), |
|
30 | + 'PLAIN' => $l->t('Plain'), |
|
31 | + 'NTLM' => $l->t('NT LAN Manager'), |
|
32 | 32 | ]; |
33 | 33 | |
34 | 34 | $mail_smtpsecure = [ |
35 | - '' => $l->t('None'), |
|
36 | - 'ssl' => $l->t('SSL/TLS'), |
|
37 | - 'tls' => $l->t('STARTTLS'), |
|
35 | + '' => $l->t('None'), |
|
36 | + 'ssl' => $l->t('SSL/TLS'), |
|
37 | + 'tls' => $l->t('STARTTLS'), |
|
38 | 38 | ]; |
39 | 39 | |
40 | 40 | $mail_smtpmode = [ |
41 | - ['smtp', 'SMTP'], |
|
41 | + ['smtp', 'SMTP'], |
|
42 | 42 | ]; |
43 | 43 | if ($_['sendmail_is_available']) { |
44 | - $mail_smtpmode[] = ['sendmail', 'Sendmail']; |
|
44 | + $mail_smtpmode[] = ['sendmail', 'Sendmail']; |
|
45 | 45 | } |
46 | 46 | if ($_['mail_smtpmode'] === 'qmail') { |
47 | - $mail_smtpmode[] = ['qmail', 'qmail']; |
|
47 | + $mail_smtpmode[] = ['qmail', 'qmail']; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $mail_sendmailmode = [ |
51 | - 'smtp' => 'smtp (-bs)', |
|
52 | - 'pipe' => 'pipe (-t)' |
|
51 | + 'smtp' => 'smtp (-bs)', |
|
52 | + 'pipe' => 'pipe (-t)' |
|
53 | 53 | ]; |
54 | 54 | |
55 | 55 | ?> |
@@ -67,29 +67,29 @@ discard block |
||
67 | 67 | <label for="mail_smtpmode"><?php p($l->t('Send mode')); ?></label> |
68 | 68 | <select name="mail_smtpmode" id="mail_smtpmode"> |
69 | 69 | <?php foreach ($mail_smtpmode as $smtpmode): |
70 | - $selected = ''; |
|
71 | - if ($smtpmode[0] == $_['mail_smtpmode']): |
|
72 | - $selected = 'selected="selected"'; |
|
73 | - endif; ?> |
|
70 | + $selected = ''; |
|
71 | + if ($smtpmode[0] == $_['mail_smtpmode']): |
|
72 | + $selected = 'selected="selected"'; |
|
73 | + endif; ?> |
|
74 | 74 | <option value="<?php p($smtpmode[0])?>" <?php p($selected) ?>><?php p($smtpmode[1]) ?></option> |
75 | 75 | <?php endforeach;?> |
76 | 76 | </select> |
77 | 77 | |
78 | 78 | <label id="mail_smtpsecure_label" for="mail_smtpsecure" |
79 | 79 | <?php if ($_['mail_smtpmode'] !== 'smtp') { |
80 | - print_unescaped(' class="hidden"'); |
|
81 | - } ?>> |
|
80 | + print_unescaped(' class="hidden"'); |
|
81 | + } ?>> |
|
82 | 82 | <?php p($l->t('Encryption')); ?> |
83 | 83 | </label> |
84 | 84 | <select name="mail_smtpsecure" id="mail_smtpsecure" |
85 | 85 | <?php if ($_['mail_smtpmode'] !== 'smtp') { |
86 | - print_unescaped(' class="hidden"'); |
|
87 | - } ?>> |
|
86 | + print_unescaped(' class="hidden"'); |
|
87 | + } ?>> |
|
88 | 88 | <?php foreach ($mail_smtpsecure as $secure => $name): |
89 | - $selected = ''; |
|
90 | - if ($secure == $_['mail_smtpsecure']): |
|
91 | - $selected = 'selected="selected"'; |
|
92 | - endif; ?> |
|
89 | + $selected = ''; |
|
90 | + if ($secure == $_['mail_smtpsecure']): |
|
91 | + $selected = 'selected="selected"'; |
|
92 | + endif; ?> |
|
93 | 93 | <option value="<?php p($secure)?>" <?php p($selected) ?>><?php p($name) ?></option> |
94 | 94 | <?php endforeach;?> |
95 | 95 | </select> |
@@ -113,29 +113,29 @@ discard block |
||
113 | 113 | </p> |
114 | 114 | |
115 | 115 | <p id="setting_smtpauth" <?php if ($_['mail_smtpmode'] !== 'smtp') { |
116 | - print_unescaped(' class="hidden"'); |
|
117 | - } ?>> |
|
116 | + print_unescaped(' class="hidden"'); |
|
117 | + } ?>> |
|
118 | 118 | <label for="mail_smtpauthtype"><?php p($l->t('Authentication method')); ?></label> |
119 | 119 | <select name="mail_smtpauthtype" id="mail_smtpauthtype"> |
120 | 120 | <?php foreach ($mail_smtpauthtype as $authtype => $name): |
121 | - $selected = ''; |
|
122 | - if ($authtype == $_['mail_smtpauthtype']): |
|
123 | - $selected = 'selected="selected"'; |
|
124 | - endif; ?> |
|
121 | + $selected = ''; |
|
122 | + if ($authtype == $_['mail_smtpauthtype']): |
|
123 | + $selected = 'selected="selected"'; |
|
124 | + endif; ?> |
|
125 | 125 | <option value="<?php p($authtype)?>" <?php p($selected) ?>><?php p($name) ?></option> |
126 | 126 | <?php endforeach;?> |
127 | 127 | </select> |
128 | 128 | |
129 | 129 | <input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" class="checkbox" value="1" |
130 | 130 | <?php if ($_['mail_smtpauth']) { |
131 | - print_unescaped('checked="checked"'); |
|
132 | - } ?> /> |
|
131 | + print_unescaped('checked="checked"'); |
|
132 | + } ?> /> |
|
133 | 133 | <label for="mail_smtpauth"><?php p($l->t('Authentication required')); ?></label> |
134 | 134 | </p> |
135 | 135 | |
136 | 136 | <p id="setting_smtphost" <?php if ($_['mail_smtpmode'] !== 'smtp') { |
137 | - print_unescaped(' class="hidden"'); |
|
138 | - } ?>> |
|
137 | + print_unescaped(' class="hidden"'); |
|
138 | + } ?>> |
|
139 | 139 | <label for="mail_smtphost"><?php p($l->t('Server address')); ?></label> |
140 | 140 | <input type="text" name="mail_smtphost" id="mail_smtphost" placeholder="smtp.example.com" |
141 | 141 | value="<?php p($_['mail_smtphost']) ?>" /> |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | </form> |
147 | 147 | <form class="mail_settings" id="mail_credentials_settings"> |
148 | 148 | <p id="mail_credentials" <?php if (!$_['mail_smtpauth'] || $_['mail_smtpmode'] !== 'smtp') { |
149 | - print_unescaped(' class="hidden"'); |
|
150 | - } ?>> |
|
149 | + print_unescaped(' class="hidden"'); |
|
150 | + } ?>> |
|
151 | 151 | <label for="mail_smtpname"><?php p($l->t('Credentials')); ?></label> |
152 | 152 | <input type="text" name="mail_smtpname" id="mail_smtpname" placeholder="<?php p($l->t('SMTP Username'))?>" |
153 | 153 | value="<?php p($_['mail_smtpname']) ?>" /> |
@@ -33,128 +33,128 @@ |
||
33 | 33 | use Symfony\Component\Routing\Route as SymfonyRoute; |
34 | 34 | |
35 | 35 | class Route extends SymfonyRoute implements IRoute { |
36 | - /** |
|
37 | - * Specify the method when this route is to be used |
|
38 | - * |
|
39 | - * @param string $method HTTP method (uppercase) |
|
40 | - * @return \OC\Route\Route |
|
41 | - */ |
|
42 | - public function method($method) { |
|
43 | - $this->setMethods($method); |
|
44 | - return $this; |
|
45 | - } |
|
36 | + /** |
|
37 | + * Specify the method when this route is to be used |
|
38 | + * |
|
39 | + * @param string $method HTTP method (uppercase) |
|
40 | + * @return \OC\Route\Route |
|
41 | + */ |
|
42 | + public function method($method) { |
|
43 | + $this->setMethods($method); |
|
44 | + return $this; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Specify POST as the method to use with this route |
|
49 | - * @return \OC\Route\Route |
|
50 | - */ |
|
51 | - public function post() { |
|
52 | - $this->method('POST'); |
|
53 | - return $this; |
|
54 | - } |
|
47 | + /** |
|
48 | + * Specify POST as the method to use with this route |
|
49 | + * @return \OC\Route\Route |
|
50 | + */ |
|
51 | + public function post() { |
|
52 | + $this->method('POST'); |
|
53 | + return $this; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * Specify GET as the method to use with this route |
|
58 | - * @return \OC\Route\Route |
|
59 | - */ |
|
60 | - public function get() { |
|
61 | - $this->method('GET'); |
|
62 | - return $this; |
|
63 | - } |
|
56 | + /** |
|
57 | + * Specify GET as the method to use with this route |
|
58 | + * @return \OC\Route\Route |
|
59 | + */ |
|
60 | + public function get() { |
|
61 | + $this->method('GET'); |
|
62 | + return $this; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * Specify PUT as the method to use with this route |
|
67 | - * @return \OC\Route\Route |
|
68 | - */ |
|
69 | - public function put() { |
|
70 | - $this->method('PUT'); |
|
71 | - return $this; |
|
72 | - } |
|
65 | + /** |
|
66 | + * Specify PUT as the method to use with this route |
|
67 | + * @return \OC\Route\Route |
|
68 | + */ |
|
69 | + public function put() { |
|
70 | + $this->method('PUT'); |
|
71 | + return $this; |
|
72 | + } |
|
73 | 73 | |
74 | - /** |
|
75 | - * Specify DELETE as the method to use with this route |
|
76 | - * @return \OC\Route\Route |
|
77 | - */ |
|
78 | - public function delete() { |
|
79 | - $this->method('DELETE'); |
|
80 | - return $this; |
|
81 | - } |
|
74 | + /** |
|
75 | + * Specify DELETE as the method to use with this route |
|
76 | + * @return \OC\Route\Route |
|
77 | + */ |
|
78 | + public function delete() { |
|
79 | + $this->method('DELETE'); |
|
80 | + return $this; |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * Specify PATCH as the method to use with this route |
|
85 | - * @return \OC\Route\Route |
|
86 | - */ |
|
87 | - public function patch() { |
|
88 | - $this->method('PATCH'); |
|
89 | - return $this; |
|
90 | - } |
|
83 | + /** |
|
84 | + * Specify PATCH as the method to use with this route |
|
85 | + * @return \OC\Route\Route |
|
86 | + */ |
|
87 | + public function patch() { |
|
88 | + $this->method('PATCH'); |
|
89 | + return $this; |
|
90 | + } |
|
91 | 91 | |
92 | - /** |
|
93 | - * Defaults to use for this route |
|
94 | - * |
|
95 | - * @param array $defaults The defaults |
|
96 | - * @return \OC\Route\Route |
|
97 | - */ |
|
98 | - public function defaults($defaults) { |
|
99 | - $action = $this->getDefault('action'); |
|
100 | - $this->setDefaults($defaults); |
|
101 | - if (isset($defaults['action'])) { |
|
102 | - $action = $defaults['action']; |
|
103 | - } |
|
104 | - $this->action($action); |
|
105 | - return $this; |
|
106 | - } |
|
92 | + /** |
|
93 | + * Defaults to use for this route |
|
94 | + * |
|
95 | + * @param array $defaults The defaults |
|
96 | + * @return \OC\Route\Route |
|
97 | + */ |
|
98 | + public function defaults($defaults) { |
|
99 | + $action = $this->getDefault('action'); |
|
100 | + $this->setDefaults($defaults); |
|
101 | + if (isset($defaults['action'])) { |
|
102 | + $action = $defaults['action']; |
|
103 | + } |
|
104 | + $this->action($action); |
|
105 | + return $this; |
|
106 | + } |
|
107 | 107 | |
108 | - /** |
|
109 | - * Requirements for this route |
|
110 | - * |
|
111 | - * @param array $requirements The requirements |
|
112 | - * @return \OC\Route\Route |
|
113 | - */ |
|
114 | - public function requirements($requirements) { |
|
115 | - $method = $this->getMethods(); |
|
116 | - $this->setRequirements($requirements); |
|
117 | - if (isset($requirements['_method'])) { |
|
118 | - $method = $requirements['_method']; |
|
119 | - } |
|
120 | - if ($method) { |
|
121 | - $this->method($method); |
|
122 | - } |
|
123 | - return $this; |
|
124 | - } |
|
108 | + /** |
|
109 | + * Requirements for this route |
|
110 | + * |
|
111 | + * @param array $requirements The requirements |
|
112 | + * @return \OC\Route\Route |
|
113 | + */ |
|
114 | + public function requirements($requirements) { |
|
115 | + $method = $this->getMethods(); |
|
116 | + $this->setRequirements($requirements); |
|
117 | + if (isset($requirements['_method'])) { |
|
118 | + $method = $requirements['_method']; |
|
119 | + } |
|
120 | + if ($method) { |
|
121 | + $this->method($method); |
|
122 | + } |
|
123 | + return $this; |
|
124 | + } |
|
125 | 125 | |
126 | - /** |
|
127 | - * The action to execute when this route matches |
|
128 | - * |
|
129 | - * @param string|callable $class the class or a callable |
|
130 | - * @param string $function the function to use with the class |
|
131 | - * @return \OC\Route\Route |
|
132 | - * |
|
133 | - * This function is called with $class set to a callable or |
|
134 | - * to the class with $function |
|
135 | - */ |
|
136 | - public function action($class, $function = null) { |
|
137 | - $action = [$class, $function]; |
|
138 | - if (is_null($function)) { |
|
139 | - $action = $class; |
|
140 | - } |
|
141 | - $this->setDefault('action', $action); |
|
142 | - return $this; |
|
143 | - } |
|
126 | + /** |
|
127 | + * The action to execute when this route matches |
|
128 | + * |
|
129 | + * @param string|callable $class the class or a callable |
|
130 | + * @param string $function the function to use with the class |
|
131 | + * @return \OC\Route\Route |
|
132 | + * |
|
133 | + * This function is called with $class set to a callable or |
|
134 | + * to the class with $function |
|
135 | + */ |
|
136 | + public function action($class, $function = null) { |
|
137 | + $action = [$class, $function]; |
|
138 | + if (is_null($function)) { |
|
139 | + $action = $class; |
|
140 | + } |
|
141 | + $this->setDefault('action', $action); |
|
142 | + return $this; |
|
143 | + } |
|
144 | 144 | |
145 | - /** |
|
146 | - * The action to execute when this route matches, includes a file like |
|
147 | - * it is called directly |
|
148 | - * @param string $file |
|
149 | - * @return void |
|
150 | - */ |
|
151 | - public function actionInclude($file) { |
|
152 | - $function = function ($param) use ($file) { |
|
153 | - unset($param["_route"]); |
|
154 | - $_GET = array_merge($_GET, $param); |
|
155 | - unset($param); |
|
156 | - require_once "$file"; |
|
157 | - } ; |
|
158 | - $this->action($function); |
|
159 | - } |
|
145 | + /** |
|
146 | + * The action to execute when this route matches, includes a file like |
|
147 | + * it is called directly |
|
148 | + * @param string $file |
|
149 | + * @return void |
|
150 | + */ |
|
151 | + public function actionInclude($file) { |
|
152 | + $function = function ($param) use ($file) { |
|
153 | + unset($param["_route"]); |
|
154 | + $_GET = array_merge($_GET, $param); |
|
155 | + unset($param); |
|
156 | + require_once "$file"; |
|
157 | + } ; |
|
158 | + $this->action($function); |
|
159 | + } |
|
160 | 160 | } |
@@ -33,99 +33,99 @@ |
||
33 | 33 | use OCP\AppFramework\Http as BaseHttp; |
34 | 34 | |
35 | 35 | class Http extends BaseHttp { |
36 | - private $server; |
|
37 | - private $protocolVersion; |
|
38 | - protected $headers; |
|
36 | + private $server; |
|
37 | + private $protocolVersion; |
|
38 | + protected $headers; |
|
39 | 39 | |
40 | - /** |
|
41 | - * @param array $server $_SERVER |
|
42 | - * @param string $protocolVersion the http version to use defaults to HTTP/1.1 |
|
43 | - */ |
|
44 | - public function __construct($server, $protocolVersion = 'HTTP/1.1') { |
|
45 | - $this->server = $server; |
|
46 | - $this->protocolVersion = $protocolVersion; |
|
40 | + /** |
|
41 | + * @param array $server $_SERVER |
|
42 | + * @param string $protocolVersion the http version to use defaults to HTTP/1.1 |
|
43 | + */ |
|
44 | + public function __construct($server, $protocolVersion = 'HTTP/1.1') { |
|
45 | + $this->server = $server; |
|
46 | + $this->protocolVersion = $protocolVersion; |
|
47 | 47 | |
48 | - $this->headers = [ |
|
49 | - self::STATUS_CONTINUE => 'Continue', |
|
50 | - self::STATUS_SWITCHING_PROTOCOLS => 'Switching Protocols', |
|
51 | - self::STATUS_PROCESSING => 'Processing', |
|
52 | - self::STATUS_OK => 'OK', |
|
53 | - self::STATUS_CREATED => 'Created', |
|
54 | - self::STATUS_ACCEPTED => 'Accepted', |
|
55 | - self::STATUS_NON_AUTHORATIVE_INFORMATION => 'Non-Authorative Information', |
|
56 | - self::STATUS_NO_CONTENT => 'No Content', |
|
57 | - self::STATUS_RESET_CONTENT => 'Reset Content', |
|
58 | - self::STATUS_PARTIAL_CONTENT => 'Partial Content', |
|
59 | - self::STATUS_MULTI_STATUS => 'Multi-Status', // RFC 4918 |
|
60 | - self::STATUS_ALREADY_REPORTED => 'Already Reported', // RFC 5842 |
|
61 | - self::STATUS_IM_USED => 'IM Used', // RFC 3229 |
|
62 | - self::STATUS_MULTIPLE_CHOICES => 'Multiple Choices', |
|
63 | - self::STATUS_MOVED_PERMANENTLY => 'Moved Permanently', |
|
64 | - self::STATUS_FOUND => 'Found', |
|
65 | - self::STATUS_SEE_OTHER => 'See Other', |
|
66 | - self::STATUS_NOT_MODIFIED => 'Not Modified', |
|
67 | - self::STATUS_USE_PROXY => 'Use Proxy', |
|
68 | - self::STATUS_RESERVED => 'Reserved', |
|
69 | - self::STATUS_TEMPORARY_REDIRECT => 'Temporary Redirect', |
|
70 | - self::STATUS_BAD_REQUEST => 'Bad request', |
|
71 | - self::STATUS_UNAUTHORIZED => 'Unauthorized', |
|
72 | - self::STATUS_PAYMENT_REQUIRED => 'Payment Required', |
|
73 | - self::STATUS_FORBIDDEN => 'Forbidden', |
|
74 | - self::STATUS_NOT_FOUND => 'Not Found', |
|
75 | - self::STATUS_METHOD_NOT_ALLOWED => 'Method Not Allowed', |
|
76 | - self::STATUS_NOT_ACCEPTABLE => 'Not Acceptable', |
|
77 | - self::STATUS_PROXY_AUTHENTICATION_REQUIRED => 'Proxy Authentication Required', |
|
78 | - self::STATUS_REQUEST_TIMEOUT => 'Request Timeout', |
|
79 | - self::STATUS_CONFLICT => 'Conflict', |
|
80 | - self::STATUS_GONE => 'Gone', |
|
81 | - self::STATUS_LENGTH_REQUIRED => 'Length Required', |
|
82 | - self::STATUS_PRECONDITION_FAILED => 'Precondition failed', |
|
83 | - self::STATUS_REQUEST_ENTITY_TOO_LARGE => 'Request Entity Too Large', |
|
84 | - self::STATUS_REQUEST_URI_TOO_LONG => 'Request-URI Too Long', |
|
85 | - self::STATUS_UNSUPPORTED_MEDIA_TYPE => 'Unsupported Media Type', |
|
86 | - self::STATUS_REQUEST_RANGE_NOT_SATISFIABLE => 'Requested Range Not Satisfiable', |
|
87 | - self::STATUS_EXPECTATION_FAILED => 'Expectation Failed', |
|
88 | - self::STATUS_IM_A_TEAPOT => 'I\'m a teapot', // RFC 2324 |
|
89 | - self::STATUS_UNPROCESSABLE_ENTITY => 'Unprocessable Entity', // RFC 4918 |
|
90 | - self::STATUS_LOCKED => 'Locked', // RFC 4918 |
|
91 | - self::STATUS_FAILED_DEPENDENCY => 'Failed Dependency', // RFC 4918 |
|
92 | - self::STATUS_UPGRADE_REQUIRED => 'Upgrade required', |
|
93 | - self::STATUS_PRECONDITION_REQUIRED => 'Precondition required', // draft-nottingham-http-new-status |
|
94 | - self::STATUS_TOO_MANY_REQUESTS => 'Too Many Requests', // draft-nottingham-http-new-status |
|
95 | - self::STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE => 'Request Header Fields Too Large', // draft-nottingham-http-new-status |
|
96 | - self::STATUS_INTERNAL_SERVER_ERROR => 'Internal Server Error', |
|
97 | - self::STATUS_NOT_IMPLEMENTED => 'Not Implemented', |
|
98 | - self::STATUS_BAD_GATEWAY => 'Bad Gateway', |
|
99 | - self::STATUS_SERVICE_UNAVAILABLE => 'Service Unavailable', |
|
100 | - self::STATUS_GATEWAY_TIMEOUT => 'Gateway Timeout', |
|
101 | - self::STATUS_HTTP_VERSION_NOT_SUPPORTED => 'HTTP Version not supported', |
|
102 | - self::STATUS_VARIANT_ALSO_NEGOTIATES => 'Variant Also Negotiates', |
|
103 | - self::STATUS_INSUFFICIENT_STORAGE => 'Insufficient Storage', // RFC 4918 |
|
104 | - self::STATUS_LOOP_DETECTED => 'Loop Detected', // RFC 5842 |
|
105 | - self::STATUS_BANDWIDTH_LIMIT_EXCEEDED => 'Bandwidth Limit Exceeded', // non-standard |
|
106 | - self::STATUS_NOT_EXTENDED => 'Not extended', |
|
107 | - self::STATUS_NETWORK_AUTHENTICATION_REQUIRED => 'Network Authentication Required', // draft-nottingham-http-new-status |
|
108 | - ]; |
|
109 | - } |
|
48 | + $this->headers = [ |
|
49 | + self::STATUS_CONTINUE => 'Continue', |
|
50 | + self::STATUS_SWITCHING_PROTOCOLS => 'Switching Protocols', |
|
51 | + self::STATUS_PROCESSING => 'Processing', |
|
52 | + self::STATUS_OK => 'OK', |
|
53 | + self::STATUS_CREATED => 'Created', |
|
54 | + self::STATUS_ACCEPTED => 'Accepted', |
|
55 | + self::STATUS_NON_AUTHORATIVE_INFORMATION => 'Non-Authorative Information', |
|
56 | + self::STATUS_NO_CONTENT => 'No Content', |
|
57 | + self::STATUS_RESET_CONTENT => 'Reset Content', |
|
58 | + self::STATUS_PARTIAL_CONTENT => 'Partial Content', |
|
59 | + self::STATUS_MULTI_STATUS => 'Multi-Status', // RFC 4918 |
|
60 | + self::STATUS_ALREADY_REPORTED => 'Already Reported', // RFC 5842 |
|
61 | + self::STATUS_IM_USED => 'IM Used', // RFC 3229 |
|
62 | + self::STATUS_MULTIPLE_CHOICES => 'Multiple Choices', |
|
63 | + self::STATUS_MOVED_PERMANENTLY => 'Moved Permanently', |
|
64 | + self::STATUS_FOUND => 'Found', |
|
65 | + self::STATUS_SEE_OTHER => 'See Other', |
|
66 | + self::STATUS_NOT_MODIFIED => 'Not Modified', |
|
67 | + self::STATUS_USE_PROXY => 'Use Proxy', |
|
68 | + self::STATUS_RESERVED => 'Reserved', |
|
69 | + self::STATUS_TEMPORARY_REDIRECT => 'Temporary Redirect', |
|
70 | + self::STATUS_BAD_REQUEST => 'Bad request', |
|
71 | + self::STATUS_UNAUTHORIZED => 'Unauthorized', |
|
72 | + self::STATUS_PAYMENT_REQUIRED => 'Payment Required', |
|
73 | + self::STATUS_FORBIDDEN => 'Forbidden', |
|
74 | + self::STATUS_NOT_FOUND => 'Not Found', |
|
75 | + self::STATUS_METHOD_NOT_ALLOWED => 'Method Not Allowed', |
|
76 | + self::STATUS_NOT_ACCEPTABLE => 'Not Acceptable', |
|
77 | + self::STATUS_PROXY_AUTHENTICATION_REQUIRED => 'Proxy Authentication Required', |
|
78 | + self::STATUS_REQUEST_TIMEOUT => 'Request Timeout', |
|
79 | + self::STATUS_CONFLICT => 'Conflict', |
|
80 | + self::STATUS_GONE => 'Gone', |
|
81 | + self::STATUS_LENGTH_REQUIRED => 'Length Required', |
|
82 | + self::STATUS_PRECONDITION_FAILED => 'Precondition failed', |
|
83 | + self::STATUS_REQUEST_ENTITY_TOO_LARGE => 'Request Entity Too Large', |
|
84 | + self::STATUS_REQUEST_URI_TOO_LONG => 'Request-URI Too Long', |
|
85 | + self::STATUS_UNSUPPORTED_MEDIA_TYPE => 'Unsupported Media Type', |
|
86 | + self::STATUS_REQUEST_RANGE_NOT_SATISFIABLE => 'Requested Range Not Satisfiable', |
|
87 | + self::STATUS_EXPECTATION_FAILED => 'Expectation Failed', |
|
88 | + self::STATUS_IM_A_TEAPOT => 'I\'m a teapot', // RFC 2324 |
|
89 | + self::STATUS_UNPROCESSABLE_ENTITY => 'Unprocessable Entity', // RFC 4918 |
|
90 | + self::STATUS_LOCKED => 'Locked', // RFC 4918 |
|
91 | + self::STATUS_FAILED_DEPENDENCY => 'Failed Dependency', // RFC 4918 |
|
92 | + self::STATUS_UPGRADE_REQUIRED => 'Upgrade required', |
|
93 | + self::STATUS_PRECONDITION_REQUIRED => 'Precondition required', // draft-nottingham-http-new-status |
|
94 | + self::STATUS_TOO_MANY_REQUESTS => 'Too Many Requests', // draft-nottingham-http-new-status |
|
95 | + self::STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE => 'Request Header Fields Too Large', // draft-nottingham-http-new-status |
|
96 | + self::STATUS_INTERNAL_SERVER_ERROR => 'Internal Server Error', |
|
97 | + self::STATUS_NOT_IMPLEMENTED => 'Not Implemented', |
|
98 | + self::STATUS_BAD_GATEWAY => 'Bad Gateway', |
|
99 | + self::STATUS_SERVICE_UNAVAILABLE => 'Service Unavailable', |
|
100 | + self::STATUS_GATEWAY_TIMEOUT => 'Gateway Timeout', |
|
101 | + self::STATUS_HTTP_VERSION_NOT_SUPPORTED => 'HTTP Version not supported', |
|
102 | + self::STATUS_VARIANT_ALSO_NEGOTIATES => 'Variant Also Negotiates', |
|
103 | + self::STATUS_INSUFFICIENT_STORAGE => 'Insufficient Storage', // RFC 4918 |
|
104 | + self::STATUS_LOOP_DETECTED => 'Loop Detected', // RFC 5842 |
|
105 | + self::STATUS_BANDWIDTH_LIMIT_EXCEEDED => 'Bandwidth Limit Exceeded', // non-standard |
|
106 | + self::STATUS_NOT_EXTENDED => 'Not extended', |
|
107 | + self::STATUS_NETWORK_AUTHENTICATION_REQUIRED => 'Network Authentication Required', // draft-nottingham-http-new-status |
|
108 | + ]; |
|
109 | + } |
|
110 | 110 | |
111 | 111 | |
112 | - /** |
|
113 | - * Gets the correct header |
|
114 | - * @param int Http::CONSTANT $status the constant from the Http class |
|
115 | - * @param \DateTime $lastModified formatted last modified date |
|
116 | - * @param string $ETag the etag |
|
117 | - * @return string |
|
118 | - */ |
|
119 | - public function getStatusHeader($status) { |
|
120 | - // we have one change currently for the http 1.0 header that differs |
|
121 | - // from 1.1: STATUS_TEMPORARY_REDIRECT should be STATUS_FOUND |
|
122 | - // if this differs any more, we want to create childclasses for this |
|
123 | - if ($status === self::STATUS_TEMPORARY_REDIRECT |
|
124 | - && $this->protocolVersion === 'HTTP/1.0') { |
|
125 | - $status = self::STATUS_FOUND; |
|
126 | - } |
|
112 | + /** |
|
113 | + * Gets the correct header |
|
114 | + * @param int Http::CONSTANT $status the constant from the Http class |
|
115 | + * @param \DateTime $lastModified formatted last modified date |
|
116 | + * @param string $ETag the etag |
|
117 | + * @return string |
|
118 | + */ |
|
119 | + public function getStatusHeader($status) { |
|
120 | + // we have one change currently for the http 1.0 header that differs |
|
121 | + // from 1.1: STATUS_TEMPORARY_REDIRECT should be STATUS_FOUND |
|
122 | + // if this differs any more, we want to create childclasses for this |
|
123 | + if ($status === self::STATUS_TEMPORARY_REDIRECT |
|
124 | + && $this->protocolVersion === 'HTTP/1.0') { |
|
125 | + $status = self::STATUS_FOUND; |
|
126 | + } |
|
127 | 127 | |
128 | - return $this->protocolVersion . ' ' . $status . ' ' . |
|
129 | - $this->headers[$status]; |
|
130 | - } |
|
128 | + return $this->protocolVersion . ' ' . $status . ' ' . |
|
129 | + $this->headers[$status]; |
|
130 | + } |
|
131 | 131 | } |
@@ -29,54 +29,54 @@ |
||
29 | 29 | use OCP\IServerContainer; |
30 | 30 | |
31 | 31 | class Manager implements IManager { |
32 | - /** @var string[] */ |
|
33 | - protected $sorters = []; |
|
32 | + /** @var string[] */ |
|
33 | + protected $sorters = []; |
|
34 | 34 | |
35 | - /** @var ISorter[] */ |
|
36 | - protected $sorterInstances = []; |
|
37 | - /** @var IServerContainer */ |
|
38 | - private $c; |
|
35 | + /** @var ISorter[] */ |
|
36 | + protected $sorterInstances = []; |
|
37 | + /** @var IServerContainer */ |
|
38 | + private $c; |
|
39 | 39 | |
40 | - public function __construct(IServerContainer $container) { |
|
41 | - $this->c = $container; |
|
42 | - } |
|
40 | + public function __construct(IServerContainer $container) { |
|
41 | + $this->c = $container; |
|
42 | + } |
|
43 | 43 | |
44 | - public function runSorters(array $sorters, array &$sortArray, array $context) { |
|
45 | - $sorterInstances = $this->getSorters(); |
|
46 | - while ($sorter = array_shift($sorters)) { |
|
47 | - if (isset($sorterInstances[$sorter])) { |
|
48 | - $sorterInstances[$sorter]->sort($sortArray, $context); |
|
49 | - } else { |
|
50 | - $this->c->getLogger()->warning('No sorter for ID "{id}", skipping', [ |
|
51 | - 'app' => 'core', 'id' => $sorter |
|
52 | - ]); |
|
53 | - } |
|
54 | - } |
|
55 | - } |
|
44 | + public function runSorters(array $sorters, array &$sortArray, array $context) { |
|
45 | + $sorterInstances = $this->getSorters(); |
|
46 | + while ($sorter = array_shift($sorters)) { |
|
47 | + if (isset($sorterInstances[$sorter])) { |
|
48 | + $sorterInstances[$sorter]->sort($sortArray, $context); |
|
49 | + } else { |
|
50 | + $this->c->getLogger()->warning('No sorter for ID "{id}", skipping', [ |
|
51 | + 'app' => 'core', 'id' => $sorter |
|
52 | + ]); |
|
53 | + } |
|
54 | + } |
|
55 | + } |
|
56 | 56 | |
57 | - public function registerSorter($className) { |
|
58 | - $this->sorters[] = $className; |
|
59 | - } |
|
57 | + public function registerSorter($className) { |
|
58 | + $this->sorters[] = $className; |
|
59 | + } |
|
60 | 60 | |
61 | - protected function getSorters() { |
|
62 | - if (count($this->sorterInstances) === 0) { |
|
63 | - foreach ($this->sorters as $sorter) { |
|
64 | - /** @var ISorter $instance */ |
|
65 | - $instance = $this->c->resolve($sorter); |
|
66 | - if (!$instance instanceof ISorter) { |
|
67 | - $this->c->getLogger()->notice('Skipping sorter which is not an instance of ISorter. Class name: {class}', |
|
68 | - ['app' => 'core', 'class' => $sorter]); |
|
69 | - continue; |
|
70 | - } |
|
71 | - $sorterId = trim($instance->getId()); |
|
72 | - if (trim($sorterId) === '') { |
|
73 | - $this->c->getLogger()->notice('Skipping sorter with empty ID. Class name: {class}', |
|
74 | - ['app' => 'core', 'class' => $sorter]); |
|
75 | - continue; |
|
76 | - } |
|
77 | - $this->sorterInstances[$sorterId] = $instance; |
|
78 | - } |
|
79 | - } |
|
80 | - return $this->sorterInstances; |
|
81 | - } |
|
61 | + protected function getSorters() { |
|
62 | + if (count($this->sorterInstances) === 0) { |
|
63 | + foreach ($this->sorters as $sorter) { |
|
64 | + /** @var ISorter $instance */ |
|
65 | + $instance = $this->c->resolve($sorter); |
|
66 | + if (!$instance instanceof ISorter) { |
|
67 | + $this->c->getLogger()->notice('Skipping sorter which is not an instance of ISorter. Class name: {class}', |
|
68 | + ['app' => 'core', 'class' => $sorter]); |
|
69 | + continue; |
|
70 | + } |
|
71 | + $sorterId = trim($instance->getId()); |
|
72 | + if (trim($sorterId) === '') { |
|
73 | + $this->c->getLogger()->notice('Skipping sorter with empty ID. Class name: {class}', |
|
74 | + ['app' => 'core', 'class' => $sorter]); |
|
75 | + continue; |
|
76 | + } |
|
77 | + $this->sorterInstances[$sorterId] = $instance; |
|
78 | + } |
|
79 | + } |
|
80 | + return $this->sorterInstances; |
|
81 | + } |
|
82 | 82 | } |
@@ -30,13 +30,13 @@ |
||
30 | 30 | * @since 14.0.0 |
31 | 31 | */ |
32 | 32 | interface IFileBased { |
33 | - /** |
|
34 | - * @since 14.0.0 |
|
35 | - */ |
|
36 | - public function getLogFilePath():string; |
|
33 | + /** |
|
34 | + * @since 14.0.0 |
|
35 | + */ |
|
36 | + public function getLogFilePath():string; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @since 14.0.0 |
|
40 | - */ |
|
41 | - public function getEntries(int $limit = 50, int $offset = 0): array; |
|
38 | + /** |
|
39 | + * @since 14.0.0 |
|
40 | + */ |
|
41 | + public function getEntries(int $limit = 50, int $offset = 0): array; |
|
42 | 42 | } |
@@ -34,98 +34,98 @@ |
||
34 | 34 | * @since 8.0.0 |
35 | 35 | */ |
36 | 36 | class Template extends \OC_Template { |
37 | - /** |
|
38 | - * Make OC_Helper::imagePath available as a simple function |
|
39 | - * |
|
40 | - * @see \OCP\IURLGenerator::imagePath |
|
41 | - * |
|
42 | - * @param string $app |
|
43 | - * @param string $image |
|
44 | - * @return string to the image |
|
45 | - * @since 8.0.0 |
|
46 | - * @suppress PhanDeprecatedFunction |
|
47 | - */ |
|
48 | - public static function image_path($app, $image) { |
|
49 | - return \image_path($app, $image); |
|
50 | - } |
|
37 | + /** |
|
38 | + * Make OC_Helper::imagePath available as a simple function |
|
39 | + * |
|
40 | + * @see \OCP\IURLGenerator::imagePath |
|
41 | + * |
|
42 | + * @param string $app |
|
43 | + * @param string $image |
|
44 | + * @return string to the image |
|
45 | + * @since 8.0.0 |
|
46 | + * @suppress PhanDeprecatedFunction |
|
47 | + */ |
|
48 | + public static function image_path($app, $image) { |
|
49 | + return \image_path($app, $image); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | - /** |
|
54 | - * Make OC_Helper::mimetypeIcon available as a simple function |
|
55 | - * |
|
56 | - * @param string $mimetype |
|
57 | - * @return string to the image of this file type. |
|
58 | - * @since 8.0.0 |
|
59 | - * @suppress PhanDeprecatedFunction |
|
60 | - */ |
|
61 | - public static function mimetype_icon($mimetype) { |
|
62 | - return \mimetype_icon($mimetype); |
|
63 | - } |
|
53 | + /** |
|
54 | + * Make OC_Helper::mimetypeIcon available as a simple function |
|
55 | + * |
|
56 | + * @param string $mimetype |
|
57 | + * @return string to the image of this file type. |
|
58 | + * @since 8.0.0 |
|
59 | + * @suppress PhanDeprecatedFunction |
|
60 | + */ |
|
61 | + public static function mimetype_icon($mimetype) { |
|
62 | + return \mimetype_icon($mimetype); |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * Make preview_icon available as a simple function |
|
67 | - * |
|
68 | - * @param string $path path to file |
|
69 | - * @return string to the preview of the image |
|
70 | - * @since 8.0.0 |
|
71 | - * @suppress PhanDeprecatedFunction |
|
72 | - */ |
|
73 | - public static function preview_icon($path) { |
|
74 | - return \preview_icon($path); |
|
75 | - } |
|
65 | + /** |
|
66 | + * Make preview_icon available as a simple function |
|
67 | + * |
|
68 | + * @param string $path path to file |
|
69 | + * @return string to the preview of the image |
|
70 | + * @since 8.0.0 |
|
71 | + * @suppress PhanDeprecatedFunction |
|
72 | + */ |
|
73 | + public static function preview_icon($path) { |
|
74 | + return \preview_icon($path); |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * Make publicpreview_icon available as a simple function |
|
79 | - * Returns the path to the preview of the image. |
|
80 | - * |
|
81 | - * @param string $path of file |
|
82 | - * @param string $token |
|
83 | - * @return string link to the preview |
|
84 | - * @since 8.0.0 |
|
85 | - * @suppress PhanDeprecatedFunction |
|
86 | - */ |
|
87 | - public static function publicPreview_icon($path, $token) { |
|
88 | - return \publicPreview_icon($path, $token); |
|
89 | - } |
|
77 | + /** |
|
78 | + * Make publicpreview_icon available as a simple function |
|
79 | + * Returns the path to the preview of the image. |
|
80 | + * |
|
81 | + * @param string $path of file |
|
82 | + * @param string $token |
|
83 | + * @return string link to the preview |
|
84 | + * @since 8.0.0 |
|
85 | + * @suppress PhanDeprecatedFunction |
|
86 | + */ |
|
87 | + public static function publicPreview_icon($path, $token) { |
|
88 | + return \publicPreview_icon($path, $token); |
|
89 | + } |
|
90 | 90 | |
91 | - /** |
|
92 | - * Make OC_Helper::humanFileSize available as a simple function |
|
93 | - * Example: 2048 to 2 kB. |
|
94 | - * |
|
95 | - * @param int $bytes in bytes |
|
96 | - * @return string size as string |
|
97 | - * @since 8.0.0 |
|
98 | - * @suppress PhanDeprecatedFunction |
|
99 | - */ |
|
100 | - public static function human_file_size($bytes) { |
|
101 | - return \human_file_size($bytes); |
|
102 | - } |
|
91 | + /** |
|
92 | + * Make OC_Helper::humanFileSize available as a simple function |
|
93 | + * Example: 2048 to 2 kB. |
|
94 | + * |
|
95 | + * @param int $bytes in bytes |
|
96 | + * @return string size as string |
|
97 | + * @since 8.0.0 |
|
98 | + * @suppress PhanDeprecatedFunction |
|
99 | + */ |
|
100 | + public static function human_file_size($bytes) { |
|
101 | + return \human_file_size($bytes); |
|
102 | + } |
|
103 | 103 | |
104 | - /** |
|
105 | - * Return the relative date in relation to today. Returns something like "last hour" or "two month ago" |
|
106 | - * |
|
107 | - * @param int $timestamp unix timestamp |
|
108 | - * @param boolean $dateOnly |
|
109 | - * @return string human readable interpretation of the timestamp |
|
110 | - * @since 8.0.0 |
|
111 | - * @suppress PhanDeprecatedFunction |
|
112 | - * @suppress PhanTypeMismatchArgument |
|
113 | - */ |
|
114 | - public static function relative_modified_date($timestamp, $dateOnly = false) { |
|
115 | - return \relative_modified_date($timestamp, null, $dateOnly); |
|
116 | - } |
|
104 | + /** |
|
105 | + * Return the relative date in relation to today. Returns something like "last hour" or "two month ago" |
|
106 | + * |
|
107 | + * @param int $timestamp unix timestamp |
|
108 | + * @param boolean $dateOnly |
|
109 | + * @return string human readable interpretation of the timestamp |
|
110 | + * @since 8.0.0 |
|
111 | + * @suppress PhanDeprecatedFunction |
|
112 | + * @suppress PhanTypeMismatchArgument |
|
113 | + */ |
|
114 | + public static function relative_modified_date($timestamp, $dateOnly = false) { |
|
115 | + return \relative_modified_date($timestamp, null, $dateOnly); |
|
116 | + } |
|
117 | 117 | |
118 | - /** |
|
119 | - * Generate html code for an options block. |
|
120 | - * |
|
121 | - * @param array $options the options |
|
122 | - * @param mixed $selected which one is selected? |
|
123 | - * @param array $params the parameters |
|
124 | - * @return string html options |
|
125 | - * @since 8.0.0 |
|
126 | - * @suppress PhanDeprecatedFunction |
|
127 | - */ |
|
128 | - public static function html_select_options($options, $selected, $params = []) { |
|
129 | - return \html_select_options($options, $selected, $params); |
|
130 | - } |
|
118 | + /** |
|
119 | + * Generate html code for an options block. |
|
120 | + * |
|
121 | + * @param array $options the options |
|
122 | + * @param mixed $selected which one is selected? |
|
123 | + * @param array $params the parameters |
|
124 | + * @return string html options |
|
125 | + * @since 8.0.0 |
|
126 | + * @suppress PhanDeprecatedFunction |
|
127 | + */ |
|
128 | + public static function html_select_options($options, $selected, $params = []) { |
|
129 | + return \html_select_options($options, $selected, $params); |
|
130 | + } |
|
131 | 131 | } |
@@ -41,149 +41,149 @@ |
||
41 | 41 | * @deprecated 20.0.0 use the PSR-3 logger \Psr\Log\LoggerInterface |
42 | 42 | */ |
43 | 43 | interface ILogger { |
44 | - /** |
|
45 | - * @since 14.0.0 |
|
46 | - * @deprecated 20.0.0 |
|
47 | - */ |
|
48 | - public const DEBUG = 0; |
|
49 | - /** |
|
50 | - * @since 14.0.0 |
|
51 | - * @deprecated 20.0.0 |
|
52 | - */ |
|
53 | - public const INFO = 1; |
|
54 | - /** |
|
55 | - * @since 14.0.0 |
|
56 | - * @deprecated 20.0.0 |
|
57 | - */ |
|
58 | - public const WARN = 2; |
|
59 | - /** |
|
60 | - * @since 14.0.0 |
|
61 | - * @deprecated 20.0.0 |
|
62 | - */ |
|
63 | - public const ERROR = 3; |
|
64 | - /** |
|
65 | - * @since 14.0.0 |
|
66 | - * @deprecated 20.0.0 |
|
67 | - */ |
|
68 | - public const FATAL = 4; |
|
44 | + /** |
|
45 | + * @since 14.0.0 |
|
46 | + * @deprecated 20.0.0 |
|
47 | + */ |
|
48 | + public const DEBUG = 0; |
|
49 | + /** |
|
50 | + * @since 14.0.0 |
|
51 | + * @deprecated 20.0.0 |
|
52 | + */ |
|
53 | + public const INFO = 1; |
|
54 | + /** |
|
55 | + * @since 14.0.0 |
|
56 | + * @deprecated 20.0.0 |
|
57 | + */ |
|
58 | + public const WARN = 2; |
|
59 | + /** |
|
60 | + * @since 14.0.0 |
|
61 | + * @deprecated 20.0.0 |
|
62 | + */ |
|
63 | + public const ERROR = 3; |
|
64 | + /** |
|
65 | + * @since 14.0.0 |
|
66 | + * @deprecated 20.0.0 |
|
67 | + */ |
|
68 | + public const FATAL = 4; |
|
69 | 69 | |
70 | - /** |
|
71 | - * System is unusable. |
|
72 | - * |
|
73 | - * @param string $message |
|
74 | - * @param array $context |
|
75 | - * @return null |
|
76 | - * @since 7.0.0 |
|
77 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::emergency |
|
78 | - */ |
|
79 | - public function emergency(string $message, array $context = []); |
|
70 | + /** |
|
71 | + * System is unusable. |
|
72 | + * |
|
73 | + * @param string $message |
|
74 | + * @param array $context |
|
75 | + * @return null |
|
76 | + * @since 7.0.0 |
|
77 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::emergency |
|
78 | + */ |
|
79 | + public function emergency(string $message, array $context = []); |
|
80 | 80 | |
81 | - /** |
|
82 | - * Action must be taken immediately. |
|
83 | - * |
|
84 | - * @param string $message |
|
85 | - * @param array $context |
|
86 | - * @return null |
|
87 | - * @since 7.0.0 |
|
88 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::alert |
|
89 | - */ |
|
90 | - public function alert(string $message, array $context = []); |
|
81 | + /** |
|
82 | + * Action must be taken immediately. |
|
83 | + * |
|
84 | + * @param string $message |
|
85 | + * @param array $context |
|
86 | + * @return null |
|
87 | + * @since 7.0.0 |
|
88 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::alert |
|
89 | + */ |
|
90 | + public function alert(string $message, array $context = []); |
|
91 | 91 | |
92 | - /** |
|
93 | - * Critical conditions. |
|
94 | - * |
|
95 | - * @param string $message |
|
96 | - * @param array $context |
|
97 | - * @return null |
|
98 | - * @since 7.0.0 |
|
99 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::critical |
|
100 | - */ |
|
101 | - public function critical(string $message, array $context = []); |
|
92 | + /** |
|
93 | + * Critical conditions. |
|
94 | + * |
|
95 | + * @param string $message |
|
96 | + * @param array $context |
|
97 | + * @return null |
|
98 | + * @since 7.0.0 |
|
99 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::critical |
|
100 | + */ |
|
101 | + public function critical(string $message, array $context = []); |
|
102 | 102 | |
103 | - /** |
|
104 | - * Runtime errors that do not require immediate action but should typically |
|
105 | - * be logged and monitored. |
|
106 | - * |
|
107 | - * @param string $message |
|
108 | - * @param array $context |
|
109 | - * @return null |
|
110 | - * @since 7.0.0 |
|
111 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::error |
|
112 | - */ |
|
113 | - public function error(string $message, array $context = []); |
|
103 | + /** |
|
104 | + * Runtime errors that do not require immediate action but should typically |
|
105 | + * be logged and monitored. |
|
106 | + * |
|
107 | + * @param string $message |
|
108 | + * @param array $context |
|
109 | + * @return null |
|
110 | + * @since 7.0.0 |
|
111 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::error |
|
112 | + */ |
|
113 | + public function error(string $message, array $context = []); |
|
114 | 114 | |
115 | - /** |
|
116 | - * Exceptional occurrences that are not errors. |
|
117 | - * |
|
118 | - * @param string $message |
|
119 | - * @param array $context |
|
120 | - * @return null |
|
121 | - * @since 7.0.0 |
|
122 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::warning |
|
123 | - */ |
|
124 | - public function warning(string $message, array $context = []); |
|
115 | + /** |
|
116 | + * Exceptional occurrences that are not errors. |
|
117 | + * |
|
118 | + * @param string $message |
|
119 | + * @param array $context |
|
120 | + * @return null |
|
121 | + * @since 7.0.0 |
|
122 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::warning |
|
123 | + */ |
|
124 | + public function warning(string $message, array $context = []); |
|
125 | 125 | |
126 | - /** |
|
127 | - * Normal but significant events. |
|
128 | - * |
|
129 | - * @param string $message |
|
130 | - * @param array $context |
|
131 | - * @return null |
|
132 | - * @since 7.0.0 |
|
133 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::notice |
|
134 | - */ |
|
135 | - public function notice(string $message, array $context = []); |
|
126 | + /** |
|
127 | + * Normal but significant events. |
|
128 | + * |
|
129 | + * @param string $message |
|
130 | + * @param array $context |
|
131 | + * @return null |
|
132 | + * @since 7.0.0 |
|
133 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::notice |
|
134 | + */ |
|
135 | + public function notice(string $message, array $context = []); |
|
136 | 136 | |
137 | - /** |
|
138 | - * Interesting events. |
|
139 | - * |
|
140 | - * @param string $message |
|
141 | - * @param array $context |
|
142 | - * @return null |
|
143 | - * @since 7.0.0 |
|
144 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::info |
|
145 | - */ |
|
146 | - public function info(string $message, array $context = []); |
|
137 | + /** |
|
138 | + * Interesting events. |
|
139 | + * |
|
140 | + * @param string $message |
|
141 | + * @param array $context |
|
142 | + * @return null |
|
143 | + * @since 7.0.0 |
|
144 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::info |
|
145 | + */ |
|
146 | + public function info(string $message, array $context = []); |
|
147 | 147 | |
148 | - /** |
|
149 | - * Detailed debug information. |
|
150 | - * |
|
151 | - * @param string $message |
|
152 | - * @param array $context |
|
153 | - * @return null |
|
154 | - * @since 7.0.0 |
|
155 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::debug |
|
156 | - */ |
|
157 | - public function debug(string $message, array $context = []); |
|
148 | + /** |
|
149 | + * Detailed debug information. |
|
150 | + * |
|
151 | + * @param string $message |
|
152 | + * @param array $context |
|
153 | + * @return null |
|
154 | + * @since 7.0.0 |
|
155 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::debug |
|
156 | + */ |
|
157 | + public function debug(string $message, array $context = []); |
|
158 | 158 | |
159 | - /** |
|
160 | - * Logs with an arbitrary level. |
|
161 | - * |
|
162 | - * @param int $level |
|
163 | - * @param string $message |
|
164 | - * @param array $context |
|
165 | - * @return mixed |
|
166 | - * @since 7.0.0 |
|
167 | - * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::log |
|
168 | - */ |
|
169 | - public function log(int $level, string $message, array $context = []); |
|
159 | + /** |
|
160 | + * Logs with an arbitrary level. |
|
161 | + * |
|
162 | + * @param int $level |
|
163 | + * @param string $message |
|
164 | + * @param array $context |
|
165 | + * @return mixed |
|
166 | + * @since 7.0.0 |
|
167 | + * @deprecated 20.0.0 use \Psr\Log\LoggerInterface::log |
|
168 | + */ |
|
169 | + public function log(int $level, string $message, array $context = []); |
|
170 | 170 | |
171 | - /** |
|
172 | - * Logs an exception very detailed |
|
173 | - * An additional message can we written to the log by adding it to the |
|
174 | - * context. |
|
175 | - * |
|
176 | - * <code> |
|
177 | - * $logger->logException($ex, [ |
|
178 | - * 'message' => 'Exception during background job execution' |
|
179 | - * ]); |
|
180 | - * </code> |
|
181 | - * |
|
182 | - * @param \Exception|\Throwable $exception |
|
183 | - * @param array $context |
|
184 | - * @return void |
|
185 | - * @since 8.2.0 |
|
186 | - * @deprecated 20.0.0 use the `exception` entry in the context of any method in \Psr\Log\LoggerInterface |
|
187 | - */ |
|
188 | - public function logException(\Throwable $exception, array $context = []); |
|
171 | + /** |
|
172 | + * Logs an exception very detailed |
|
173 | + * An additional message can we written to the log by adding it to the |
|
174 | + * context. |
|
175 | + * |
|
176 | + * <code> |
|
177 | + * $logger->logException($ex, [ |
|
178 | + * 'message' => 'Exception during background job execution' |
|
179 | + * ]); |
|
180 | + * </code> |
|
181 | + * |
|
182 | + * @param \Exception|\Throwable $exception |
|
183 | + * @param array $context |
|
184 | + * @return void |
|
185 | + * @since 8.2.0 |
|
186 | + * @deprecated 20.0.0 use the `exception` entry in the context of any method in \Psr\Log\LoggerInterface |
|
187 | + */ |
|
188 | + public function logException(\Throwable $exception, array $context = []); |
|
189 | 189 | } |