@@ -1,23 +1,23 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Manages user authentication with LDAP server. |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | - * |
|
11 | - * @category phpMyFAQ |
|
12 | - * @package Auth |
|
13 | - * @author Alberto Cabello <[email protected]> |
|
14 | - * @author Lars Scheithauer <[email protected]> |
|
15 | - * @author Thorsten Rinne <[email protected]> |
|
16 | - * @copyright 2009-2015 phpMyFAQ Team |
|
17 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
18 | - * @link http://www.phpmyfaq.de |
|
19 | - * @since 2009-03-01 |
|
20 | - */ |
|
3 | + * Manages user authentication with LDAP server. |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | + * |
|
11 | + * @category phpMyFAQ |
|
12 | + * @package Auth |
|
13 | + * @author Alberto Cabello <[email protected]> |
|
14 | + * @author Lars Scheithauer <[email protected]> |
|
15 | + * @author Thorsten Rinne <[email protected]> |
|
16 | + * @copyright 2009-2015 phpMyFAQ Team |
|
17 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
18 | + * @link http://www.phpmyfaq.de |
|
19 | + * @since 2009-03-01 |
|
20 | + */ |
|
21 | 21 | |
22 | 22 | if (!defined('IS_VALID_PHPMYFAQ')) { |
23 | 23 | exit(); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @param string $password Password |
135 | 135 | * |
136 | 136 | * @return boolean |
137 | - */ |
|
137 | + */ |
|
138 | 138 | public function changePassword($login, $password) |
139 | 139 | { |
140 | 140 | return true; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $bindLogin = $login; |
179 | 179 | if ($this->_ldapConfig['ldap_use_domain_prefix']) { |
180 | 180 | if (array_key_exists('domain', $optionalData)) { |
181 | - $bindLogin = $optionalData['domain'] . '\\' . $login; |
|
181 | + $bindLogin = $optionalData['domain'].'\\'.$login; |
|
182 | 182 | } |
183 | 183 | } else { |
184 | 184 | $this->ldap = new PMF_Ldap($this->_config); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $password |
207 | 207 | ); |
208 | 208 | |
209 | - if (! $this->ldap->bind($bindLogin, $password)) { |
|
209 | + if (!$this->ldap->bind($bindLogin, $password)) { |
|
210 | 210 | $this->errors[] = $this->ldap->error; |
211 | 211 | return false; |
212 | 212 | } else { |
@@ -1,22 +1,22 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Manages user authentication with Apache's SSO authentication, e.g. mod_sspi |
|
4 | - * or mod_auth_kerb |
|
5 | - * |
|
6 | - * PHP Version 5.3 |
|
7 | - * |
|
8 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
9 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
10 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
11 | - * |
|
12 | - * @category phpMyFAQ |
|
13 | - * @package Auth |
|
14 | - * @author Thorsten Rinne <[email protected]> |
|
15 | - * @copyright 2011-2015 phpMyFAQ Team |
|
16 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
17 | - * @link http://www.phpmyfaq.de |
|
18 | - * @since 2011-06-22 |
|
19 | - */ |
|
3 | + * Manages user authentication with Apache's SSO authentication, e.g. mod_sspi |
|
4 | + * or mod_auth_kerb |
|
5 | + * |
|
6 | + * PHP Version 5.3 |
|
7 | + * |
|
8 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
9 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
10 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
11 | + * |
|
12 | + * @category phpMyFAQ |
|
13 | + * @package Auth |
|
14 | + * @author Thorsten Rinne <[email protected]> |
|
15 | + * @copyright 2011-2015 phpMyFAQ Team |
|
16 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
17 | + * @link http://www.phpmyfaq.de |
|
18 | + * @since 2011-06-22 |
|
19 | + */ |
|
20 | 20 | |
21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
22 | 22 | exit(); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param string $pass Password |
79 | 79 | * |
80 | 80 | * @return boolean |
81 | - */ |
|
81 | + */ |
|
82 | 82 | public function changePassword($login, $pass) |
83 | 83 | { |
84 | 84 | return true; |
@@ -1,22 +1,22 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Provides methods for password encryption |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | - * |
|
11 | - * @category phpMyFAQ |
|
12 | - * @package Enc |
|
13 | - * @author Lars Tiedemann <[email protected]> |
|
14 | - * @author Thorsten Rinne <[email protected]> |
|
15 | - * @copyright 2005-2015 phpMyFAQ Team |
|
16 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
17 | - * @link http://www.phpmyfaq.de |
|
18 | - * @since 2005-09-18 |
|
19 | - */ |
|
3 | + * Provides methods for password encryption |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | + * |
|
11 | + * @category phpMyFAQ |
|
12 | + * @package Enc |
|
13 | + * @author Lars Tiedemann <[email protected]> |
|
14 | + * @author Thorsten Rinne <[email protected]> |
|
15 | + * @copyright 2005-2015 phpMyFAQ Team |
|
16 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
17 | + * @link http://www.phpmyfaq.de |
|
18 | + * @since 2005-09-18 |
|
19 | + */ |
|
20 | 20 | |
21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
22 | 22 | exit(); |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | $enc = new PMF_Enc($config); |
112 | 112 | $encType = ucfirst(strtolower($encType)); |
113 | 113 | |
114 | - if (! isset($encType)) { |
|
114 | + if (!isset($encType)) { |
|
115 | 115 | $enc->errors[] = self::PMF_ERROR_USER_NO_ENCTYPE; |
116 | 116 | return $enc; |
117 | 117 | } |
118 | 118 | |
119 | - $encClass = 'PMF_Enc_' . $encType; |
|
119 | + $encClass = 'PMF_Enc_'.$encType; |
|
120 | 120 | |
121 | 121 | if (!class_exists($encClass)) { |
122 | 122 | $enc->errors[] = self::PMF_ERROR_USER_NO_ENCTYPE; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | public function error() |
136 | 136 | { |
137 | 137 | if (!is_array($this->errors)) { |
138 | - $this->errors = array((string) $this->errors); |
|
138 | + $this->errors = array((string)$this->errors); |
|
139 | 139 | } |
140 | 140 | $message = ''; |
141 | 141 | foreach ($this->errors as $error) { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function setSalt($login) |
155 | 155 | { |
156 | - $this->salt = $this->_config->get('security.salt') . $login; |
|
156 | + $this->salt = $this->_config->get('security.salt').$login; |
|
157 | 157 | |
158 | 158 | return $this; |
159 | 159 | } |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Some basic functions and PMF_Init class. |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | - * |
|
11 | - * Portions created by Christian Stocker are Copyright (c) 2001-2008 Liip AG. |
|
12 | - * All Rights Reserved. |
|
13 | - * |
|
14 | - * @category phpMyFAQ |
|
15 | - * @package PMF_Init |
|
16 | - * @author Johann-Peter Hartmann <[email protected]> |
|
17 | - * @author Thorsten Rinne <[email protected]> |
|
18 | - * @author Stefan Esser <[email protected]> |
|
19 | - * @author Matteo Scaramuccia <[email protected]> |
|
20 | - * @author Christian Stocker <[email protected]> |
|
21 | - * @copyright 2005-2015 phpMyFAQ Team |
|
22 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
23 | - * @link http://www.phpmyfaq.de |
|
24 | - * @since 2005-09-24 |
|
25 | - */ |
|
3 | + * Some basic functions and PMF_Init class. |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | + * |
|
11 | + * Portions created by Christian Stocker are Copyright (c) 2001-2008 Liip AG. |
|
12 | + * All Rights Reserved. |
|
13 | + * |
|
14 | + * @category phpMyFAQ |
|
15 | + * @package PMF_Init |
|
16 | + * @author Johann-Peter Hartmann <[email protected]> |
|
17 | + * @author Thorsten Rinne <[email protected]> |
|
18 | + * @author Stefan Esser <[email protected]> |
|
19 | + * @author Matteo Scaramuccia <[email protected]> |
|
20 | + * @author Christian Stocker <[email protected]> |
|
21 | + * @copyright 2005-2015 phpMyFAQ Team |
|
22 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
23 | + * @link http://www.phpmyfaq.de |
|
24 | + * @since 2005-09-24 |
|
25 | + */ |
|
26 | 26 | |
27 | 27 | if (!defined('IS_VALID_PHPMYFAQ')) { |
28 | 28 | exit(); |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | return $filename; |
139 | 139 | } |
140 | 140 | |
141 | - /** |
|
142 | - * Clean the filename of any uploaded file by the user and force an error |
|
143 | - * when calling is_uploaded_file($_FILES[key]['tmp_name']) if the cleanup goes wrong |
|
144 | - * |
|
145 | - * @return void |
|
146 | - */ |
|
147 | - private static function _cleanFilenames() |
|
148 | - { |
|
141 | + /** |
|
142 | + * Clean the filename of any uploaded file by the user and force an error |
|
143 | + * when calling is_uploaded_file($_FILES[key]['tmp_name']) if the cleanup goes wrong |
|
144 | + * |
|
145 | + * @return void |
|
146 | + */ |
|
147 | + private static function _cleanFilenames() |
|
148 | + { |
|
149 | 149 | reset($_FILES); |
150 | 150 | while (list($key, $value) = each($_FILES)) { |
151 | 151 | if (is_array($_FILES[$key]['name'])) { |
@@ -167,7 +167,7 @@ |
||
167 | 167 | $_FILES[$key]['type'] = ''; |
168 | 168 | $_FILES[$key]['tmp_name'] = ''; |
169 | 169 | $_FILES[$key]['size'] = 0; |
170 | - $_FILES[$key]['error'] = UPLOAD_ERR_NO_FILE; |
|
170 | + $_FILES[$key]['error'] = UPLOAD_ERR_NO_FILE; |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | } |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The plurals class provides support for plural forms in PMF translations. |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | - * |
|
11 | - * @category phpMyFAQ |
|
12 | - * @package Language |
|
13 | - * @author Aurimas Fišeras <[email protected]> |
|
14 | - * @copyright 2009-2015 Aurimas Fišeras and phpMyFAQ Team |
|
15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
16 | - * @link http://www.phpmyfaq.de |
|
17 | - * @since 2009-07-30 |
|
18 | - */ |
|
3 | + * The plurals class provides support for plural forms in PMF translations. |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | + * |
|
11 | + * @category phpMyFAQ |
|
12 | + * @package Language |
|
13 | + * @author Aurimas Fišeras <[email protected]> |
|
14 | + * @copyright 2009-2015 Aurimas Fišeras and phpMyFAQ Team |
|
15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
16 | + * @link http://www.phpmyfaq.de |
|
17 | + * @since 2009-07-30 |
|
18 | + */ |
|
19 | 19 | |
20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
21 | 21 | exit(); |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | private $useDefaultPluralForm; |
64 | 64 | |
65 | 65 | /** |
66 | - * Constructor |
|
67 | - * |
|
68 | - * @param array $translation PMF translation array for current language |
|
69 | - * @return void |
|
70 | - */ |
|
66 | + * Constructor |
|
67 | + * |
|
68 | + * @param array $translation PMF translation array for current language |
|
69 | + * @return void |
|
70 | + */ |
|
71 | 71 | public function __construct($translation) |
72 | 72 | { |
73 | 73 | $this->PMF_TRANSL = $translation; |
@@ -100,9 +100,9 @@ |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | $plural = $this->plural($this->lang, $n); |
103 | - if ($plural > $this->nPlurals-1) { |
|
103 | + if ($plural > $this->nPlurals - 1) { |
|
104 | 104 | // incorrectly defined plural function or wrong $nPlurals |
105 | - return $this->nPlurals-1; |
|
105 | + return $this->nPlurals - 1; |
|
106 | 106 | } else { |
107 | 107 | return $plural; |
108 | 108 | } |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | // $network seems to be a real network address |
118 | 118 | $x = ip2long($ip_arr[1]); |
119 | 119 | // Evaluate the netmask: <Network Mask> or <CIDR> |
120 | - $mask = ( long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1])); |
|
121 | - $matched = ( ($ip_long & $mask) == ($network_long & $mask) ); |
|
120 | + $mask = (long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1])); |
|
121 | + $matched = (($ip_long & $mask) == ($network_long & $mask)); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | return $matched; |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | $bytes_addr = unpack("n*", inet_pton($addr)); |
154 | 154 | $bytes_test = unpack("n*", inet_pton($ip)); |
155 | 155 | |
156 | - for ($i = 1; $i <= ceil($preflen / 16); $i++) { |
|
157 | - $left = $preflen - 16 * ($i-1); |
|
156 | + for ($i = 1; $i <= ceil($preflen/16); $i++) { |
|
157 | + $left = $preflen - 16*($i - 1); |
|
158 | 158 | if ($left > 16) { |
159 | 159 | $left = 16; |
160 | 160 | } |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The PMF_Cache_Service class provides abstract cache functionality |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | - * |
|
11 | - * @category phpMyFAQ |
|
12 | - * @package PMF_Cache_Service |
|
13 | - * @author Anatoliy Belsky <[email protected]> |
|
14 | - * @copyright 2002-2015 phpMyFAQ Team |
|
15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
16 | - * @link http://www.phpmyfaq.de |
|
17 | - * @since 2011-09-23 |
|
18 | - */ |
|
3 | + * The PMF_Cache_Service class provides abstract cache functionality |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | + * |
|
11 | + * @category phpMyFAQ |
|
12 | + * @package PMF_Cache_Service |
|
13 | + * @author Anatoliy Belsky <[email protected]> |
|
14 | + * @copyright 2002-2015 phpMyFAQ Team |
|
15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
16 | + * @link http://www.phpmyfaq.de |
|
17 | + * @since 2011-09-23 |
|
18 | + */ |
|
19 | 19 | |
20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
21 | 21 | exit(); |
@@ -34,28 +34,28 @@ discard block |
||
34 | 34 | */ |
35 | 35 | abstract class PMF_Cache_Service |
36 | 36 | { |
37 | - /** |
|
38 | - * Children must implement the constructor with the appropriate config. |
|
39 | - * |
|
40 | - * @param array $config Cache configuration |
|
41 | - * |
|
42 | - * @return void |
|
43 | - */ |
|
44 | - abstract function __construct(array $config); |
|
37 | + /** |
|
38 | + * Children must implement the constructor with the appropriate config. |
|
39 | + * |
|
40 | + * @param array $config Cache configuration |
|
41 | + * |
|
42 | + * @return void |
|
43 | + */ |
|
44 | + abstract function __construct(array $config); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Children must implement this to be able to clear the single article cache as well as all the related items. |
|
48 | - * |
|
49 | - * @param intereg $id Article id |
|
50 | - * |
|
51 | - * @return void |
|
52 | - */ |
|
53 | - abstract function clearArticle($id); |
|
46 | + /** |
|
47 | + * Children must implement this to be able to clear the single article cache as well as all the related items. |
|
48 | + * |
|
49 | + * @param intereg $id Article id |
|
50 | + * |
|
51 | + * @return void |
|
52 | + */ |
|
53 | + abstract function clearArticle($id); |
|
54 | 54 | |
55 | - /** |
|
56 | - * Children must implement this to be able to clear all the cache contents at once. |
|
57 | - * |
|
58 | - * @return void |
|
59 | - */ |
|
60 | - abstract function clearAll(); |
|
55 | + /** |
|
56 | + * Children must implement this to be able to clear all the cache contents at once. |
|
57 | + * |
|
58 | + * @return void |
|
59 | + */ |
|
60 | + abstract function clearAll(); |
|
61 | 61 | } |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The PMF_Cache_Apc class implements the APC cache service functionality |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | - * |
|
11 | - * @category phpMyFAQ |
|
12 | - * @package PMF_Cache_Apc |
|
13 | - * @author Thorsten Rinne <[email protected]> |
|
14 | - * @copyright 2011-2015 phpMyFAQ Team |
|
15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
16 | - * @link http://www.phpmyfaq.de |
|
17 | - * @since 2011-10-01 |
|
18 | - */ |
|
3 | + * The PMF_Cache_Apc class implements the APC cache service functionality |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | + * |
|
11 | + * @category phpMyFAQ |
|
12 | + * @package PMF_Cache_Apc |
|
13 | + * @author Thorsten Rinne <[email protected]> |
|
14 | + * @copyright 2011-2015 phpMyFAQ Team |
|
15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
16 | + * @link http://www.phpmyfaq.de |
|
17 | + * @since 2011-10-01 |
|
18 | + */ |
|
19 | 19 | |
20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
21 | 21 | exit(); |
@@ -34,51 +34,51 @@ |
||
34 | 34 | */ |
35 | 35 | class PMF_Cache_Varnish extends PMF_Cache_Service |
36 | 36 | { |
37 | - protected $instance = NULL; |
|
37 | + protected $instance = NULL; |
|
38 | 38 | |
39 | - /** |
|
40 | - * Constructor. |
|
41 | - * |
|
42 | - * @param array $config Cache configuration |
|
43 | - * |
|
44 | - * @return void |
|
45 | - */ |
|
46 | - public function __construct(array $config) |
|
47 | - { |
|
48 | - $this->instance = new VarnishAdmin($config); |
|
39 | + /** |
|
40 | + * Constructor. |
|
41 | + * |
|
42 | + * @param array $config Cache configuration |
|
43 | + * |
|
44 | + * @return void |
|
45 | + */ |
|
46 | + public function __construct(array $config) |
|
47 | + { |
|
48 | + $this->instance = new VarnishAdmin($config); |
|
49 | 49 | |
50 | - try { |
|
51 | - if(!$this->instance->connect()) { |
|
52 | - throw new VarnishException("Connection failed\n"); |
|
53 | - } |
|
54 | - } catch (VarnishException $e) { |
|
55 | - echo $e->getMessage(); |
|
56 | - } |
|
50 | + try { |
|
51 | + if(!$this->instance->connect()) { |
|
52 | + throw new VarnishException("Connection failed\n"); |
|
53 | + } |
|
54 | + } catch (VarnishException $e) { |
|
55 | + echo $e->getMessage(); |
|
56 | + } |
|
57 | 57 | |
58 | - try { |
|
59 | - if(!$this->instance->auth()) { |
|
60 | - throw new VarnishException("Auth failed\n"); |
|
61 | - } |
|
62 | - } catch (VarnishException $e) { |
|
63 | - echo $e->getMessage(); |
|
64 | - } |
|
65 | - } |
|
58 | + try { |
|
59 | + if(!$this->instance->auth()) { |
|
60 | + throw new VarnishException("Auth failed\n"); |
|
61 | + } |
|
62 | + } catch (VarnishException $e) { |
|
63 | + echo $e->getMessage(); |
|
64 | + } |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * Clear all cached article related items. |
|
69 | - * |
|
70 | - * @param intereg $id Article id |
|
71 | - * |
|
72 | - * @return void |
|
73 | - */ |
|
74 | - public function clearArticle($id) |
|
75 | - { |
|
76 | - $this->clearAll(); |
|
77 | - } |
|
67 | + /** |
|
68 | + * Clear all cached article related items. |
|
69 | + * |
|
70 | + * @param intereg $id Article id |
|
71 | + * |
|
72 | + * @return void |
|
73 | + */ |
|
74 | + public function clearArticle($id) |
|
75 | + { |
|
76 | + $this->clearAll(); |
|
77 | + } |
|
78 | 78 | |
79 | - public function clearAll() |
|
80 | - { |
|
81 | - $this->instance->banUrl(".*"); |
|
82 | - } |
|
79 | + public function clearAll() |
|
80 | + { |
|
81 | + $this->instance->banUrl(".*"); |
|
82 | + } |
|
83 | 83 | |
84 | 84 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $this->instance = new VarnishAdmin($config); |
49 | 49 | |
50 | 50 | try { |
51 | - if(!$this->instance->connect()) { |
|
51 | + if (!$this->instance->connect()) { |
|
52 | 52 | throw new VarnishException("Connection failed\n"); |
53 | 53 | } |
54 | 54 | } catch (VarnishException $e) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | try { |
59 | - if(!$this->instance->auth()) { |
|
59 | + if (!$this->instance->auth()) { |
|
60 | 60 | throw new VarnishException("Auth failed\n"); |
61 | 61 | } |
62 | 62 | } catch (VarnishException $e) { |