Completed
Push — master ( 37253d...830469 )
by Nazar
04:26
created
Storage.php 2 patches
Switch Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -29,48 +29,48 @@
 block discarded – undo
29 29
 }
30 30
 
31 31
 switch ($data['function']) {
32
-	default:
33
-		return;
34
-	case 'get_files_list':
35
-		echo _json_encode(get_files_list($data['dir'], $data['mask'], $data['mode'], $data['prefix_path'], $data['subfolders'], $data['sort'], $data['exclusion'], $data['system_files'], null, $data['limit']));
36
-		return;
37
-	case 'file':
38
-		echo _json_encode(file($data['filename'], $data['flags']));
39
-		return;
40
-	case 'file_get_contents':
41
-		echo file_get_contents($data['filename'], $data['flags'], null, $data['offset'], $data['maxlen']);
42
-		return;
43
-	case 'file_put_contents':
44
-		echo file_put_contents($data['filename'], $data['data'], $data['flags']);
45
-		return;
46
-	case 'copy':
47
-		echo copy($data['source'], $data['dest']);
48
-		return;
49
-	case 'unlink':
50
-		echo unlink($data['filename']);
51
-		return;
52
-	case 'file_exists':
53
-		echo file_exists($data['filename']);
54
-		return;
55
-	case 'move_uploaded_file':
56
-		echo copy($data['filename'], $data['destination']);
57
-		return;
58
-	case 'rename':
59
-		echo rename($data['oldname'], $data['newname']);
60
-		return;
61
-	case 'mkdir':
62
-		echo mkdir($data['pathname']);
63
-		return;
64
-	case 'rmdir':
65
-		echo rmdir($data['dirname']);
66
-		return;
67
-	case 'is_file':
68
-		echo is_file($data['filename']);
69
-		return;
70
-	case 'is_dir':
71
-		echo is_dir($data['filename']);
72
-		return;
73
-	case 'test':
74
-		echo 'OK';
75
-		return;
32
+		default:
33
+			return;
34
+		case 'get_files_list':
35
+			echo _json_encode(get_files_list($data['dir'], $data['mask'], $data['mode'], $data['prefix_path'], $data['subfolders'], $data['sort'], $data['exclusion'], $data['system_files'], null, $data['limit']));
36
+			return;
37
+		case 'file':
38
+			echo _json_encode(file($data['filename'], $data['flags']));
39
+			return;
40
+		case 'file_get_contents':
41
+			echo file_get_contents($data['filename'], $data['flags'], null, $data['offset'], $data['maxlen']);
42
+			return;
43
+		case 'file_put_contents':
44
+			echo file_put_contents($data['filename'], $data['data'], $data['flags']);
45
+			return;
46
+		case 'copy':
47
+			echo copy($data['source'], $data['dest']);
48
+			return;
49
+		case 'unlink':
50
+			echo unlink($data['filename']);
51
+			return;
52
+		case 'file_exists':
53
+			echo file_exists($data['filename']);
54
+			return;
55
+		case 'move_uploaded_file':
56
+			echo copy($data['filename'], $data['destination']);
57
+			return;
58
+		case 'rename':
59
+			echo rename($data['oldname'], $data['newname']);
60
+			return;
61
+		case 'mkdir':
62
+			echo mkdir($data['pathname']);
63
+			return;
64
+		case 'rmdir':
65
+			echo rmdir($data['dirname']);
66
+			return;
67
+		case 'is_file':
68
+			echo is_file($data['filename']);
69
+			return;
70
+		case 'is_dir':
71
+			echo is_dir($data['filename']);
72
+			return;
73
+		case 'test':
74
+			echo 'OK';
75
+			return;
76 76
 }
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package    CleverStyle CMS
4
- * @subpackage HTTP Storage Engine backend
5
- * @author     Nazar Mokrynskyi <[email protected]>
6
- * @copyright  Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license    MIT License, see license.txt
8
- *
9
- * Requires config.php file in current directory with specified global variables $STORAGE_USER and $STORAGE_PASSWORD
10
- */
3
+	 * @package    CleverStyle CMS
4
+	 * @subpackage HTTP Storage Engine backend
5
+	 * @author     Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright  Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license    MIT License, see license.txt
8
+	 *
9
+	 * Requires config.php file in current directory with specified global variables $STORAGE_USER and $STORAGE_PASSWORD
10
+	 */
11 11
 header('Content-Type: text/html; charset=utf-8');
12 12
 header('Connection: close');
13 13
 require __DIR__.'/core/thirdparty/upf.php';
Please login to merge, or discard this patch.
build/Builder.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@
 block discarded – undo
262 262
 			"$this->root/license.txt",
263 263
 			"$this->root/Storage.php"
264 264
 		];
265
-		$files            = [];
265
+		$files = [];
266 266
 		foreach ($files_to_include as $s) {
267 267
 			if (is_file($s)) {
268 268
 				$files[] = $s;
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package    CleverStyle CMS
4
- * @subpackage Builder
5
- * @author     Nazar Mokrynskyi <[email protected]>
6
- * @copyright  Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license    MIT License, see license.txt
8
- */
3
+	 * @package    CleverStyle CMS
4
+	 * @subpackage Builder
5
+	 * @author     Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright  Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license    MIT License, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 use
11 11
 	h,
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	Phar::webPhar(null, 'install.php');
160 160
 }
161 161
 __HALT_COMPILER();
162
-STUB
162
+stub
163 163
 		);
164 164
 		$phar->stopBuffering();
165 165
 		return "Done! CleverStyle CMS $version";
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 #</Files>
300 300
 
301 301
 RewriteRule .* index.php
302
-HTACCESS;
302
+htaccess;
303 303
 	}
304 304
 	/**
305 305
 	 * @param string      $module
Please login to merge, or discard this patch.
components/modules/Blockchain_payment/Transactions.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 	use
23 23
 		Singleton;
24 24
 
25
-	protected $data_model     = [
25
+	protected $data_model = [
26 26
 		'id'                     => 'int',
27 27
 		'amount'                 => 'float:0',
28 28
 		'currency'               => 'text',
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blockchain payment
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blockchain payment
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blockchain_payment;
10 10
 use
11 11
 	cs\ExitException,
Please login to merge, or discard this patch.
components/modules/Blogs/Sections.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 				]
107 107
 			);
108 108
 		}
109
-		$sections              = $this->db()->qfa(
109
+		$sections = $this->db()->qfa(
110 110
 			[
111 111
 				"SELECT
112 112
 					`id`,
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Language;
Please login to merge, or discard this patch.
components/modules/Comments/Comments.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@
 block discarded – undo
264 264
 	function count ($item) {
265 265
 		$item = (int)$item;
266 266
 		$L    = Language::instance();
267
-		return $this->cache->get("$item/count/$L->clang", function () use ($item)  {
267
+		return $this->cache->get("$item/count/$L->clang", function () use ($item) {
268 268
 			return $this->count_internal($this->tree_data($item)) ?: 0;
269 269
 		});
270 270
 	}
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Comments
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Comments
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 Event::instance()->on(
11 11
 	'System/Index/construct',
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
 	/**
35 35
 	 * @var int	Avatar size in px, can be redefined
36 36
 	 */
37
-	public		$avatar_size	= 36;
37
+	public		$avatar_size = 36;
38 38
 
39 39
 	protected function construct () {
40
-		$this->module	= Request::instance()->current_module;
41
-		$this->cache	= new Cache_prefix("Comments/$this->module");
40
+		$this->module = Request::instance()->current_module;
41
+		$this->cache = new Cache_prefix("Comments/$this->module");
42 42
 	}
43 43
 	/**
44 44
 	 * Set module (current module assumed by default)
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	 * @param string	$module	Module name
47 47
 	 */
48 48
 	function set_module ($module) {
49
-		$this->module	= $module;
50
-		$this->cache	= new Cache_prefix("Comments/$this->module");
49
+		$this->module = $module;
50
+		$this->cache = new Cache_prefix("Comments/$this->module");
51 51
 	}
52 52
 	/**
53 53
 	 * Returns database index
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @return array|false		Array of comment data on success or <b>false</b> on failure
66 66
 	 */
67 67
 	function get ($id) {
68
-		$id	= (int)$id;
68
+		$id = (int)$id;
69 69
 		return $this->db()->qf([
70 70
 			"SELECT
71 71
 				`id`,
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
 	 * @return array|bool			Array of comment data on success or <b>false</b> on failure
95 95
 	 */
96 96
 	function add ($item, $text, $parent = 0) {
97
-		$L		= Language::instance();
97
+		$L = Language::instance();
98 98
 		$User	= User::instance();
99 99
 		$text	= xap($text, true);
100 100
 		if (!$text) {
101 101
 			return false;
102 102
 		}
103
-		$item	= (int)$item;
104
-		$parent	= (int)$parent;
103
+		$item = (int)$item;
104
+		$parent = (int)$parent;
105 105
 		if (
106 106
 			$parent != 0 &&
107 107
 			$this->db_prime()->qfs([
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 	 * @return array|false			Array of comment data on success or <b>false</b> on failure
170 170
 	 */
171 171
 	function set ($id, $text) {
172
-		$text	= xap($text, true);
172
+		$text = xap($text, true);
173 173
 		if (!$text) {
174 174
 			return false;
175 175
 		}
176
-		$id				= (int)$id;
177
-		$comment		= $this->get($id);
176
+		$id = (int)$id;
177
+		$comment = $this->get($id);
178 178
 		if (!$comment) {
179 179
 			return false;
180 180
 		}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 			$this->module
191 191
 		)) {
192 192
 			unset($this->cache->{$comment['item']});
193
-			$comment['text']	= $text;
193
+			$comment['text'] = $text;
194 194
 			return $comment;
195 195
 		}
196 196
 		return false;
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 	 * @return bool
204 204
 	 */
205 205
 	function del ($id) {
206
-		$id				= (int)$id;
207
-		$comment		= $this->db_prime()->qf([
206
+		$id = (int)$id;
207
+		$comment = $this->db_prime()->qf([
208 208
 			"SELECT `p`.`item`, COUNT(`c`.`id`) AS `count`
209 209
 			FROM `[prefix]comments` AS `p`
210 210
 			LEFT JOIN `[prefix]comments` AS `c`
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 * @return bool
242 242
 	 */
243 243
 	function del_all ($item) {
244
-		$item			= (int)$item;
244
+		$item = (int)$item;
245 245
 		if ($this->db_prime()->q(
246 246
 			"DELETE FROM `[prefix]comments`
247 247
 			WHERE
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
 		if (!is_array($data)) {
274 274
 			return 0;
275 275
 		}
276
-		$count	= 0;
276
+		$count = 0;
277 277
 		foreach ($data as &$d) {
278
-			$count	+= $this->count_internal($d['comments']) + 1;
278
+			$count += $this->count_internal($d['comments']) + 1;
279 279
 		}
280 280
 		return $count;
281 281
 	}
@@ -298,12 +298,12 @@  discard block
 block discarded – undo
298 298
 	 * @return false|array
299 299
 	 */
300 300
 	function tree_data ($item, $parent = 0) {
301
-		$Cache	= $this->cache;
302
-		$L		= Language::instance();
301
+		$Cache = $this->cache;
302
+		$L = Language::instance();
303 303
 		if (($comments = $Cache->{"$item/$L->clang"}) === false) {
304
-			$item		= (int)$item;
305
-			$parent		= (int)$parent;
306
-			$comments	= $this->db()->qfa([
304
+			$item = (int)$item;
305
+			$parent = (int)$parent;
306
+			$comments = $this->db()->qfa([
307 307
 				"SELECT
308 308
 					`id`,
309 309
 					`parent`,
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 			 * Cache only root tree data
329 329
 			 */
330 330
 			if ($parent == 0) {
331
-				$Cache->{"$item/$L->clang"}	= $comments;
331
+				$Cache->{"$item/$L->clang"} = $comments;
332 332
 			}
333 333
 		}
334 334
 		return $comments;
@@ -341,15 +341,15 @@  discard block
 block discarded – undo
341 341
 	 * @return string
342 342
 	 */
343 343
 	function tree_html ($comments) {
344
-		$L			= Language::instance();
345
-		$User		= User::instance();
344
+		$L = Language::instance();
345
+		$User = User::instance();
346 346
 		if (!is_array($comments) || !$comments) {
347 347
 			return '';
348 348
 		}
349
-		$content	= '';
349
+		$content = '';
350 350
 		foreach ($comments as $comment) {
351
-			$uniqid		= uniqid('comment_', true);
352
-			$content	.= str_replace($uniqid, $comment['text'], h::{'article.cs-comments-comment'}(
351
+			$uniqid = uniqid('comment_', true);
352
+			$content .= str_replace($uniqid, $comment['text'], h::{'article.cs-comments-comment'}(
353 353
 				h::{'img.cs-comments-comment-avatar'}([
354 354
 					'src'	=> $User->avatar($this->avatar_size, $comment['user']),
355 355
 					'alt'	=> $User->username($comment['user']),
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	 * @return string
406 406
 	 */
407 407
 	function block ($item) {
408
-		$L	= new Language_prefix('comments_');
408
+		$L = new Language_prefix('comments_');
409 409
 		return h::{'section#comments.cs-comments-comments'}(
410 410
 			$L->comments.':'.
411 411
 			(
Please login to merge, or discard this patch.
components/modules/Comments/events/enabled.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 Event::instance()->on(
20 20
 	'Comments/instance',
21 21
 	function ($data) {
22
-		$data['Comments']	= Comments::instance();
22
+		$data['Comments'] = Comments::instance();
23 23
 		return false;
24 24
 	}
25 25
 );
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package		Comments
4
- * @category	modules
5
- * @author		Nazar Mokrynskyi <[email protected]>
6
- * @copyright	Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license		MIT License, see license.txt
8
- */
3
+	 * @package		Comments
4
+	 * @category	modules
5
+	 * @author		Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright	Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license		MIT License, see license.txt
8
+	 */
9 9
 /**
10
- * Supports next events:
11
- *  Comments/instance
12
- *  [
13
- *   'Comments'		=> <i>&$Comments</i>
14
- *  ]
15
- */
10
+	 * Supports next events:
11
+	 *  Comments/instance
12
+	 *  [
13
+	 *   'Comments'		=> <i>&$Comments</i>
14
+	 *  ]
15
+	 */
16 16
 namespace	cs\modules\Comments;
17 17
 use
18 18
 	cs\Event;
Please login to merge, or discard this patch.
components/modules/Content/Content.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 		'content' => null, //Is set in constructor
32 32
 		'type'    => 'set:text,html'
33 33
 	];
34
-	protected $table      = '[prefix]content';
34
+	protected $table = '[prefix]content';
35 35
 	/**
36 36
 	 * @var Prefix
37 37
 	 */
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package        Content
4
- * @category       modules
5
- * @author         Nazar Mokrynskyi <[email protected]>
6
- * @copyright      Copyright (c) 2014-2016, Nazar Mokrynskyi
7
- * @license        MIT License, see license.txt
8
- */
3
+	 * @package        Content
4
+	 * @category       modules
5
+	 * @author         Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright      Copyright (c) 2014-2016, Nazar Mokrynskyi
7
+	 * @license        MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Content;
10 10
 
11 11
 use
Please login to merge, or discard this patch.
components/modules/Deferred_tasks/Deferred_tasks.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 		'module'       => 'text',
32 32
 		'data'         => null            //Is set in constructor
33 33
 	];
34
-	protected $table      = '[prefix]deferred_tasks_tasks';
34
+	protected $table = '[prefix]deferred_tasks_tasks';
35 35
 	/**
36 36
 	 * @var int
37 37
 	 */
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Deferred tasks
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Deferred tasks
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 Event::instance()->on(
11 11
 	'System/Index/construct',
Please login to merge, or discard this patch.
components/modules/Disqus/events/enabled.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 Event::instance()->on(
20 20
 	'Comments/instance',
21 21
 	function ($data) {
22
-		$data['Comments']	= Disqus::instance();
22
+		$data['Comments'] = Disqus::instance();
23 23
 		return false;
24 24
 	}
25 25
 );
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package		Disqus
4
- * @category	modules
5
- * @author		Nazar Mokrynskyi <[email protected]>
6
- * @copyright	Copyright (c) 2013-2016, Nazar Mokrynskyi
7
- * @license		MIT License, see license.txt
8
- */
3
+	 * @package		Disqus
4
+	 * @category	modules
5
+	 * @author		Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright	Copyright (c) 2013-2016, Nazar Mokrynskyi
7
+	 * @license		MIT License, see license.txt
8
+	 */
9 9
 /**
10
- * Supports next events:
11
- *  Comments/instance
12
- *  [
13
- *   'Comments'		=> <i>&$Comments</i>
14
- *  ]
15
- */
10
+	 * Supports next events:
11
+	 *  Comments/instance
12
+	 *  [
13
+	 *   'Comments'		=> <i>&$Comments</i>
14
+	 *  ]
15
+	 */
16 16
 namespace	cs\modules\Disqus;
17 17
 use
18 18
 	cs\Event;
Please login to merge, or discard this patch.