Completed
Push — master ( 53eae5...5a39da )
by Angus
03:43
created
application/models/Tracker/Tracker_Title_Model.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	public function getID(string $titleURL, int $siteID, bool $create = TRUE, bool $returnData = FALSE) {
19 19
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title, tracker_titles.title_url, tracker_titles.latest_chapter, tracker_titles.status, tracker_sites.site_class, (tracker_titles.last_checked > DATE_SUB(NOW(), INTERVAL 3 DAY)) AS active', FALSE)
20
-		                  ->from('tracker_titles')
21
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
22
-		                  ->where('tracker_titles.title_url', $titleURL)
23
-		                  ->where('tracker_titles.site_id', $siteID)
24
-		                  ->get();
20
+						  ->from('tracker_titles')
21
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
22
+						  ->where('tracker_titles.title_url', $titleURL)
23
+						  ->where('tracker_titles.site_id', $siteID)
24
+						  ->get();
25 25
 
26 26
 		if($query->num_rows() > 0) {
27 27
 			$id = (int) $query->row('id');
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 						//Make sure last_checked is always updated on successful run.
36 36
 						//CHECK: Is there a reason we aren't just doing this in updateTitleById?
37 37
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
38
-						         ->where('id', $id)
39
-						         ->update('tracker_titles');
38
+								 ->where('id', $id)
39
+								 ->update('tracker_titles');
40 40
 					}
41 41
 				} else {
42 42
 					log_message('error', "{$siteClass} | {$query->row('title')} ({$query->row('title_url')}) | Failed to update.");
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	private function addTitle(string $titleURL, int $siteID) : int {
78 78
 		$query = $this->db->select('site, site_class')
79
-		                  ->from('tracker_sites')
80
-		                  ->where('id', $siteID)
81
-		                  ->get();
79
+						  ->from('tracker_sites')
80
+						  ->where('id', $siteID)
81
+						  ->get();
82 82
 
83 83
 		$titleData = $this->sites->{$query->row()->site_class}->getTitleData($titleURL, TRUE);
84 84
 
@@ -104,21 +104,21 @@  discard block
 block discarded – undo
104 104
 	public function updateByID(int $titleID, ?string $latestChapter) : bool {
105 105
 		//FIXME: Really not too happy with how we're doing history stuff here, it just feels messy.
106 106
 		$query = $this->db->select('latest_chapter AS current_chapter')
107
-		                  ->from('tracker_titles')
108
-		                  ->where('id', $titleID)
109
-		                  ->get();
107
+						  ->from('tracker_titles')
108
+						  ->where('id', $titleID)
109
+						  ->get();
110 110
 		$row = $query->row();
111 111
 
112 112
 		//TODO (CHECK): If failed_checks changes won't that trigger affected_rows?
113 113
 		$success = $this->db->set(['latest_chapter' => $latestChapter, 'failed_checks' => 0]) //last_updated gets updated via a trigger if something changes
114
-		                    ->where('id', $titleID)
115
-		                    ->update('tracker_titles');
114
+							->where('id', $titleID)
115
+							->update('tracker_titles');
116 116
 
117 117
 		if($this->db->affected_rows() > 0) {
118 118
 			//Clear hidden latest chapter
119 119
 			$this->db->set(['ignore_chapter' => 'NULL', 'last_updated' => 'last_updated'], NULL, FALSE)
120
-			         ->where('title_id', $titleID)
121
-			         ->update('tracker_chapters');
120
+					 ->where('title_id', $titleID)
121
+					 ->update('tracker_chapters');
122 122
 		}
123 123
 
124 124
 		//Update History
@@ -135,20 +135,20 @@  discard block
 block discarded – undo
135 135
 		if(!array_diff(array_keys($data), TITLEDATA_COLUMNS)) {
136 136
 			$newData = array_merge($data, ['failed_checks' => 0]);
137 137
 			$oldData = $this->db->select('latest_chapter AS current_chapter')
138
-			                    ->from('tracker_titles')
139
-			                    ->where('id', $titleID)
140
-			                    ->get()->row_array();
138
+								->from('tracker_titles')
139
+								->where('id', $titleID)
140
+								->get()->row_array();
141 141
 
142 142
 
143 143
 			$success = $this->db->set($newData) //last_updated gets updated via a trigger if something changes
144
-			                    ->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
145
-			                    ->where('id', $titleID)
146
-			                    ->update('tracker_titles');
144
+								->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
145
+								->where('id', $titleID)
146
+								->update('tracker_titles');
147 147
 			if(in_array('latest_chapter', $newData, TRUE) && $newData['latest_chapter'] !== $oldData['current_chapter'] && $this->db->affected_rows() > 0) {
148 148
 				//Clear hidden latest chapter
149 149
 				$this->db->set(['ignore_chapter' => 'NULL', 'last_updated' => 'last_updated'], NULL, FALSE)
150
-				         ->where('title_id', $titleID)
151
-				         ->update('tracker_chapters');
150
+						 ->where('title_id', $titleID)
151
+						 ->update('tracker_chapters');
152 152
 			}
153 153
 
154 154
 			//Update History
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
 
165 165
 	public function updateFailedChecksByID(int $titleID) : bool {
166 166
 		$success = $this->db->set('failed_checks', 'failed_checks + 1', FALSE)
167
-		                    ->where('id', $titleID)
168
-		                    ->update('tracker_titles');
167
+							->where('id', $titleID)
168
+							->update('tracker_titles');
169 169
 
170 170
 		return $success;
171 171
 	}
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function getSiteDataFromURL(string $site_url) {
179 179
 		$query = $this->db->select('*')
180
-		                  ->from('tracker_sites')
181
-		                  ->where('site', $site_url)
182
-		                  ->get();
180
+						  ->from('tracker_sites')
181
+						  ->where('site', $site_url)
182
+						  ->get();
183 183
 
184 184
 		return $query->row();
185 185
 	}
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types=1); defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 const TITLEDATA_COLUMNS = ['title', 'latest_chapter', 'status', 'followed', 'mal_id'];
4 4
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			//FIXME: The <preferable> solution here is we'd just check against the last_updated time, but that can have a few issues.
157 157
 			$this->History->updateTitleHistory($titleID, $oldData['current_chapter'], $newData['latest_chapter'] ?? NULL, date('Y-m-d H:i:s'));
158 158
 		} else {
159
-			log_message('error', "ID {$titleID} is attempting to access an invalid column?");
159
+			log_message('error', "id {$titleID} is attempting to access an invalid column?");
160 160
 		}
161 161
 
162 162
 		return (bool) $success;
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -223,10 +223,10 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	public function updateCustom() {
225 225
 		$query = $this->db->select('*')
226
-		                  ->from('tracker_sites')
227
-		                  ->where('tracker_sites.status', 'enabled')
228
-		                  ->where('tracker_sites.use_custom', 'Y')
229
-		                  ->get();
226
+						  ->from('tracker_sites')
227
+						  ->where('tracker_sites.status', 'enabled')
228
+						  ->where('tracker_sites.use_custom', 'Y')
229
+						  ->get();
230 230
 
231 231
 		$sites = $query->result_array();
232 232
 		foreach ($sites as $site) {
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
 									//Make sure last_checked is always updated on successful run.
244 244
 									//CHECK: Is there a reason we aren't just doing this in updateByID?
245 245
 									$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
246
-									         ->where('id', $titleID)
247
-									         ->update('tracker_titles');
246
+											 ->where('id', $titleID)
247
+											 ->update('tracker_titles');
248 248
 
249 249
 									print " - ({$titleData['latest_chapter']})\n";
250 250
 								} else {
@@ -273,13 +273,13 @@  discard block
 block discarded – undo
273 273
 
274 274
 	public function refollowCustom() {
275 275
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
276
-		                  ->from('tracker_titles')
277
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
278
-		                  ->where('tracker_titles.followed','N')
279
-		                  ->where('tracker_titles !=', '255')
280
-		                  ->where('tracker_sites.status', 'enabled')
281
-		                  ->where('tracker_sites.use_custom', 'Y')
282
-		                  ->get();
276
+						  ->from('tracker_titles')
277
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
278
+						  ->where('tracker_titles.followed','N')
279
+						  ->where('tracker_titles !=', '255')
280
+						  ->where('tracker_sites.status', 'enabled')
281
+						  ->where('tracker_sites.use_custom', 'Y')
282
+						  ->get();
283 283
 
284 284
 		if($query->num_rows() > 0) {
285 285
 			foreach($query->result() as $row) {
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
 
291 291
 					if(!empty($titleData)) {
292 292
 						$this->db->set($titleData)
293
-						         ->where('id', $row->id)
294
-						         ->update('tracker_titles');
293
+								 ->where('id', $row->id)
294
+								 ->update('tracker_titles');
295 295
 
296 296
 						print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n";
297 297
 					} else {
@@ -311,14 +311,14 @@  discard block
 block discarded – undo
311 311
 		$date = $temp_now->format('Y-m-d');
312 312
 
313 313
 		$query = $this->db->select('1')
314
-		                  ->from('site_stats')
315
-		                  ->where('date', $date)
316
-		                  ->get();
314
+						  ->from('site_stats')
315
+						  ->where('date', $date)
316
+						  ->get();
317 317
 
318 318
 		if($query->num_rows() > 0) {
319 319
 			$this->db->set('total_requests', 'total_requests+1', FALSE)
320
-			         ->where('date', $date)
321
-			         ->update('site_stats');
320
+					 ->where('date', $date)
321
+					 ->update('site_stats');
322 322
 		} else {
323 323
 			$this->db->insert('site_stats', [
324 324
 				'date'           => $date,
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -85,7 +85,9 @@  discard block
 block discarded – undo
85 85
 				}
86 86
 
87 87
 				$siteRateLimits[$row->site_class]++;
88
-				if($siteRateLimits[$row->site_class] > $hardRateLimit) continue;
88
+				if($siteRateLimits[$row->site_class] > $hardRateLimit) {
89
+					continue;
90
+				}
89 91
 
90 92
 				if($siteRateLimits[$row->site_class] > 25) {
91 93
 					// We're doing lots of requests to a single site, so add delays.
@@ -174,8 +176,7 @@  discard block
 block discarded – undo
174 176
 
175 177
 						print " - Something went wrong?\n";
176 178
 					}
177
-				}
178
-				else if(array_key_exists('status', $titleData)) {
179
+				} else if(array_key_exists('status', $titleData)) {
179 180
 					// Series has probably been deleted.
180 181
 
181 182
 					if($this->Tracker->title->updateTitleDataByID((int) $row->title_id, $titleData)) {
@@ -185,8 +186,7 @@  discard block
 block discarded – undo
185 186
 
186 187
 						print " - Something went wrong?\n";
187 188
 					}
188
-				}
189
-				else if($site->canHaveNoChapters) {
189
+				} else if($site->canHaveNoChapters) {
190 190
 					// Previous statements failed, however site can have no chapters.
191 191
 					if($this->Tracker->title->updateTitleDataByID((int) $row->title_id, ['latest_chapter' => NULL])) {
192 192
 						print " - (No chapters found?)\n";
@@ -195,12 +195,10 @@  discard block
 block discarded – undo
195 195
 
196 196
 						print " - Something went wrong?\n";
197 197
 					}
198
-				}
199
-				else {
198
+				} else {
200 199
 					log_message('error', 'handleUpdate failed due to invalid titleData info?');
201 200
 				}
202
-			}
203
-			else {
201
+			} else {
204 202
 				// If TitleData does not exist, either something has broken, or we've set up the site wrong.
205 203
 
206 204
 				//TODO: We should have some way to handle this in the site models.
Please login to merge, or discard this patch.
application/controllers/AdminCLI.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * Series are only checked if they haven't been updated in 16+ hours (unless they are marked as complete, to which they are only checked once a week).
31 31
 	 */
32 32
 	public function updateSeries() {
33
-		print 'Environment: ' . ENVIRONMENT . "\n";
33
+		print 'Environment: '.ENVIRONMENT."\n";
34 34
 		$this->Tracker->admin->updateLatestChapters();
35 35
 	}
36 36
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		print "Testing site\n";
55 55
 		switch($type) {
56 56
 			case 'update':
57
-				if(!is_null($extra )) {
57
+				if(!is_null($extra)) {
58 58
 					print_r($this->Tracker->sites->{$site}->getTitleData($extra));
59 59
 				}
60 60
 				break;
Please login to merge, or discard this patch.
application/config/constants.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 | always be used to set the mode correctly.
27 27
 |
28 28
 */
29
-defined('FILE_READ_MODE')  OR define('FILE_READ_MODE', 0644);
29
+defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
30 30
 defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
31
-defined('DIR_READ_MODE')   OR define('DIR_READ_MODE', 0755);
32
-defined('DIR_WRITE_MODE')  OR define('DIR_WRITE_MODE', 0755);
31
+defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
32
+defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
33 33
 
34 34
 /*
35 35
 |--------------------------------------------------------------------------
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 | These modes are used when working with fopen()/popen()
40 40
 |
41 41
 */
42
-defined('FOPEN_READ')                           OR define('FOPEN_READ', 'rb');
43
-defined('FOPEN_READ_WRITE')                     OR define('FOPEN_READ_WRITE', 'r+b');
44
-defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
42
+defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
43
+defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
44
+defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45 45
 defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
-defined('FOPEN_WRITE_CREATE')                   OR define('FOPEN_WRITE_CREATE', 'ab');
47
-defined('FOPEN_READ_WRITE_CREATE')              OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
-defined('FOPEN_WRITE_CREATE_STRICT')            OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
-defined('FOPEN_READ_WRITE_CREATE_STRICT')       OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
46
+defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
47
+defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
+defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
+defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
50 50
 
51 51
 /*
52 52
 |--------------------------------------------------------------------------
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
 |       http://tldp.org/LDP/abs/html/exitcodes.html
74 74
 |
75 75
 */
76
-defined('EXIT_SUCCESS')        OR define('EXIT_SUCCESS', 0); // no errors
77
-defined('EXIT_ERROR')          OR define('EXIT_ERROR', 1); // generic error
78
-defined('EXIT_CONFIG')         OR define('EXIT_CONFIG', 3); // configuration error
79
-defined('EXIT_UNKNOWN_FILE')   OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
-defined('EXIT_UNKNOWN_CLASS')  OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
76
+defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
77
+defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
78
+defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
79
+defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
+defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81 81
 defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
-defined('EXIT_USER_INPUT')     OR define('EXIT_USER_INPUT', 7); // invalid user input
83
-defined('EXIT_DATABASE')       OR define('EXIT_DATABASE', 8); // database error
84
-defined('EXIT__AUTO_MIN')      OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
-defined('EXIT__AUTO_MAX')      OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
82
+defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
83
+defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
84
+defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
+defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
86 86
 
87 87
 /***** TIMEAGO CONSTANTS *****/
88 88
 defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
-defined('TIMEAGO_WEEK')  OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
-defined('TIMEAGO_3DAY')  OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
89
+defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
+defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
91 91
 
92 92
 defined('USERSCRIPT_VERSION') OR define('USERSCRIPT_VERSION', '0.0.0'); //This is automatically updated on deployment.
Please login to merge, or discard this patch.
Upper-Lower-Casing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-defined('BASEPATH') OR exit('No direct script access allowed');
2
+defined('BASEPATH') or exit('No direct script access allowed');
3 3
 
4 4
 /*
5 5
 |--------------------------------------------------------------------------
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 | of this setting
12 12
 |
13 13
 */
14
-defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
14
+defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', TRUE);
15 15
 
16 16
 /*
17 17
 |--------------------------------------------------------------------------
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 | always be used to set the mode correctly.
27 27
 |
28 28
 */
29
-defined('FILE_READ_MODE')  OR define('FILE_READ_MODE', 0644);
30
-defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
31
-defined('DIR_READ_MODE')   OR define('DIR_READ_MODE', 0755);
32
-defined('DIR_WRITE_MODE')  OR define('DIR_WRITE_MODE', 0755);
29
+defined('FILE_READ_MODE')  or define('FILE_READ_MODE', 0644);
30
+defined('FILE_WRITE_MODE') or define('FILE_WRITE_MODE', 0666);
31
+defined('DIR_READ_MODE')   or define('DIR_READ_MODE', 0755);
32
+defined('DIR_WRITE_MODE')  or define('DIR_WRITE_MODE', 0755);
33 33
 
34 34
 /*
35 35
 |--------------------------------------------------------------------------
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 | These modes are used when working with fopen()/popen()
40 40
 |
41 41
 */
42
-defined('FOPEN_READ')                           OR define('FOPEN_READ', 'rb');
43
-defined('FOPEN_READ_WRITE')                     OR define('FOPEN_READ_WRITE', 'r+b');
44
-defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45
-defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
-defined('FOPEN_WRITE_CREATE')                   OR define('FOPEN_WRITE_CREATE', 'ab');
47
-defined('FOPEN_READ_WRITE_CREATE')              OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
-defined('FOPEN_WRITE_CREATE_STRICT')            OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
-defined('FOPEN_READ_WRITE_CREATE_STRICT')       OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
42
+defined('FOPEN_READ')                           or define('FOPEN_READ', 'rb');
43
+defined('FOPEN_READ_WRITE')                     or define('FOPEN_READ_WRITE', 'r+b');
44
+defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       or define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45
+defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') or define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
+defined('FOPEN_WRITE_CREATE')                   or define('FOPEN_WRITE_CREATE', 'ab');
47
+defined('FOPEN_READ_WRITE_CREATE')              or define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
+defined('FOPEN_WRITE_CREATE_STRICT')            or define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
+defined('FOPEN_READ_WRITE_CREATE_STRICT')       or define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
50 50
 
51 51
 /*
52 52
 |--------------------------------------------------------------------------
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
 |       http://tldp.org/LDP/abs/html/exitcodes.html
74 74
 |
75 75
 */
76
-defined('EXIT_SUCCESS')        OR define('EXIT_SUCCESS', 0); // no errors
77
-defined('EXIT_ERROR')          OR define('EXIT_ERROR', 1); // generic error
78
-defined('EXIT_CONFIG')         OR define('EXIT_CONFIG', 3); // configuration error
79
-defined('EXIT_UNKNOWN_FILE')   OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
-defined('EXIT_UNKNOWN_CLASS')  OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81
-defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
-defined('EXIT_USER_INPUT')     OR define('EXIT_USER_INPUT', 7); // invalid user input
83
-defined('EXIT_DATABASE')       OR define('EXIT_DATABASE', 8); // database error
84
-defined('EXIT__AUTO_MIN')      OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
-defined('EXIT__AUTO_MAX')      OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
76
+defined('EXIT_SUCCESS')        or define('EXIT_SUCCESS', 0); // no errors
77
+defined('EXIT_ERROR')          or define('EXIT_ERROR', 1); // generic error
78
+defined('EXIT_CONFIG')         or define('EXIT_CONFIG', 3); // configuration error
79
+defined('EXIT_UNKNOWN_FILE')   or define('EXIT_UNKNOWN_FILE', 4); // file not found
80
+defined('EXIT_UNKNOWN_CLASS')  or define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81
+defined('EXIT_UNKNOWN_METHOD') or define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
+defined('EXIT_USER_INPUT')     or define('EXIT_USER_INPUT', 7); // invalid user input
83
+defined('EXIT_DATABASE')       or define('EXIT_DATABASE', 8); // database error
84
+defined('EXIT__AUTO_MIN')      or define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
+defined('EXIT__AUTO_MAX')      or define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
86 86
 
87 87
 /***** TIMEAGO CONSTANTS *****/
88
-defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
-defined('TIMEAGO_WEEK')  OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
-defined('TIMEAGO_3DAY')  OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
88
+defined('TIMEAGO_MONTH') or define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
+defined('TIMEAGO_WEEK')  or define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
+defined('TIMEAGO_3DAY')  or define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
91 91
 
92
-defined('USERSCRIPT_VERSION') OR define('USERSCRIPT_VERSION', '0.0.0'); //This is automatically updated on deployment.
92
+defined('USERSCRIPT_VERSION') or define('USERSCRIPT_VERSION', '0.0.0'); //This is automatically updated on deployment.
Please login to merge, or discard this patch.