Completed
Push — master ( 84f8b9...29b389 )
by Angus
08:20
created
application/core/MY_Log.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
 	public function __construct() {
49 49
 		$file_path = APPPATH.'config/monolog.php';
50 50
 		$found = FALSE;
51
-		if (file_exists($file_path)) {
51
+		if(file_exists($file_path)) {
52 52
 			$found = TRUE;
53 53
 			require($file_path);
54 54
 		}
55 55
 
56 56
 		// Is the config file in the environment folder?
57
-		if (file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/monolog.php')) {
57
+		if(file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/monolog.php')) {
58 58
 			require($file_path);
59
-		} elseif (!$found) {
59
+		} elseif(!$found) {
60 60
 			exit('monolog.php config does not exist');
61 61
 		}
62 62
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		// detect and register all PHP errors in this log hence forth
68 68
 		ErrorHandler::register($this->log);
69 69
 
70
-		if ($this->config['introspection_processor'])
70
+		if($this->config['introspection_processor'])
71 71
 		{
72 72
 			// add controller and line number info to each log message
73 73
 			// 2 = depth in the stacktrace to ignore. This gives us the file
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 		}
77 77
 
78 78
 		// decide which handler(s) to use
79
-		foreach ($this->config['handlers'] as $value)
79
+		foreach($this->config['handlers'] as $value)
80 80
 		{
81
-			switch ($value)
81
+			switch($value)
82 82
 			{
83 83
 				case 'file':
84 84
 					$handler = new RotatingFileHandler($this->config['file_logfile']);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 					break;
124 124
 
125 125
 				default:
126
-					exit('log handler not supported: ' . $value . "\n");
126
+					exit('log handler not supported: '.$value."\n");
127 127
 			}
128 128
 
129 129
 			$this->log->pushHandler($handler);
@@ -145,19 +145,19 @@  discard block
 block discarded – undo
145 145
 		$level = strtoupper($level);
146 146
 
147 147
 		// verify error level
148
-		if (!isset($this->_levels[$level]))
148
+		if(!isset($this->_levels[$level]))
149 149
 		{
150
-			$this->log->addError('unknown error level: ' . $level);
150
+			$this->log->addError('unknown error level: '.$level);
151 151
 			$level = 'ALL';
152 152
 		}
153 153
 
154 154
 		// filter out anything in $this->config['exclusion_list']
155
-		if (!empty($this->config['exclusion_list']))
155
+		if(!empty($this->config['exclusion_list']))
156 156
 		{
157
-			foreach ($this->config['exclusion_list'] as $findme)
157
+			foreach($this->config['exclusion_list'] as $findme)
158 158
 			{
159 159
 				$pos = strpos($msg, $findme);
160
-				if ($pos !== false)
160
+				if($pos !== false)
161 161
 				{
162 162
 					// just exit now - we don't want to log this error
163 163
 					return true;
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 			}
166 166
 		}
167 167
 
168
-		if ($this->_levels[$level] <= $this->config['threshold'])
168
+		if($this->_levels[$level] <= $this->config['threshold'])
169 169
 		{
170
-			switch ($level)
170
+			switch($level)
171 171
 			{
172 172
 				case 'ERROR':
173 173
 					$this->log->addError($msg);
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.php 1 patch
Spacing   +7 added lines, -7 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
 class Tracker_Admin_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$query = $query->get();
77 77
 
78 78
 		if($query->num_rows() > 0) {
79
-			foreach ($query->result() as $row) {
79
+			foreach($query->result() as $row) {
80 80
 				$this->handleUpdate($row);
81 81
 			}
82 82
 		}
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		$query = $query->get();
134 134
 
135 135
 		if($query->num_rows() > 0) {
136
-			foreach ($query->result() as $row) {
136
+			foreach($query->result() as $row) {
137 137
 				$this->handleUpdate($row);
138 138
 			}
139 139
 		}
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
 		                  ->get();
198 198
 
199 199
 		$sites = $query->result_array();
200
-		foreach ($sites as $site) {
200
+		foreach($sites as $site) {
201 201
 			$siteClass = $this->sites->{$site['site_class']};
202 202
 			if($titleDataList = $siteClass->doCustomUpdate()) {
203
-				foreach ($titleDataList as $titleURL => $titleData) {
203
+				foreach($titleDataList as $titleURL => $titleData) {
204 204
 					$titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that.
205 205
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
206 206
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
244 244
 		                  ->from('tracker_titles')
245 245
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
246
-		                  ->where('tracker_titles.followed','N')
246
+		                  ->where('tracker_titles.followed', 'N')
247 247
 		                  ->where('tracker_titles !=', '255')
248 248
 		                  ->where('tracker_sites.status', 'enabled')
249 249
 		                  ->where('tracker_sites.use_custom', 'Y')
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		// @formatter:on
302 302
 
303 303
 		if($query->num_rows() > 0) {
304
-			foreach ($query->result() as $row) {
304
+			foreach($query->result() as $row) {
305 305
 				print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
306 306
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
307 307
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
Please login to merge, or discard this patch.
application/config/config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -134,9 +134,9 @@
 block discarded – undo
134 134
 $config['composer_autoload'] = FALSE;
135 135
 
136 136
 //NOTE: This doesn't work in autoload.php as it is loaded after we need it.
137
-spl_autoload_register(function ($class) {
138
-	$fileMono = APPPATH . '../vendor/monolog/monolog/src/'.strtr($class, '\\', '/').'.php';
139
-	$filePsr  = APPPATH . '../vendor/psr/log/'.strtr($class, '\\', '/').'.php';
137
+spl_autoload_register(function($class) {
138
+	$fileMono = APPPATH.'../vendor/monolog/monolog/src/'.strtr($class, '\\', '/').'.php';
139
+	$filePsr  = APPPATH.'../vendor/psr/log/'.strtr($class, '\\', '/').'.php';
140 140
 	if(file_exists($fileMono)) {
141 141
 		require $fileMono;
142 142
 		return TRUE;
Please login to merge, or discard this patch.
application/config/monolog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 $config['file_multiline'] = TRUE; //add newlines to the output
32 32
 
33 33
 /* NEW RELIC OPTIONS */
34
-$config['new_relic_app_name'] = 'APP NAME - ' . ENVIRONMENT;
34
+$config['new_relic_app_name'] = 'APP NAME - '.ENVIRONMENT;
35 35
 
36 36
 /* HIPCHAT OPTIONS */
37 37
 $config['hipchat_app_token'] = ''; //HipChat API Token
Please login to merge, or discard this patch.