Completed
Push — develop ( 8dee05 )
by Dmytro
20:08
created
install/stubs/migrations/2018_06_29_182342_create_webgroup_names_table.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -5,29 +5,29 @@
 block discarded – undo
5 5
 
6 6
 class CreateWebgroupNamesTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('webgroup_names', function(Blueprint $table)
16
-		{
17
-			$table->integer('id', true);
18
-			$table->string('name', 245)->default('')->unique('name');
19
-		});
20
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('webgroup_names', function(Blueprint $table)
16
+        {
17
+            $table->integer('id', true);
18
+            $table->string('name', 245)->default('')->unique('name');
19
+        });
20
+    }
21 21
 
22 22
 
23
-	/**
24
-	 * Reverse the migrations.
25
-	 *
26
-	 * @return void
27
-	 */
28
-	public function down()
29
-	{
30
-		Schema::drop('webgroup_names');
31
-	}
23
+    /**
24
+     * Reverse the migrations.
25
+     *
26
+     * @return void
27
+     */
28
+    public function down()
29
+    {
30
+        Schema::drop('webgroup_names');
31
+    }
32 32
 
33 33
 }
Please login to merge, or discard this patch.
install/stubs/migrations/2018_06_29_182342_create_webgroup_access_table.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -5,30 +5,30 @@
 block discarded – undo
5 5
 
6 6
 class CreateWebgroupAccessTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('webgroup_access', function(Blueprint $table)
16
-		{
17
-			$table->integer('id', true);
18
-			$table->integer('webgroup')->default(0);
19
-			$table->integer('documentgroup')->default(0);
20
-		});
21
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('webgroup_access', function(Blueprint $table)
16
+        {
17
+            $table->integer('id', true);
18
+            $table->integer('webgroup')->default(0);
19
+            $table->integer('documentgroup')->default(0);
20
+        });
21
+    }
22 22
 
23 23
 
24
-	/**
25
-	 * Reverse the migrations.
26
-	 *
27
-	 * @return void
28
-	 */
29
-	public function down()
30
-	{
31
-		Schema::drop('webgroup_access');
32
-	}
24
+    /**
25
+     * Reverse the migrations.
26
+     *
27
+     * @return void
28
+     */
29
+    public function down()
30
+    {
31
+        Schema::drop('webgroup_access');
32
+    }
33 33
 
34 34
 }
Please login to merge, or discard this patch.
install/stubs/migrations/2018_06_29_182342_create_site_templates_table.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -5,39 +5,39 @@
 block discarded – undo
5 5
 
6 6
 class CreateSiteTemplatesTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('site_templates', function(Blueprint $table)
16
-		{
17
-			$table->integer('id', true);
18
-			$table->string('templatename', 100)->default('');
19
-			$table->string('description')->default('Template');
20
-			$table->integer('editor_type')->default(0)->comment('0-plain text,1-rich text,2-code editor');
21
-			$table->integer('category')->default(0)->comment('category id');
22
-			$table->string('icon')->default('')->comment('url to icon file');
23
-			$table->integer('template_type')->default(0)->comment('0-page,1-content');
24
-			$table->text('content', 16777215)->nullable();
25
-			$table->boolean('locked')->default(0);
26
-			$table->boolean('selectable')->default(1);
27
-			$table->integer('createdon')->default(0);
28
-			$table->integer('editedon')->default(0);
29
-		});
30
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('site_templates', function(Blueprint $table)
16
+        {
17
+            $table->integer('id', true);
18
+            $table->string('templatename', 100)->default('');
19
+            $table->string('description')->default('Template');
20
+            $table->integer('editor_type')->default(0)->comment('0-plain text,1-rich text,2-code editor');
21
+            $table->integer('category')->default(0)->comment('category id');
22
+            $table->string('icon')->default('')->comment('url to icon file');
23
+            $table->integer('template_type')->default(0)->comment('0-page,1-content');
24
+            $table->text('content', 16777215)->nullable();
25
+            $table->boolean('locked')->default(0);
26
+            $table->boolean('selectable')->default(1);
27
+            $table->integer('createdon')->default(0);
28
+            $table->integer('editedon')->default(0);
29
+        });
30
+    }
31 31
 
32 32
 
33
-	/**
34
-	 * Reverse the migrations.
35
-	 *
36
-	 * @return void
37
-	 */
38
-	public function down()
39
-	{
40
-		Schema::drop('site_templates');
41
-	}
33
+    /**
34
+     * Reverse the migrations.
35
+     *
36
+     * @return void
37
+     */
38
+    public function down()
39
+    {
40
+        Schema::drop('site_templates');
41
+    }
42 42
 
43 43
 }
Please login to merge, or discard this patch.
install/stubs/migrations/2018_06_29_182342_create_active_users_table.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -5,33 +5,33 @@
 block discarded – undo
5 5
 
6 6
 class CreateActiveUsersTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('active_users', function(Blueprint $table)
16
-		{
17
-			$table->string('sid', 32)->default('')->primary();
18
-			$table->integer('internalKey')->default(0);
19
-			$table->string('username', 50)->default('');
20
-			$table->integer('lasthit')->default(0);
21
-			$table->string('action', 10)->default('');
22
-			$table->integer('id')->nullable();
23
-		});
24
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('active_users', function(Blueprint $table)
16
+        {
17
+            $table->string('sid', 32)->default('')->primary();
18
+            $table->integer('internalKey')->default(0);
19
+            $table->string('username', 50)->default('');
20
+            $table->integer('lasthit')->default(0);
21
+            $table->string('action', 10)->default('');
22
+            $table->integer('id')->nullable();
23
+        });
24
+    }
25 25
 
26 26
 
27
-	/**
28
-	 * Reverse the migrations.
29
-	 *
30
-	 * @return void
31
-	 */
32
-	public function down()
33
-	{
34
-		Schema::drop('active_users');
35
-	}
27
+    /**
28
+     * Reverse the migrations.
29
+     *
30
+     * @return void
31
+     */
32
+    public function down()
33
+    {
34
+        Schema::drop('active_users');
35
+    }
36 36
 
37 37
 }
Please login to merge, or discard this patch.
install/src/sqlParser.class.php 1 patch
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -4,141 +4,141 @@  discard block
 block discarded – undo
4 4
 // SNUFFKIN/ Alex 2004
5 5
 
6 6
 class SqlParser {
7
-	public $host;
8
-	public $dbname;
9
-	public $prefix;
10
-	public $user;
11
-	public $password;
12
-	public $mysqlErrors;
13
-	public $conn;
14
-	public $installFailed;
15
-	public $sitename;
16
-	public $adminname;
17
-	public $adminemail;
18
-	public $adminpass;
19
-	public $managerlanguage;
20
-	public $mode;
21
-	public $fileManagerPath;
22
-	public $imgPath;
23
-	public $imgUrl;
24
-	public $dbMODx;
25
-	public $dbVersion;
7
+    public $host;
8
+    public $dbname;
9
+    public $prefix;
10
+    public $user;
11
+    public $password;
12
+    public $mysqlErrors;
13
+    public $conn;
14
+    public $installFailed;
15
+    public $sitename;
16
+    public $adminname;
17
+    public $adminemail;
18
+    public $adminpass;
19
+    public $managerlanguage;
20
+    public $mode;
21
+    public $fileManagerPath;
22
+    public $imgPath;
23
+    public $imgUrl;
24
+    public $dbMODx;
25
+    public $dbVersion;
26 26
     public $connection_charset;
27 27
     public $connection_method;
28 28
     public $ignoreDuplicateErrors;
29 29
     public $autoTemplateLogic;
30 30
 
31
-	public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') {
32
-		$this->host = $host;
33
-		$this->dbname = $db;
34
-		$this->prefix = $prefix;
35
-		$this->user = $user;
36
-		$this->password = $password;
37
-		$this->adminpass = $adminpass;
38
-		$this->adminname = $adminname;
39
-		$this->adminemail = $adminemail;
40
-		$this->connection_charset = $connection_charset;
41
-		$this->connection_method = $connection_method;
42
-		$this->ignoreDuplicateErrors = false;
43
-		$this->managerlanguage = $managerlanguage;
31
+    public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') {
32
+        $this->host = $host;
33
+        $this->dbname = $db;
34
+        $this->prefix = $prefix;
35
+        $this->user = $user;
36
+        $this->password = $password;
37
+        $this->adminpass = $adminpass;
38
+        $this->adminname = $adminname;
39
+        $this->adminemail = $adminemail;
40
+        $this->connection_charset = $connection_charset;
41
+        $this->connection_method = $connection_method;
42
+        $this->ignoreDuplicateErrors = false;
43
+        $this->managerlanguage = $managerlanguage;
44 44
         $this->autoTemplateLogic = $auto_template_logic;
45
-	}
45
+    }
46 46
 
47
-	public function connect() {
47
+    public function connect() {
48 48
         $host = explode(':', $this->host, 2);
49 49
         $this->conn = mysqli_connect($host[0], $this->user, $this->password,'', isset($host[1]) ? $host[1] : null);
50
-		mysqli_select_db($this->conn, $this->dbname);
51
-		if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset);
52
-
53
-		$this->dbVersion = 3.23; // assume version 3.23
54
-		if(function_exists("mysqli_get_server_info")) {
55
-			$ver = mysqli_get_server_info($this->conn);
56
-			$this->dbMODx 	 = version_compare($ver,"4.0.2");
57
-			$this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2]
58
-		}
50
+        mysqli_select_db($this->conn, $this->dbname);
51
+        if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset);
52
+
53
+        $this->dbVersion = 3.23; // assume version 3.23
54
+        if(function_exists("mysqli_get_server_info")) {
55
+            $ver = mysqli_get_server_info($this->conn);
56
+            $this->dbMODx 	 = version_compare($ver,"4.0.2");
57
+            $this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2]
58
+        }
59 59
 
60 60
         mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}");
61
-	}
61
+    }
62 62
 
63 63
     public function process($filename) {
64
-	    global $custom_placeholders;
65
-
66
-		// check to make sure file exists
67
-		if (!file_exists($filename)) {
68
-			$this->mysqlErrors[] = array("error" => "File '$filename' not found");
69
-			$this->installFailed = true ;
70
-			return false;
71
-		}
72
-
73
-		$fh = fopen($filename, 'r');
74
-		$idata = '';
75
-
76
-		while (!feof($fh)) {
77
-			$idata .= fread($fh, 1024);
78
-		}
79
-
80
-		fclose($fh);
81
-		$idata = str_replace("\r", '', $idata);
82
-
83
-		// check if in upgrade mode
84
-		if ($this->mode === 'upd') {
85
-			// remove non-upgradeable parts
86
-			$s = strpos($idata,'non-upgrade-able[[');
87
-			$e = strpos($idata,']]non-upgrade-able') + 17;
88
-			if($s && $e) {
89
-			    $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata);
64
+        global $custom_placeholders;
65
+
66
+        // check to make sure file exists
67
+        if (!file_exists($filename)) {
68
+            $this->mysqlErrors[] = array("error" => "File '$filename' not found");
69
+            $this->installFailed = true ;
70
+            return false;
71
+        }
72
+
73
+        $fh = fopen($filename, 'r');
74
+        $idata = '';
75
+
76
+        while (!feof($fh)) {
77
+            $idata .= fread($fh, 1024);
78
+        }
79
+
80
+        fclose($fh);
81
+        $idata = str_replace("\r", '', $idata);
82
+
83
+        // check if in upgrade mode
84
+        if ($this->mode === 'upd') {
85
+            // remove non-upgradeable parts
86
+            $s = strpos($idata,'non-upgrade-able[[');
87
+            $e = strpos($idata,']]non-upgrade-able') + 17;
88
+            if($s && $e) {
89
+                $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata);
90 90
             }
91
-		}
91
+        }
92 92
 
93
-		// replace {} tags
94
-		$idata = str_replace('{PREFIX}', $this->prefix, $idata);
93
+        // replace {} tags
94
+        $idata = str_replace('{PREFIX}', $this->prefix, $idata);
95 95
         $idata = str_replace('{TABLEENCODING}', $this->getTableEncoding(), $idata);
96
-		$idata = str_replace('{ADMIN}', $this->adminname, $idata);
97
-		$idata = str_replace('{ADMINEMAIL}', $this->adminemail, $idata);
98
-		$idata = str_replace('{ADMINPASS}', $this->adminpass, $idata);
99
-		$idata = str_replace('{IMAGEPATH}', $this->imgPath, $idata);
100
-		$idata = str_replace('{IMAGEURL}', $this->imgUrl, $idata);
101
-		$idata = str_replace('{FILEMANAGERPATH}', $this->fileManagerPath, $idata);
102
-		$idata = str_replace('{MANAGERLANGUAGE}', $this->managerlanguage, $idata);
103
-		$idata = str_replace('{AUTOTEMPLATELOGIC}', $this->autoTemplateLogic, $idata);
104
-		/*$idata = str_replace('{VERSION}', $modx_version, $idata);*/
105
-
106
-		// Replace custom placeholders
107
-		foreach($custom_placeholders as $key=>$val) {
108
-			if (strpos($idata, '{'.$key.'}') !== false) {
109
-				$idata = str_replace('{'.$key.'}', $val, $idata);
110
-			}
111
-		}
112
-
113
-		$sql_array = explode("\n\n", $idata);
114
-
115
-		$num = 0;
116
-		foreach($sql_array as $sql_entry) {
117
-			$sql_do = trim($sql_entry, "\r\n; ");
118
-
119
-			if (preg_match('/^\#/', $sql_do)) continue;
120
-
121
-			// strip out comments and \n for mysql 3.x
122
-			if ($this->dbVersion <4.0) {
123
-				$sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do);
124
-				$sql_do = str_replace('\r', "", $sql_do);
125
-				$sql_do = str_replace('\n', "", $sql_do);
126
-			}
127
-
128
-
129
-			$num = $num + 1;
130
-			if ($sql_do) mysqli_query($this->conn, $sql_do);
131
-			if(mysqli_error($this->conn)) {
132
-				// Ignore duplicate and drop errors - Raymond
133
-				if ($this->ignoreDuplicateErrors){
134
-					if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue;
135
-				}
136
-				// End Ignore duplicate
137
-				$this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do);
138
-				$this->installFailed = true;
139
-			}
140
-		}
141
-	}
96
+        $idata = str_replace('{ADMIN}', $this->adminname, $idata);
97
+        $idata = str_replace('{ADMINEMAIL}', $this->adminemail, $idata);
98
+        $idata = str_replace('{ADMINPASS}', $this->adminpass, $idata);
99
+        $idata = str_replace('{IMAGEPATH}', $this->imgPath, $idata);
100
+        $idata = str_replace('{IMAGEURL}', $this->imgUrl, $idata);
101
+        $idata = str_replace('{FILEMANAGERPATH}', $this->fileManagerPath, $idata);
102
+        $idata = str_replace('{MANAGERLANGUAGE}', $this->managerlanguage, $idata);
103
+        $idata = str_replace('{AUTOTEMPLATELOGIC}', $this->autoTemplateLogic, $idata);
104
+        /*$idata = str_replace('{VERSION}', $modx_version, $idata);*/
105
+
106
+        // Replace custom placeholders
107
+        foreach($custom_placeholders as $key=>$val) {
108
+            if (strpos($idata, '{'.$key.'}') !== false) {
109
+                $idata = str_replace('{'.$key.'}', $val, $idata);
110
+            }
111
+        }
112
+
113
+        $sql_array = explode("\n\n", $idata);
114
+
115
+        $num = 0;
116
+        foreach($sql_array as $sql_entry) {
117
+            $sql_do = trim($sql_entry, "\r\n; ");
118
+
119
+            if (preg_match('/^\#/', $sql_do)) continue;
120
+
121
+            // strip out comments and \n for mysql 3.x
122
+            if ($this->dbVersion <4.0) {
123
+                $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do);
124
+                $sql_do = str_replace('\r', "", $sql_do);
125
+                $sql_do = str_replace('\n', "", $sql_do);
126
+            }
127
+
128
+
129
+            $num = $num + 1;
130
+            if ($sql_do) mysqli_query($this->conn, $sql_do);
131
+            if(mysqli_error($this->conn)) {
132
+                // Ignore duplicate and drop errors - Raymond
133
+                if ($this->ignoreDuplicateErrors){
134
+                    if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue;
135
+                }
136
+                // End Ignore duplicate
137
+                $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do);
138
+                $this->installFailed = true;
139
+            }
140
+        }
141
+    }
142 142
 
143 143
     public function getTableEncoding()
144 144
     {
@@ -150,6 +150,6 @@  discard block
 block discarded – undo
150 150
     }
151 151
 
152 152
     public function close() {
153
-		mysqli_close($this->conn);
154
-	}
153
+        mysqli_close($this->conn);
154
+    }
155 155
 }
Please login to merge, or discard this patch.
core/functions/actions/import.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,9 +114,9 @@
 block discarded – undo
114 114
                 $field['menuindex'] = 1;
115 115
                 $find = false;
116 116
                 foreach (array(
117
-                             'index.html',
118
-                             'index.htm'
119
-                         ) as $filename) {
117
+                                'index.html',
118
+                                'index.htm'
119
+                            ) as $filename) {
120 120
                     $filepath = $filedir . $alias . '/' . $filename;
121 121
                     if ($find === false && file_exists($filepath)) {
122 122
                         $file = getFileContent($filepath);
Please login to merge, or discard this patch.
core/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -60,22 +60,22 @@
 block discarded – undo
60 60
         }
61 61
 
62 62
         $formatter
63
-             ->expects($this->once())
64
-             ->method('format')
65
-             ->with($record)
66
-             ->will($this->returnValue($formatted));
63
+                ->expects($this->once())
64
+                ->method('format')
65
+                ->with($record)
66
+                ->will($this->returnValue($formatted));
67 67
         $this->client
68
-             ->expects($isV3 ? $this->never() : $this->once())
69
-             ->method('formatAttributes')
70
-             ->with($this->isType('array'))
71
-             ->will($this->returnValue($formatted));
68
+                ->expects($isV3 ? $this->never() : $this->once())
69
+                ->method('formatAttributes')
70
+                ->with($this->isType('array'))
71
+                ->will($this->returnValue($formatted));
72 72
         $this->client
73
-             ->expects($this->once())
74
-             ->method('__call')
75
-             ->with('putItem', array(array(
76
-                 'TableName' => 'foo',
77
-                 'Item' => $expFormatted,
78
-             )));
73
+                ->expects($this->once())
74
+                ->method('__call')
75
+                ->with('putItem', array(array(
76
+                    'TableName' => 'foo',
77
+                    'Item' => $expFormatted,
78
+                )));
79 79
 
80 80
         $handler->handle($record);
81 81
     }
Please login to merge, or discard this patch.
core/vendor/monolog/monolog/tests/Monolog/Handler/InsightOpsHandlerTest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
  * file that was distributed with this source code.
10 10
  */
11 11
 
12
- namespace Monolog\Handler;
12
+    namespace Monolog\Handler;
13 13
  
14
- use Monolog\TestCase;
15
- use Monolog\Logger;
14
+    use Monolog\TestCase;
15
+    use Monolog\Logger;
16 16
 
17 17
 /**
18 18
  * @author Robert Kaufmann III <[email protected]>
Please login to merge, or discard this patch.
core/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
  * file that was distributed with this source code.
10 10
  */
11 11
 
12
- namespace Monolog\Handler;
12
+    namespace Monolog\Handler;
13 13
  
14
- use Monolog\Logger;
14
+    use Monolog\Logger;
15 15
 
16 16
 /**
17 17
  * Inspired on LogEntriesHandler.
Please login to merge, or discard this patch.