GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#155)
by
unknown
08:46
created
myth/Forensics/views/profiler_template.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 				Load Time
197 197
 			</a>
198 198
 			<a href="#" id="ci-profiler-menu-memory" onclick="ci_profiler_bar.show('ci-profiler-memory', 'ci-profiler-menu-memory'); return false;">
199
-				<span><?php echo (! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).' MB' ?></span>
199
+				<span><?php echo ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage() / 1024 / 1024, 2).' MB' ?></span>
200 200
 				Memory Used
201 201
 			</a>
202 202
 		<?php endif; ?>
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
 					<?php $append = ($section == 'get' || $section == 'post') ? '_data' : '' ?>
386 386
 					<a href="#" onclick="ci_profiler_bar.toggle_data_table('<?php echo $section ?>'); return false;">
387
-						<h2><?php echo lang('profiler_' . $section . $append) ?></h2>
387
+						<h2><?php echo lang('profiler_'.$section.$append) ?></h2>
388 388
 					</a>
389 389
 
390 390
 
Please login to merge, or discard this patch.
Braces   +35 added lines, -14 removed lines patch added patch discarded remove patch
@@ -257,9 +257,12 @@  discard block
 block discarded – undo
257 257
 				<?php endforeach; ?>
258 258
 				</table>
259 259
 
260
-			<?php else : ?>
260
+			<?php else {
261
+	: ?>
261 262
 
262
-				<?php echo $sections['console']; ?>
263
+				<?php echo $sections['console'];
264
+}
265
+?>
263 266
 
264 267
 			<?php endif; ?>
265 268
 		</div>
@@ -288,9 +291,12 @@  discard block
 block discarded – undo
288 291
 				<?php endforeach; ?>
289 292
 				</table>
290 293
 
291
-			<?php else : ?>
294
+			<?php else {
295
+	: ?>
292 296
 
293
-				<?php echo $sections['console']; ?>
297
+				<?php echo $sections['console'];
298
+}
299
+?>
294 300
 
295 301
 			<?php endif; ?>
296 302
 		</div>
@@ -309,9 +315,12 @@  discard block
 block discarded – undo
309 315
 				<?php endforeach; ?>
310 316
 				</table>
311 317
 
312
-			<?php else : ?>
318
+			<?php else {
319
+	: ?>
313 320
 
314
-				<?php echo $sections['benchmarks']; ?>
321
+				<?php echo $sections['benchmarks'];
322
+}
323
+?>
315 324
 
316 325
 			<?php endif; ?>
317 326
 		</div>
@@ -332,9 +341,12 @@  discard block
 block discarded – undo
332 341
 				<?php endforeach; ?>
333 342
 				</table>
334 343
 
335
-			<?php else : ?>
344
+			<?php else {
345
+	: ?>
336 346
 
337
-				<?php echo $sections['queries']; ?>
347
+				<?php echo $sections['queries'];
348
+}
349
+?>
338 350
 
339 351
 			<?php endif; ?>
340 352
 		</div>
@@ -394,8 +406,11 @@  discard block
 block discarded – undo
394 406
 						<?php foreach ($sections[$section] as $key => $val) : ?>
395 407
 							<tr><td class="hilight"><?php echo $key ?></td><td><?php echo htmlspecialchars($val) ?></td></tr>
396 408
 						<?php endforeach; ?>
397
-						<?php else : ?>
398
-							<tr><td><?php echo $sections[$section]; ?></td></tr>
409
+						<?php else {
410
+	: ?>
411
+							<tr><td><?php echo $sections[$section];
412
+}
413
+?></td></tr>
399 414
 						<?php endif; ?>
400 415
 						</table>
401 416
 				<?php endif; ?>
@@ -422,19 +437,25 @@  discard block
 block discarded – undo
422 437
 				<?php endforeach; ?>
423 438
 				</table>
424 439
 
425
-			<?php else : ?>
440
+			<?php else {
441
+	: ?>
426 442
 
427
-				<?php echo $sections['files']; ?>
443
+				<?php echo $sections['files'];
444
+}
445
+?>
428 446
 
429 447
 			<?php endif; ?>
430 448
 		</div>
431 449
 	<?php endif; ?>
432 450
 
433 451
 
434
-<?php else: ?>
452
+<?php else {
453
+	: ?>
435 454
 
436 455
 	<p class="ci-profiler-box"><?php echo lang('profiler_no_profiles') ?></p>
437 456
 
438
-<?php endif; ?>
457
+<?php endif;
458
+}
459
+?>
439 460
 
440 461
 </div>	<!-- /codeigniter_profiler -->
Please login to merge, or discard this patch.
myth/Forge/FileKit.php 2 patches
Indentation   +197 added lines, -197 removed lines patch added patch discarded remove patch
@@ -32,206 +32,206 @@
 block discarded – undo
32 32
 
33 33
 class FileKit {
34 34
 
35
-    /**
36
-     * Appends data to the end of a file.
37
-     *
38
-     * @param $file
39
-     * @param $content
40
-     * @return bool|int
41
-     */
42
-    public function append($file, $content)
43
-    {
44
-        if (empty($content))
45
-        {
46
-            return true;
47
-        }
48
-
49
-        // Ensure that $content has a newline at the end
50
-        $content = rtrim($content) ."\n";
51
-
52
-        $fh = fopen($file, 'a');
53
-        $result = fwrite($fh, $content);
54
-        fclose($fh);
55
-
56
-        return $result;
57
-    }
58
-
59
-    //--------------------------------------------------------------------
60
-
61
-    /**
62
-     * Prepends string content to a file. For very large files
63
-     * this method could have memory issues, but the primary usage
64
-     * of source files shouldn't ever get large enough to cause issues.
65
-     *
66
-     * @param $file
67
-     * @param $content
68
-     * @return bool|int
69
-     */
70
-    public function prepend($file, $content)
71
-    {
72
-        if (empty($content))
73
-        {
74
-            return true;
75
-        }
76
-
77
-        // Ensure that $content has a newline at the end
78
-        $content = rtrim($content) ."\n";
79
-
80
-        $file_contents = file_get_contents($file);
81
-
82
-        if ($file_contents === false)
83
-        {
84
-            throw new \RuntimeException( sprintf(lang('errors.reading_file'), $file));
85
-        }
86
-
87
-        $result = file_put_contents($file, $content . $file_contents);
88
-
89
-        return (bool)$result;
90
-    }
91
-
92
-    //--------------------------------------------------------------------
93
-
94
-    /**
95
-     * Inserts $content before the line that matches $before. NOT case-
96
-     * sensitive.
97
-     *
98
-     * @param $file
99
-     * @param $before
100
-     * @param $content
101
-     * @return int
102
-     */
103
-    public function before($file, $before, $content)
104
-    {
105
-        if (empty($content))
106
-        {
107
-            return true;
108
-        }
109
-
110
-        // Ensure that $content has a newline at the end
111
-        $content = rtrim($content) ."\n";
112
-
113
-        $lines = file($file);
114
-
115
-        if ($lines === false)
116
-        {
117
-            throw new \RuntimeException( sprintf( lang('errors.file_not_found'), $file ));
118
-        }
119
-
120
-        // Where to insert the row.
121
-        $location = null;
122
-
123
-        foreach ($lines as $index => $line)
124
-        {
125
-            if (strtolower($line) == strtolower($before) )
126
-            {
127
-                $location = $index;
128
-                break;
129
-            }
130
-        }
131
-
132
-        array_splice($lines, $location, 0, $content);
133
-
134
-        $result = file_put_contents($file, $lines);
135
-
136
-        return (bool)$result;
137
-    }
138
-
139
-    //--------------------------------------------------------------------
140
-
141
-    public function after($file, $after, $content)
142
-    {
143
-        if (empty($content))
144
-        {
145
-            return true;
146
-        }
147
-
148
-        // Ensure that $content has a newline at the end
149
-        $content = rtrim($content) ."\n";
150
-
151
-        $lines = file($file);
152
-
153
-        if ($lines === false)
154
-        {
155
-            throw new \RuntimeException( sprintf( lang('errors.file_not_found'), $file ) );
156
-        }
157
-
158
-        // Where to insert the row.
159
-        $location = null;
160
-
161
-        foreach ($lines as $index => $line)
162
-        {
163
-            if (strtolower($line) == strtolower($after) )
164
-            {
165
-                $location = $index;
166
-                break;
167
-            }
168
-        }
169
-
170
-        array_splice($lines, $location +1, 0, $content);
171
-
172
-        $result = file_put_contents($file, $lines);
173
-
174
-        return (bool)$result;
175
-    }
176
-
177
-    //--------------------------------------------------------------------
178
-
179
-    /**
180
-     * Replaces all instances of $search in the file with $replace.
181
-     *
182
-     * @param $file
183
-     * @param $search
184
-     * @param $replace
185
-     * @return int
186
-     */
187
-    public function replaceIn($file, $search, $replace)
188
-    {
189
-        $file_contents = file_get_contents($file);
190
-
191
-        if ($file_contents === false)
192
-        {
193
-            throw new \RuntimeException( sprintf( lang('errors.reading_file'), $file ) );
194
-        }
195
-
196
-        $file_contents = str_replace($search, $replace, $file_contents);
197
-
198
-        $result = file_put_contents($file, $file_contents);
199
-
200
-        return (bool)$result;
201
-    }
202
-
203
-    //--------------------------------------------------------------------
204
-
205
-    /**
206
-     * Uses preg_replace to replace content within the file.
207
-     *
208
-     * @param $file
209
-     * @param $pattern
210
-     * @param $replace
211
-     * @return int
212
-     */
213
-    public function replaceWithRegex($file, $pattern, $replace)
214
-    {
215
-        $file_contents = file_get_contents($file);
216
-
217
-        if ($file_contents === false)
218
-        {
219
-            throw new \RuntimeException( sprintf( lang('errors.reading_file'), $file ) );
220
-        }
35
+	/**
36
+	 * Appends data to the end of a file.
37
+	 *
38
+	 * @param $file
39
+	 * @param $content
40
+	 * @return bool|int
41
+	 */
42
+	public function append($file, $content)
43
+	{
44
+		if (empty($content))
45
+		{
46
+			return true;
47
+		}
48
+
49
+		// Ensure that $content has a newline at the end
50
+		$content = rtrim($content) ."\n";
51
+
52
+		$fh = fopen($file, 'a');
53
+		$result = fwrite($fh, $content);
54
+		fclose($fh);
55
+
56
+		return $result;
57
+	}
58
+
59
+	//--------------------------------------------------------------------
60
+
61
+	/**
62
+	 * Prepends string content to a file. For very large files
63
+	 * this method could have memory issues, but the primary usage
64
+	 * of source files shouldn't ever get large enough to cause issues.
65
+	 *
66
+	 * @param $file
67
+	 * @param $content
68
+	 * @return bool|int
69
+	 */
70
+	public function prepend($file, $content)
71
+	{
72
+		if (empty($content))
73
+		{
74
+			return true;
75
+		}
76
+
77
+		// Ensure that $content has a newline at the end
78
+		$content = rtrim($content) ."\n";
79
+
80
+		$file_contents = file_get_contents($file);
81
+
82
+		if ($file_contents === false)
83
+		{
84
+			throw new \RuntimeException( sprintf(lang('errors.reading_file'), $file));
85
+		}
86
+
87
+		$result = file_put_contents($file, $content . $file_contents);
88
+
89
+		return (bool)$result;
90
+	}
91
+
92
+	//--------------------------------------------------------------------
93
+
94
+	/**
95
+	 * Inserts $content before the line that matches $before. NOT case-
96
+	 * sensitive.
97
+	 *
98
+	 * @param $file
99
+	 * @param $before
100
+	 * @param $content
101
+	 * @return int
102
+	 */
103
+	public function before($file, $before, $content)
104
+	{
105
+		if (empty($content))
106
+		{
107
+			return true;
108
+		}
109
+
110
+		// Ensure that $content has a newline at the end
111
+		$content = rtrim($content) ."\n";
112
+
113
+		$lines = file($file);
114
+
115
+		if ($lines === false)
116
+		{
117
+			throw new \RuntimeException( sprintf( lang('errors.file_not_found'), $file ));
118
+		}
119
+
120
+		// Where to insert the row.
121
+		$location = null;
122
+
123
+		foreach ($lines as $index => $line)
124
+		{
125
+			if (strtolower($line) == strtolower($before) )
126
+			{
127
+				$location = $index;
128
+				break;
129
+			}
130
+		}
131
+
132
+		array_splice($lines, $location, 0, $content);
133
+
134
+		$result = file_put_contents($file, $lines);
135
+
136
+		return (bool)$result;
137
+	}
138
+
139
+	//--------------------------------------------------------------------
140
+
141
+	public function after($file, $after, $content)
142
+	{
143
+		if (empty($content))
144
+		{
145
+			return true;
146
+		}
147
+
148
+		// Ensure that $content has a newline at the end
149
+		$content = rtrim($content) ."\n";
150
+
151
+		$lines = file($file);
152
+
153
+		if ($lines === false)
154
+		{
155
+			throw new \RuntimeException( sprintf( lang('errors.file_not_found'), $file ) );
156
+		}
157
+
158
+		// Where to insert the row.
159
+		$location = null;
160
+
161
+		foreach ($lines as $index => $line)
162
+		{
163
+			if (strtolower($line) == strtolower($after) )
164
+			{
165
+				$location = $index;
166
+				break;
167
+			}
168
+		}
169
+
170
+		array_splice($lines, $location +1, 0, $content);
171
+
172
+		$result = file_put_contents($file, $lines);
173
+
174
+		return (bool)$result;
175
+	}
176
+
177
+	//--------------------------------------------------------------------
178
+
179
+	/**
180
+	 * Replaces all instances of $search in the file with $replace.
181
+	 *
182
+	 * @param $file
183
+	 * @param $search
184
+	 * @param $replace
185
+	 * @return int
186
+	 */
187
+	public function replaceIn($file, $search, $replace)
188
+	{
189
+		$file_contents = file_get_contents($file);
190
+
191
+		if ($file_contents === false)
192
+		{
193
+			throw new \RuntimeException( sprintf( lang('errors.reading_file'), $file ) );
194
+		}
195
+
196
+		$file_contents = str_replace($search, $replace, $file_contents);
197
+
198
+		$result = file_put_contents($file, $file_contents);
199
+
200
+		return (bool)$result;
201
+	}
202
+
203
+	//--------------------------------------------------------------------
204
+
205
+	/**
206
+	 * Uses preg_replace to replace content within the file.
207
+	 *
208
+	 * @param $file
209
+	 * @param $pattern
210
+	 * @param $replace
211
+	 * @return int
212
+	 */
213
+	public function replaceWithRegex($file, $pattern, $replace)
214
+	{
215
+		$file_contents = file_get_contents($file);
216
+
217
+		if ($file_contents === false)
218
+		{
219
+			throw new \RuntimeException( sprintf( lang('errors.reading_file'), $file ) );
220
+		}
221 221
 
222
-        $file_contents = preg_replace($pattern, $replace, $file_contents);
223
-
224
-        $result = false;
222
+		$file_contents = preg_replace($pattern, $replace, $file_contents);
223
+
224
+		$result = false;
225 225
 
226
-        // Don't let us erase a file!
227
-        if (! empty($file_contents))
228
-        {
229
-            $result = file_put_contents( $file, $file_contents );
230
-        }
226
+		// Don't let us erase a file!
227
+		if (! empty($file_contents))
228
+		{
229
+			$result = file_put_contents( $file, $file_contents );
230
+		}
231 231
 
232
-        return (bool)$result;
233
-    }
232
+		return (bool)$result;
233
+	}
234 234
 
235
-    //--------------------------------------------------------------------
235
+	//--------------------------------------------------------------------
236 236
 
237 237
 }
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         }
48 48
 
49 49
         // Ensure that $content has a newline at the end
50
-        $content = rtrim($content) ."\n";
50
+        $content = rtrim($content)."\n";
51 51
 
52 52
         $fh = fopen($file, 'a');
53 53
         $result = fwrite($fh, $content);
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
         }
76 76
 
77 77
         // Ensure that $content has a newline at the end
78
-        $content = rtrim($content) ."\n";
78
+        $content = rtrim($content)."\n";
79 79
 
80 80
         $file_contents = file_get_contents($file);
81 81
 
82 82
         if ($file_contents === false)
83 83
         {
84
-            throw new \RuntimeException( sprintf(lang('errors.reading_file'), $file));
84
+            throw new \RuntimeException(sprintf(lang('errors.reading_file'), $file));
85 85
         }
86 86
 
87
-        $result = file_put_contents($file, $content . $file_contents);
87
+        $result = file_put_contents($file, $content.$file_contents);
88 88
 
89
-        return (bool)$result;
89
+        return (bool) $result;
90 90
     }
91 91
 
92 92
     //--------------------------------------------------------------------
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
         }
109 109
 
110 110
         // Ensure that $content has a newline at the end
111
-        $content = rtrim($content) ."\n";
111
+        $content = rtrim($content)."\n";
112 112
 
113 113
         $lines = file($file);
114 114
 
115 115
         if ($lines === false)
116 116
         {
117
-            throw new \RuntimeException( sprintf( lang('errors.file_not_found'), $file ));
117
+            throw new \RuntimeException(sprintf(lang('errors.file_not_found'), $file));
118 118
         }
119 119
 
120 120
         // Where to insert the row.
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
         foreach ($lines as $index => $line)
124 124
         {
125
-            if (strtolower($line) == strtolower($before) )
125
+            if (strtolower($line) == strtolower($before))
126 126
             {
127 127
                 $location = $index;
128 128
                 break;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         $result = file_put_contents($file, $lines);
135 135
 
136
-        return (bool)$result;
136
+        return (bool) $result;
137 137
     }
138 138
 
139 139
     //--------------------------------------------------------------------
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
         }
147 147
 
148 148
         // Ensure that $content has a newline at the end
149
-        $content = rtrim($content) ."\n";
149
+        $content = rtrim($content)."\n";
150 150
 
151 151
         $lines = file($file);
152 152
 
153 153
         if ($lines === false)
154 154
         {
155
-            throw new \RuntimeException( sprintf( lang('errors.file_not_found'), $file ) );
155
+            throw new \RuntimeException(sprintf(lang('errors.file_not_found'), $file));
156 156
         }
157 157
 
158 158
         // Where to insert the row.
@@ -160,18 +160,18 @@  discard block
 block discarded – undo
160 160
 
161 161
         foreach ($lines as $index => $line)
162 162
         {
163
-            if (strtolower($line) == strtolower($after) )
163
+            if (strtolower($line) == strtolower($after))
164 164
             {
165 165
                 $location = $index;
166 166
                 break;
167 167
             }
168 168
         }
169 169
 
170
-        array_splice($lines, $location +1, 0, $content);
170
+        array_splice($lines, $location + 1, 0, $content);
171 171
 
172 172
         $result = file_put_contents($file, $lines);
173 173
 
174
-        return (bool)$result;
174
+        return (bool) $result;
175 175
     }
176 176
 
177 177
     //--------------------------------------------------------------------
@@ -190,14 +190,14 @@  discard block
 block discarded – undo
190 190
 
191 191
         if ($file_contents === false)
192 192
         {
193
-            throw new \RuntimeException( sprintf( lang('errors.reading_file'), $file ) );
193
+            throw new \RuntimeException(sprintf(lang('errors.reading_file'), $file));
194 194
         }
195 195
 
196 196
         $file_contents = str_replace($search, $replace, $file_contents);
197 197
 
198 198
         $result = file_put_contents($file, $file_contents);
199 199
 
200
-        return (bool)$result;
200
+        return (bool) $result;
201 201
     }
202 202
 
203 203
     //--------------------------------------------------------------------
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
         if ($file_contents === false)
218 218
         {
219
-            throw new \RuntimeException( sprintf( lang('errors.reading_file'), $file ) );
219
+            throw new \RuntimeException(sprintf(lang('errors.reading_file'), $file));
220 220
         }
221 221
 
222 222
         $file_contents = preg_replace($pattern, $replace, $file_contents);
@@ -224,12 +224,12 @@  discard block
 block discarded – undo
224 224
         $result = false;
225 225
 
226 226
         // Don't let us erase a file!
227
-        if (! empty($file_contents))
227
+        if ( ! empty($file_contents))
228 228
         {
229
-            $result = file_put_contents( $file, $file_contents );
229
+            $result = file_put_contents($file, $file_contents);
230 230
         }
231 231
 
232
-        return (bool)$result;
232
+        return (bool) $result;
233 233
     }
234 234
 
235 235
     //--------------------------------------------------------------------
Please login to merge, or discard this patch.
myth/Mail/BaseMailer.php 3 patches
Indentation   +283 added lines, -283 removed lines patch added patch discarded remove patch
@@ -40,290 +40,290 @@
 block discarded – undo
40 40
  */
41 41
 class BaseMailer {
42 42
 
43
-    /**
44
-     * How the email is delivered.
45
-     * Either 'send' or 'queue'.
46
-     * @var string
47
-     */
48
-    protected $action = 'send';
49
-
50
-    protected $from     = null;
51
-    protected $to       = null;
52
-    protected $reply_to = null;
53
-    protected $cc       = null;
54
-    protected $bcc      = null;
55
-
56
-    protected $message  = null;
57
-
58
-    protected $theme    = 'email';
59
-    protected $layout   = 'index';
60
-    protected $view     = null;
61
-
62
-    /**
63
-     * The MailService to use. If NULL
64
-     * will use the system default.
65
-     * @var null
66
-     */
67
-    protected $service_name  = null;
68
-
69
-    protected $service = null;
70
-
71
-    /**
72
-     * Used for theming the email messages.
73
-     * @var null
74
-     */
75
-    protected $themer = null;
76
-
77
-    //--------------------------------------------------------------------
78
-
79
-    /**
80
-     * Constructor
81
-     *
82
-     * Simply allows us to override the default settings for this mailer.
83
-     *
84
-     * @param null $options
85
-     */
86
-    public function __construct($options=null)
87
-    {
88
-        if (! empty($options))
89
-        {
90
-            $this->setOptions($options);
91
-        }
92
-    }
93
-
94
-    //--------------------------------------------------------------------
95
-
96
-    /**
97
-     * Sets the basic options available to the mailer, like 'from', 'to',
98
-     * 'cc', 'bcc', etc.
99
-     *
100
-     * @param $options
101
-     */
102
-    public function setOptions($options)
103
-    {
104
-        if (is_array($options))
105
-        {
106
-            foreach ($options as $key => $value)
107
-            {
108
-                if ($key == 'service')
109
-                {
110
-                    $this->service =& $value;
111
-                    continue;
112
-                }
113
-
114
-                if (property_exists($this, $key))
115
-                {
116
-                    $this->$key = $value;
117
-                }
118
-            }
119
-        }
120
-    }
121
-
122
-    //--------------------------------------------------------------------
123
-
124
-
125
-
126
-    /**
127
-     * Sends an email immediately using the system-defined MailService.
128
-     *
129
-     * @param string $to // Who the email is being sent to.
130
-     * @param string $subject // The subject line for the email
131
-     * @param strign $data // the key/value pairs to send to the views.
132
-     * @param string $view // You can override the view used for the email here.
133
-     *                          // You can change themes by prepending theme name
134
-     *                          // like: 'newtheme:newview'
135
-     *
136
-     * @return bool
137
-     */
138
-    public function send($to, $subject, $data=[], $view=null)
139
-    {
140
-        // Are we pretending to send?
141
-        if (config_item('mail.pretend') === true)
142
-        {
143
-            return true;
144
-        }
145
-
146
-        $this->startMailService();
147
-
148
-        $this->service->to($to);
149
-        $this->service->subject($subject);
150
-
151
-        if (is_array($this->from)) {
152
-            $this->service->from($this->from[0], $this->from[1]);
153
-        }
154
-        else
155
-        {
156
-            $this->service->from($this->from);
157
-        }
158
-
159
-        if (! empty($this->cc))         $this->service->cc($this->cc);
160
-        if (! empty($this->bcc))        $this->service->bcc($this->bcc);
161
-
162
-        if (is_array($this->reply_to)) {
163
-            $this->service->reply_to($this->reply_to[0], $this->reply_to[1]);
164
-        }
165
-        else
166
-        {
167
-            $this->service->reply_to($this->reply_to);
168
-        }
169
-
170
-
171
-        // Determine the view to use. We have to hack this a bit with
172
-        // the debug_backtrace, though, to make it all function in the background.
173
-        list(, $method) = debug_backtrace(false);
174
-
175
-        $view = 'emails/'. strtolower( (new \ReflectionClass($this))->getShortName() ) .'/'. $method['function'];
176
-
177
-        // Get our message's text and html versions based on which files exist...
178
-        $basepath = APPPATH .'views/'. $view;
179
-
180
-        // Is a text version available?
181
-        if (file_exists($basepath .'.text.php'))
182
-        {
183
-            $text = $this->load->view($view .'.text.php', $data, true);
184
-            $this->service->text_message($text);
185
-        }
186
-
187
-        // If an html version is around, we need to theme it out
188
-        if (file_exists($basepath .'.html.php'))
189
-        {
190
-            $this->startThemer();
191
-
192
-            $this->themer->setTheme($this->theme);
193
-
194
-            // Determine the correct layout to use
195
-            $layout = ! empty($this->layout) ? $this->layout : NULL;
196
-            $this->themer->setLayout($layout);
197
-
198
-            $this->themer->set($data);
199
-
200
-            // Render the view into a var we can pass to the layout.
201
-            $content = $this->themer->display($view .'.html.php');
202
-
203
-            $this->themer->set('content', $content);
204
-
205
-            $this->service->html_message( $this->themer->display($this->theme .':'. $layout) );
206
-        }
207
-
208
-        if (! $this->service->send() )
209
-        {
210
-            // todo do something here
211
-            return false;
212
-        }
213
-
214
-        return true;
215
-    }
216
-
217
-    //--------------------------------------------------------------------
218
-
219
-    /**
220
-     * Allows you to customize the headers sent with the email. You can
221
-     * do them one at a time by passing $field and $value, or pass an array
222
-     * of $field => $value pairs as the first parameter.
223
-     *
224
-     * @param string|array  $field
225
-     * @param string        $value
226
-     */
227
-    public function header($field, $value=null)
228
-    {
229
-        $this->startMailService();
230
-
231
-        $this->service->setHeader($field, $value);
232
-    }
233
-
234
-    //--------------------------------------------------------------------
235
-
236
-    /**
237
-     * Adds an attachment to the current email that is being built.
238
-     *
239
-     * @param string    $filename
240
-     * @param string    $disposition    like 'inline'. Default is 'attachment'
241
-     * @param string    $newname        If you'd like to rename the file for delivery
242
-     * @param string    $mime           Custom defined mime type.
243
-     */
244
-    public function attach($filename, $disposition=null, $newname=null, $mime=null)
245
-    {
246
-        $this->startMailService();
247
-
248
-        $this->service->attach($filename, $disposition, $newname, $mime);
249
-    }
250
-
251
-    //--------------------------------------------------------------------
252
-
253
-    //--------------------------------------------------------------------
254
-    // Private Methods
255
-    //--------------------------------------------------------------------
256
-
257
-    /**
258
-     * Starts up the service name specified in $service_name.
259
-     *
260
-     * @param $service_name
261
-     */
262
-    protected function startMailService()
263
-    {
264
-        // Only once!
265
-        if (! empty($this->service) && is_object($this->service))
266
-        {
267
-            return;
268
-        }
269
-
270
-        $service_name = ! empty($this->service_name) ? $this->service_name : config_item('mail.default_service');
271
-
272
-        if (! class_exists($service_name))
273
-        {
274
-            throw new \RuntimeException( sprintf( lang('mail.invalid_service'), $service_name) );
275
-        }
276
-
277
-        $this->service = new $service_name();
278
-    }
279
-
280
-    //--------------------------------------------------------------------
281
-
282
-    /**
283
-     * Fires up the default themer so we can use it to theme our HTML messages.
284
-     */
285
-    protected function startThemer()
286
-    {
287
-        /*
43
+	/**
44
+	 * How the email is delivered.
45
+	 * Either 'send' or 'queue'.
46
+	 * @var string
47
+	 */
48
+	protected $action = 'send';
49
+
50
+	protected $from     = null;
51
+	protected $to       = null;
52
+	protected $reply_to = null;
53
+	protected $cc       = null;
54
+	protected $bcc      = null;
55
+
56
+	protected $message  = null;
57
+
58
+	protected $theme    = 'email';
59
+	protected $layout   = 'index';
60
+	protected $view     = null;
61
+
62
+	/**
63
+	 * The MailService to use. If NULL
64
+	 * will use the system default.
65
+	 * @var null
66
+	 */
67
+	protected $service_name  = null;
68
+
69
+	protected $service = null;
70
+
71
+	/**
72
+	 * Used for theming the email messages.
73
+	 * @var null
74
+	 */
75
+	protected $themer = null;
76
+
77
+	//--------------------------------------------------------------------
78
+
79
+	/**
80
+	 * Constructor
81
+	 *
82
+	 * Simply allows us to override the default settings for this mailer.
83
+	 *
84
+	 * @param null $options
85
+	 */
86
+	public function __construct($options=null)
87
+	{
88
+		if (! empty($options))
89
+		{
90
+			$this->setOptions($options);
91
+		}
92
+	}
93
+
94
+	//--------------------------------------------------------------------
95
+
96
+	/**
97
+	 * Sets the basic options available to the mailer, like 'from', 'to',
98
+	 * 'cc', 'bcc', etc.
99
+	 *
100
+	 * @param $options
101
+	 */
102
+	public function setOptions($options)
103
+	{
104
+		if (is_array($options))
105
+		{
106
+			foreach ($options as $key => $value)
107
+			{
108
+				if ($key == 'service')
109
+				{
110
+					$this->service =& $value;
111
+					continue;
112
+				}
113
+
114
+				if (property_exists($this, $key))
115
+				{
116
+					$this->$key = $value;
117
+				}
118
+			}
119
+		}
120
+	}
121
+
122
+	//--------------------------------------------------------------------
123
+
124
+
125
+
126
+	/**
127
+	 * Sends an email immediately using the system-defined MailService.
128
+	 *
129
+	 * @param string $to // Who the email is being sent to.
130
+	 * @param string $subject // The subject line for the email
131
+	 * @param strign $data // the key/value pairs to send to the views.
132
+	 * @param string $view // You can override the view used for the email here.
133
+	 *                          // You can change themes by prepending theme name
134
+	 *                          // like: 'newtheme:newview'
135
+	 *
136
+	 * @return bool
137
+	 */
138
+	public function send($to, $subject, $data=[], $view=null)
139
+	{
140
+		// Are we pretending to send?
141
+		if (config_item('mail.pretend') === true)
142
+		{
143
+			return true;
144
+		}
145
+
146
+		$this->startMailService();
147
+
148
+		$this->service->to($to);
149
+		$this->service->subject($subject);
150
+
151
+		if (is_array($this->from)) {
152
+			$this->service->from($this->from[0], $this->from[1]);
153
+		}
154
+		else
155
+		{
156
+			$this->service->from($this->from);
157
+		}
158
+
159
+		if (! empty($this->cc))         $this->service->cc($this->cc);
160
+		if (! empty($this->bcc))        $this->service->bcc($this->bcc);
161
+
162
+		if (is_array($this->reply_to)) {
163
+			$this->service->reply_to($this->reply_to[0], $this->reply_to[1]);
164
+		}
165
+		else
166
+		{
167
+			$this->service->reply_to($this->reply_to);
168
+		}
169
+
170
+
171
+		// Determine the view to use. We have to hack this a bit with
172
+		// the debug_backtrace, though, to make it all function in the background.
173
+		list(, $method) = debug_backtrace(false);
174
+
175
+		$view = 'emails/'. strtolower( (new \ReflectionClass($this))->getShortName() ) .'/'. $method['function'];
176
+
177
+		// Get our message's text and html versions based on which files exist...
178
+		$basepath = APPPATH .'views/'. $view;
179
+
180
+		// Is a text version available?
181
+		if (file_exists($basepath .'.text.php'))
182
+		{
183
+			$text = $this->load->view($view .'.text.php', $data, true);
184
+			$this->service->text_message($text);
185
+		}
186
+
187
+		// If an html version is around, we need to theme it out
188
+		if (file_exists($basepath .'.html.php'))
189
+		{
190
+			$this->startThemer();
191
+
192
+			$this->themer->setTheme($this->theme);
193
+
194
+			// Determine the correct layout to use
195
+			$layout = ! empty($this->layout) ? $this->layout : NULL;
196
+			$this->themer->setLayout($layout);
197
+
198
+			$this->themer->set($data);
199
+
200
+			// Render the view into a var we can pass to the layout.
201
+			$content = $this->themer->display($view .'.html.php');
202
+
203
+			$this->themer->set('content', $content);
204
+
205
+			$this->service->html_message( $this->themer->display($this->theme .':'. $layout) );
206
+		}
207
+
208
+		if (! $this->service->send() )
209
+		{
210
+			// todo do something here
211
+			return false;
212
+		}
213
+
214
+		return true;
215
+	}
216
+
217
+	//--------------------------------------------------------------------
218
+
219
+	/**
220
+	 * Allows you to customize the headers sent with the email. You can
221
+	 * do them one at a time by passing $field and $value, or pass an array
222
+	 * of $field => $value pairs as the first parameter.
223
+	 *
224
+	 * @param string|array  $field
225
+	 * @param string        $value
226
+	 */
227
+	public function header($field, $value=null)
228
+	{
229
+		$this->startMailService();
230
+
231
+		$this->service->setHeader($field, $value);
232
+	}
233
+
234
+	//--------------------------------------------------------------------
235
+
236
+	/**
237
+	 * Adds an attachment to the current email that is being built.
238
+	 *
239
+	 * @param string    $filename
240
+	 * @param string    $disposition    like 'inline'. Default is 'attachment'
241
+	 * @param string    $newname        If you'd like to rename the file for delivery
242
+	 * @param string    $mime           Custom defined mime type.
243
+	 */
244
+	public function attach($filename, $disposition=null, $newname=null, $mime=null)
245
+	{
246
+		$this->startMailService();
247
+
248
+		$this->service->attach($filename, $disposition, $newname, $mime);
249
+	}
250
+
251
+	//--------------------------------------------------------------------
252
+
253
+	//--------------------------------------------------------------------
254
+	// Private Methods
255
+	//--------------------------------------------------------------------
256
+
257
+	/**
258
+	 * Starts up the service name specified in $service_name.
259
+	 *
260
+	 * @param $service_name
261
+	 */
262
+	protected function startMailService()
263
+	{
264
+		// Only once!
265
+		if (! empty($this->service) && is_object($this->service))
266
+		{
267
+			return;
268
+		}
269
+
270
+		$service_name = ! empty($this->service_name) ? $this->service_name : config_item('mail.default_service');
271
+
272
+		if (! class_exists($service_name))
273
+		{
274
+			throw new \RuntimeException( sprintf( lang('mail.invalid_service'), $service_name) );
275
+		}
276
+
277
+		$this->service = new $service_name();
278
+	}
279
+
280
+	//--------------------------------------------------------------------
281
+
282
+	/**
283
+	 * Fires up the default themer so we can use it to theme our HTML messages.
284
+	 */
285
+	protected function startThemer()
286
+	{
287
+		/*
288 288
          * Setup our Template Engine
289 289
          */
290
-        $themer = config_item('active_themer');
291
-
292
-        if (empty($themer)) {
293
-            throw new \RuntimeException( lang('no_themer') );
294
-        }
295
-
296
-        if (empty($this->themer))
297
-        {
298
-            $this->themer = new $themer( get_instance() );
299
-        }
300
-
301
-        // Register our paths with the themer
302
-        $paths = config_item('theme.paths');
303
-
304
-        foreach ($paths as $key => $path) {
305
-            $this->themer->addThemePath($key, $path);
306
-        }
307
-
308
-        // Set our default theme.
309
-        $this->themer->setDefaultTheme( 'email' );
310
-    }
311
-
312
-    //--------------------------------------------------------------------
313
-
314
-    /**
315
-     * __get magic
316
-     *
317
-     * Allows models to access CI's loaded classes using the same
318
-     * syntax as controllers.
319
-     *
320
-     * @param	string	$key
321
-     */
322
-    public function __get($key)
323
-    {
324
-        return get_instance()->$key;
325
-    }
326
-
327
-    //--------------------------------------------------------------------
290
+		$themer = config_item('active_themer');
291
+
292
+		if (empty($themer)) {
293
+			throw new \RuntimeException( lang('no_themer') );
294
+		}
295
+
296
+		if (empty($this->themer))
297
+		{
298
+			$this->themer = new $themer( get_instance() );
299
+		}
300
+
301
+		// Register our paths with the themer
302
+		$paths = config_item('theme.paths');
303
+
304
+		foreach ($paths as $key => $path) {
305
+			$this->themer->addThemePath($key, $path);
306
+		}
307
+
308
+		// Set our default theme.
309
+		$this->themer->setDefaultTheme( 'email' );
310
+	}
311
+
312
+	//--------------------------------------------------------------------
313
+
314
+	/**
315
+	 * __get magic
316
+	 *
317
+	 * Allows models to access CI's loaded classes using the same
318
+	 * syntax as controllers.
319
+	 *
320
+	 * @param	string	$key
321
+	 */
322
+	public function __get($key)
323
+	{
324
+		return get_instance()->$key;
325
+	}
326
+
327
+	//--------------------------------------------------------------------
328 328
 
329 329
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * will use the system default.
65 65
      * @var null
66 66
      */
67
-    protected $service_name  = null;
67
+    protected $service_name = null;
68 68
 
69 69
     protected $service = null;
70 70
 
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @param null $options
85 85
      */
86
-    public function __construct($options=null)
86
+    public function __construct($options = null)
87 87
     {
88
-        if (! empty($options))
88
+        if ( ! empty($options))
89 89
         {
90 90
             $this->setOptions($options);
91 91
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             {
108 108
                 if ($key == 'service')
109 109
                 {
110
-                    $this->service =& $value;
110
+                    $this->service = & $value;
111 111
                     continue;
112 112
                 }
113 113
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      *
136 136
      * @return bool
137 137
      */
138
-    public function send($to, $subject, $data=[], $view=null)
138
+    public function send($to, $subject, $data = [], $view = null)
139 139
     {
140 140
         // Are we pretending to send?
141 141
         if (config_item('mail.pretend') === true)
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
             $this->service->from($this->from);
157 157
         }
158 158
 
159
-        if (! empty($this->cc))         $this->service->cc($this->cc);
160
-        if (! empty($this->bcc))        $this->service->bcc($this->bcc);
159
+        if ( ! empty($this->cc))         $this->service->cc($this->cc);
160
+        if ( ! empty($this->bcc))        $this->service->bcc($this->bcc);
161 161
 
162 162
         if (is_array($this->reply_to)) {
163 163
             $this->service->reply_to($this->reply_to[0], $this->reply_to[1]);
@@ -172,20 +172,20 @@  discard block
 block discarded – undo
172 172
         // the debug_backtrace, though, to make it all function in the background.
173 173
         list(, $method) = debug_backtrace(false);
174 174
 
175
-        $view = 'emails/'. strtolower( (new \ReflectionClass($this))->getShortName() ) .'/'. $method['function'];
175
+        $view = 'emails/'.strtolower((new \ReflectionClass($this))->getShortName()).'/'.$method['function'];
176 176
 
177 177
         // Get our message's text and html versions based on which files exist...
178
-        $basepath = APPPATH .'views/'. $view;
178
+        $basepath = APPPATH.'views/'.$view;
179 179
 
180 180
         // Is a text version available?
181
-        if (file_exists($basepath .'.text.php'))
181
+        if (file_exists($basepath.'.text.php'))
182 182
         {
183
-            $text = $this->load->view($view .'.text.php', $data, true);
183
+            $text = $this->load->view($view.'.text.php', $data, true);
184 184
             $this->service->text_message($text);
185 185
         }
186 186
 
187 187
         // If an html version is around, we need to theme it out
188
-        if (file_exists($basepath .'.html.php'))
188
+        if (file_exists($basepath.'.html.php'))
189 189
         {
190 190
             $this->startThemer();
191 191
 
@@ -198,14 +198,14 @@  discard block
 block discarded – undo
198 198
             $this->themer->set($data);
199 199
 
200 200
             // Render the view into a var we can pass to the layout.
201
-            $content = $this->themer->display($view .'.html.php');
201
+            $content = $this->themer->display($view.'.html.php');
202 202
 
203 203
             $this->themer->set('content', $content);
204 204
 
205
-            $this->service->html_message( $this->themer->display($this->theme .':'. $layout) );
205
+            $this->service->html_message($this->themer->display($this->theme.':'.$layout));
206 206
         }
207 207
 
208
-        if (! $this->service->send() )
208
+        if ( ! $this->service->send())
209 209
         {
210 210
             // todo do something here
211 211
             return false;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
      * @param string|array  $field
225 225
      * @param string        $value
226 226
      */
227
-    public function header($field, $value=null)
227
+    public function header($field, $value = null)
228 228
     {
229 229
         $this->startMailService();
230 230
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      * @param string    $newname        If you'd like to rename the file for delivery
242 242
      * @param string    $mime           Custom defined mime type.
243 243
      */
244
-    public function attach($filename, $disposition=null, $newname=null, $mime=null)
244
+    public function attach($filename, $disposition = null, $newname = null, $mime = null)
245 245
     {
246 246
         $this->startMailService();
247 247
 
@@ -262,16 +262,16 @@  discard block
 block discarded – undo
262 262
     protected function startMailService()
263 263
     {
264 264
         // Only once!
265
-        if (! empty($this->service) && is_object($this->service))
265
+        if ( ! empty($this->service) && is_object($this->service))
266 266
         {
267 267
             return;
268 268
         }
269 269
 
270 270
         $service_name = ! empty($this->service_name) ? $this->service_name : config_item('mail.default_service');
271 271
 
272
-        if (! class_exists($service_name))
272
+        if ( ! class_exists($service_name))
273 273
         {
274
-            throw new \RuntimeException( sprintf( lang('mail.invalid_service'), $service_name) );
274
+            throw new \RuntimeException(sprintf(lang('mail.invalid_service'), $service_name));
275 275
         }
276 276
 
277 277
         $this->service = new $service_name();
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
         $themer = config_item('active_themer');
291 291
 
292 292
         if (empty($themer)) {
293
-            throw new \RuntimeException( lang('no_themer') );
293
+            throw new \RuntimeException(lang('no_themer'));
294 294
         }
295 295
 
296 296
         if (empty($this->themer))
297 297
         {
298
-            $this->themer = new $themer( get_instance() );
298
+            $this->themer = new $themer(get_instance());
299 299
         }
300 300
 
301 301
         // Register our paths with the themer
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
         }
307 307
 
308 308
         // Set our default theme.
309
-        $this->themer->setDefaultTheme( 'email' );
309
+        $this->themer->setDefaultTheme('email');
310 310
     }
311 311
 
312 312
     //--------------------------------------------------------------------
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -150,19 +150,21 @@
 block discarded – undo
150 150
 
151 151
         if (is_array($this->from)) {
152 152
             $this->service->from($this->from[0], $this->from[1]);
153
-        }
154
-        else
153
+        } else
155 154
         {
156 155
             $this->service->from($this->from);
157 156
         }
158 157
 
159
-        if (! empty($this->cc))         $this->service->cc($this->cc);
160
-        if (! empty($this->bcc))        $this->service->bcc($this->bcc);
158
+        if (! empty($this->cc)) {
159
+        	$this->service->cc($this->cc);
160
+        }
161
+        if (! empty($this->bcc)) {
162
+        	$this->service->bcc($this->bcc);
163
+        }
161 164
 
162 165
         if (is_array($this->reply_to)) {
163 166
             $this->service->reply_to($this->reply_to[0], $this->reply_to[1]);
164
-        }
165
-        else
167
+        } else
166 168
         {
167 169
             $this->service->reply_to($this->reply_to);
168 170
         }
Please login to merge, or discard this patch.
myth/Mail/CIMailService.php 2 patches
Indentation   +222 added lines, -222 removed lines patch added patch discarded remove patch
@@ -40,226 +40,226 @@
 block discarded – undo
40 40
  */
41 41
 class CIMailService implements MailServiceInterface {
42 42
 
43
-    protected $ci = null;
44
-
45
-    protected $format = 'html';
46
-
47
-    //--------------------------------------------------------------------
48
-
49
-    public function __construct()
50
-    {
51
-        $this->ci =& get_instance();
52
-
53
-        $this->ci->load->library('email');
54
-    }
55
-
56
-    //--------------------------------------------------------------------
57
-
58
-
59
-    /**
60
-     * Does the actual delivery of a message.
61
-     *
62
-     * @param bool  $clear_after    If TRUE, will reset the class after sending.
63
-     *
64
-     * @return mixed
65
-     */
66
-    public function send($clear_after=true)
67
-    {
68
-        $this->ci->email->mailtype = $this->format;
69
-
70
-        $result = $this->ci->email->send(false);
71
-
72
-        return $result;
73
-    }
74
-
75
-    //--------------------------------------------------------------------
76
-
77
-    /**
78
-     * Adds an attachment to the current email that is being built.
79
-     *
80
-     * @param string    $filename
81
-     * @param string    $disposition    like 'inline'. Default is 'attachment'
82
-     * @param string    $newname        If you'd like to rename the file for delivery
83
-     * @param string    $mime           Custom defined mime type.
84
-     */
85
-    public function attach($filename, $disposition=null, $newname=null, $mime=null)
86
-    {
87
-        $this->ci->email->attach($filename, $disposition, $newname, $mime);
88
-    }
89
-
90
-    //--------------------------------------------------------------------
91
-
92
-    /**
93
-     * Sets a header value for the email. Not every service will provide this.
94
-     *
95
-     * @param $field
96
-     * @param $value
97
-     * @return mixed
98
-     */
99
-    public function setHeader($field, $value)
100
-    {
101
-        $this->ci->email->set_header($field, $value);
102
-
103
-        return $this;
104
-    }
105
-
106
-    //--------------------------------------------------------------------
107
-
108
-    //--------------------------------------------------------------------
109
-    // Options
110
-    //--------------------------------------------------------------------
111
-
112
-    /**
113
-     * Sets the email address to send the email to.
114
-     *
115
-     * @param $email
116
-     * @return mixed
117
-     */
118
-    public function to($email)
119
-    {
120
-        $this->ci->email->to($email);
121
-
122
-        return $this;
123
-    }
124
-
125
-    //--------------------------------------------------------------------
126
-
127
-    /**
128
-     * Sets who the email is coming from.
129
-     *
130
-     * @param $email
131
-     * @param null $name
132
-     * @return mixed
133
-     */
134
-    public function from($email, $name=null)
135
-    {
136
-        $this->ci->email->from($email, $name);
137
-
138
-        return $this;
139
-    }
140
-
141
-    //--------------------------------------------------------------------
142
-
143
-    /**
144
-     * Sets a single additional email address to 'cc'.
145
-     *
146
-     * @param $email
147
-     * @return mixed
148
-     */
149
-    public function cc($email)
150
-    {
151
-        $this->ci->email->cc($email);
152
-
153
-        return $this;
154
-    }
155
-
156
-    //--------------------------------------------------------------------
157
-
158
-    /**
159
-     * Sets a single email address to 'bcc' to.
160
-     *
161
-     * @param $email
162
-     * @return mixed
163
-     */
164
-    public function bcc($email)
165
-    {
166
-        $this->ci->email->bcc($email);
167
-
168
-        return $this;
169
-    }
170
-
171
-    //--------------------------------------------------------------------
172
-
173
-    /**
174
-     * Sets the reply to address.
175
-     *
176
-     * @param $email
177
-     * @return mixed
178
-     */
179
-    public function reply_to($email, $name=null)
180
-    {
181
-        $this->ci->email->reply_to($email, $name);
182
-    }
183
-
184
-    //--------------------------------------------------------------------
185
-
186
-    /**
187
-     * Sets the subject line of the email.
188
-     *
189
-     * @param $subject
190
-     * @return mixed
191
-     */
192
-    public function subject($subject)
193
-    {
194
-        $this->ci->email->subject($subject);
195
-
196
-        return $this;
197
-    }
198
-
199
-    //--------------------------------------------------------------------
200
-
201
-    /**
202
-     * Sets the HTML portion of the email address. Optional.
203
-     *
204
-     * @param $message
205
-     * @return mixed
206
-     */
207
-    public function html_message($message)
208
-    {
209
-        $this->ci->email->message($message);
210
-
211
-        $this->format = 'html';
212
-
213
-        return $this;
214
-    }
215
-
216
-    //--------------------------------------------------------------------
217
-
218
-    /**
219
-     * Sets the text portion of the email address. Optional.
220
-     *
221
-     * @param $message
222
-     * @return mixed
223
-     */
224
-    public function text_message($message)
225
-    {
226
-        $this->ci->email->set_alt_message($message);
227
-
228
-        $this->format = 'text';
229
-
230
-        return $this;
231
-    }
232
-
233
-    //--------------------------------------------------------------------
234
-
235
-    /**
236
-     * Sets the format to send the email in. Either 'html' or 'text'.
237
-     *
238
-     * @param $format
239
-     * @return mixed
240
-     */
241
-    public function format($format)
242
-    {
243
-        $this->format = $format;
244
-
245
-        return $this;
246
-    }
247
-
248
-    //--------------------------------------------------------------------
249
-    /**
250
-     * Resets the state to blank, ready for a new email. Useful when
251
-     * sending emails in a loop and you need to make sure that the
252
-     * email is reset.
253
-     *
254
-     * @param bool $clear_attachments
255
-     * @return mixed
256
-     */
257
-    public function reset($clear_attachments=true)
258
-    {
259
-        $this->ci->email->clear($clear_attachments);
260
-
261
-        return $this;
262
-    }
263
-
264
-    //--------------------------------------------------------------------
43
+	protected $ci = null;
44
+
45
+	protected $format = 'html';
46
+
47
+	//--------------------------------------------------------------------
48
+
49
+	public function __construct()
50
+	{
51
+		$this->ci =& get_instance();
52
+
53
+		$this->ci->load->library('email');
54
+	}
55
+
56
+	//--------------------------------------------------------------------
57
+
58
+
59
+	/**
60
+	 * Does the actual delivery of a message.
61
+	 *
62
+	 * @param bool  $clear_after    If TRUE, will reset the class after sending.
63
+	 *
64
+	 * @return mixed
65
+	 */
66
+	public function send($clear_after=true)
67
+	{
68
+		$this->ci->email->mailtype = $this->format;
69
+
70
+		$result = $this->ci->email->send(false);
71
+
72
+		return $result;
73
+	}
74
+
75
+	//--------------------------------------------------------------------
76
+
77
+	/**
78
+	 * Adds an attachment to the current email that is being built.
79
+	 *
80
+	 * @param string    $filename
81
+	 * @param string    $disposition    like 'inline'. Default is 'attachment'
82
+	 * @param string    $newname        If you'd like to rename the file for delivery
83
+	 * @param string    $mime           Custom defined mime type.
84
+	 */
85
+	public function attach($filename, $disposition=null, $newname=null, $mime=null)
86
+	{
87
+		$this->ci->email->attach($filename, $disposition, $newname, $mime);
88
+	}
89
+
90
+	//--------------------------------------------------------------------
91
+
92
+	/**
93
+	 * Sets a header value for the email. Not every service will provide this.
94
+	 *
95
+	 * @param $field
96
+	 * @param $value
97
+	 * @return mixed
98
+	 */
99
+	public function setHeader($field, $value)
100
+	{
101
+		$this->ci->email->set_header($field, $value);
102
+
103
+		return $this;
104
+	}
105
+
106
+	//--------------------------------------------------------------------
107
+
108
+	//--------------------------------------------------------------------
109
+	// Options
110
+	//--------------------------------------------------------------------
111
+
112
+	/**
113
+	 * Sets the email address to send the email to.
114
+	 *
115
+	 * @param $email
116
+	 * @return mixed
117
+	 */
118
+	public function to($email)
119
+	{
120
+		$this->ci->email->to($email);
121
+
122
+		return $this;
123
+	}
124
+
125
+	//--------------------------------------------------------------------
126
+
127
+	/**
128
+	 * Sets who the email is coming from.
129
+	 *
130
+	 * @param $email
131
+	 * @param null $name
132
+	 * @return mixed
133
+	 */
134
+	public function from($email, $name=null)
135
+	{
136
+		$this->ci->email->from($email, $name);
137
+
138
+		return $this;
139
+	}
140
+
141
+	//--------------------------------------------------------------------
142
+
143
+	/**
144
+	 * Sets a single additional email address to 'cc'.
145
+	 *
146
+	 * @param $email
147
+	 * @return mixed
148
+	 */
149
+	public function cc($email)
150
+	{
151
+		$this->ci->email->cc($email);
152
+
153
+		return $this;
154
+	}
155
+
156
+	//--------------------------------------------------------------------
157
+
158
+	/**
159
+	 * Sets a single email address to 'bcc' to.
160
+	 *
161
+	 * @param $email
162
+	 * @return mixed
163
+	 */
164
+	public function bcc($email)
165
+	{
166
+		$this->ci->email->bcc($email);
167
+
168
+		return $this;
169
+	}
170
+
171
+	//--------------------------------------------------------------------
172
+
173
+	/**
174
+	 * Sets the reply to address.
175
+	 *
176
+	 * @param $email
177
+	 * @return mixed
178
+	 */
179
+	public function reply_to($email, $name=null)
180
+	{
181
+		$this->ci->email->reply_to($email, $name);
182
+	}
183
+
184
+	//--------------------------------------------------------------------
185
+
186
+	/**
187
+	 * Sets the subject line of the email.
188
+	 *
189
+	 * @param $subject
190
+	 * @return mixed
191
+	 */
192
+	public function subject($subject)
193
+	{
194
+		$this->ci->email->subject($subject);
195
+
196
+		return $this;
197
+	}
198
+
199
+	//--------------------------------------------------------------------
200
+
201
+	/**
202
+	 * Sets the HTML portion of the email address. Optional.
203
+	 *
204
+	 * @param $message
205
+	 * @return mixed
206
+	 */
207
+	public function html_message($message)
208
+	{
209
+		$this->ci->email->message($message);
210
+
211
+		$this->format = 'html';
212
+
213
+		return $this;
214
+	}
215
+
216
+	//--------------------------------------------------------------------
217
+
218
+	/**
219
+	 * Sets the text portion of the email address. Optional.
220
+	 *
221
+	 * @param $message
222
+	 * @return mixed
223
+	 */
224
+	public function text_message($message)
225
+	{
226
+		$this->ci->email->set_alt_message($message);
227
+
228
+		$this->format = 'text';
229
+
230
+		return $this;
231
+	}
232
+
233
+	//--------------------------------------------------------------------
234
+
235
+	/**
236
+	 * Sets the format to send the email in. Either 'html' or 'text'.
237
+	 *
238
+	 * @param $format
239
+	 * @return mixed
240
+	 */
241
+	public function format($format)
242
+	{
243
+		$this->format = $format;
244
+
245
+		return $this;
246
+	}
247
+
248
+	//--------------------------------------------------------------------
249
+	/**
250
+	 * Resets the state to blank, ready for a new email. Useful when
251
+	 * sending emails in a loop and you need to make sure that the
252
+	 * email is reset.
253
+	 *
254
+	 * @param bool $clear_attachments
255
+	 * @return mixed
256
+	 */
257
+	public function reset($clear_attachments=true)
258
+	{
259
+		$this->ci->email->clear($clear_attachments);
260
+
261
+		return $this;
262
+	}
263
+
264
+	//--------------------------------------------------------------------
265 265
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function __construct()
50 50
     {
51
-        $this->ci =& get_instance();
51
+        $this->ci = & get_instance();
52 52
 
53 53
         $this->ci->load->library('email');
54 54
     }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      *
64 64
      * @return mixed
65 65
      */
66
-    public function send($clear_after=true)
66
+    public function send($clear_after = true)
67 67
     {
68 68
         $this->ci->email->mailtype = $this->format;
69 69
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @param string    $newname        If you'd like to rename the file for delivery
83 83
      * @param string    $mime           Custom defined mime type.
84 84
      */
85
-    public function attach($filename, $disposition=null, $newname=null, $mime=null)
85
+    public function attach($filename, $disposition = null, $newname = null, $mime = null)
86 86
     {
87 87
         $this->ci->email->attach($filename, $disposition, $newname, $mime);
88 88
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      * @param null $name
132 132
      * @return mixed
133 133
      */
134
-    public function from($email, $name=null)
134
+    public function from($email, $name = null)
135 135
     {
136 136
         $this->ci->email->from($email, $name);
137 137
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      * @param $email
177 177
      * @return mixed
178 178
      */
179
-    public function reply_to($email, $name=null)
179
+    public function reply_to($email, $name = null)
180 180
     {
181 181
         $this->ci->email->reply_to($email, $name);
182 182
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      * @param bool $clear_attachments
255 255
      * @return mixed
256 256
      */
257
-    public function reset($clear_attachments=true)
257
+    public function reset($clear_attachments = true)
258 258
     {
259 259
         $this->ci->email->clear($clear_attachments);
260 260
 
Please login to merge, or discard this patch.
myth/Mail/MailServiceInterface.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @return mixed
51 51
      */
52
-    public function send($clear_after=true);
52
+    public function send($clear_after = true);
53 53
 
54 54
     //--------------------------------------------------------------------
55 55
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * @param string    $newname        If you'd like to rename the file for delivery
62 62
      * @param string    $mime           Custom defined mime type.
63 63
      */
64
-    public function attach($filename, $disposition=null, $newname=null, $mime=null);
64
+    public function attach($filename, $disposition = null, $newname = null, $mime = null);
65 65
 
66 66
     //--------------------------------------------------------------------
67 67
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * @param null $name
98 98
      * @return mixed
99 99
      */
100
-    public function from($email, $name=null);
100
+    public function from($email, $name = null);
101 101
 
102 102
     //--------------------------------------------------------------------
103 103
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      * @param $name
129 129
      * @return mixed
130 130
      */
131
-    public function reply_to($email, $name=null);
131
+    public function reply_to($email, $name = null);
132 132
 
133 133
     //--------------------------------------------------------------------
134 134
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      * @param bool $clear_attachments
181 181
      * @return mixed
182 182
      */
183
-    public function reset($clear_attachments=true);
183
+    public function reset($clear_attachments = true);
184 184
 
185 185
     //--------------------------------------------------------------------
186 186
 }
Please login to merge, or discard this patch.
Indentation   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -1,34 +1,34 @@  discard block
 block discarded – undo
1 1
 <?php namespace Myth\Mail;
2 2
 /**
3
- * Sprint
4
- *
5
- * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in
15
- * all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- *
25
- * @package     Sprint
26
- * @author      Lonnie Ezell
27
- * @copyright   Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com)
28
- * @license     http://opensource.org/licenses/MIT  (MIT)
29
- * @link        http://sprintphp.com
30
- * @since       Version 1.0
31
- */
3
+	 * Sprint
4
+	 *
5
+	 * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow.
6
+	 *
7
+	 * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+	 * of this software and associated documentation files (the "Software"), to deal
9
+	 * in the Software without restriction, including without limitation the rights
10
+	 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+	 * copies of the Software, and to permit persons to whom the Software is
12
+	 * furnished to do so, subject to the following conditions:
13
+	 *
14
+	 * The above copyright notice and this permission notice shall be included in
15
+	 * all copies or substantial portions of the Software.
16
+	 *
17
+	 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+	 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+	 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+	 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+	 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+	 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+	 * THE SOFTWARE.
24
+	 *
25
+	 * @package     Sprint
26
+	 * @author      Lonnie Ezell
27
+	 * @copyright   Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com)
28
+	 * @license     http://opensource.org/licenses/MIT  (MIT)
29
+	 * @link        http://sprintphp.com
30
+	 * @since       Version 1.0
31
+	 */
32 32
 
33 33
 /**
34 34
  * Interface MailService
@@ -42,145 +42,145 @@  discard block
 block discarded – undo
42 42
  */
43 43
 interface MailServiceInterface {
44 44
 
45
-    /**
46
-     * Does the actual delivery of a message.
47
-     *
48
-     * @param bool  $clear_after    If TRUE, will reset the class after sending.
49
-     *
50
-     * @return mixed
51
-     */
52
-    public function send($clear_after=true);
53
-
54
-    //--------------------------------------------------------------------
55
-
56
-    /**
57
-     * Adds an attachment to the current email that is being built.
58
-     *
59
-     * @param string    $filename
60
-     * @param string    $disposition    like 'inline'. Default is 'attachment'
61
-     * @param string    $newname        If you'd like to rename the file for delivery
62
-     * @param string    $mime           Custom defined mime type.
63
-     */
64
-    public function attach($filename, $disposition=null, $newname=null, $mime=null);
65
-
66
-    //--------------------------------------------------------------------
67
-
68
-    /**
69
-     * Sets a header value for the email. Not every service will provide this.
70
-     *
71
-     * @param $field
72
-     * @param $value
73
-     * @return mixed
74
-     */
75
-    public function setHeader($field, $value);
76
-
77
-    //--------------------------------------------------------------------
78
-
79
-    //--------------------------------------------------------------------
80
-    // Options
81
-    //--------------------------------------------------------------------
82
-
83
-    /**
84
-     * Sets the email address to send the email to.
85
-     *
86
-     * @param $email
87
-     * @return mixed
88
-     */
89
-    public function to($email);
45
+	/**
46
+	 * Does the actual delivery of a message.
47
+	 *
48
+	 * @param bool  $clear_after    If TRUE, will reset the class after sending.
49
+	 *
50
+	 * @return mixed
51
+	 */
52
+	public function send($clear_after=true);
53
+
54
+	//--------------------------------------------------------------------
55
+
56
+	/**
57
+	 * Adds an attachment to the current email that is being built.
58
+	 *
59
+	 * @param string    $filename
60
+	 * @param string    $disposition    like 'inline'. Default is 'attachment'
61
+	 * @param string    $newname        If you'd like to rename the file for delivery
62
+	 * @param string    $mime           Custom defined mime type.
63
+	 */
64
+	public function attach($filename, $disposition=null, $newname=null, $mime=null);
65
+
66
+	//--------------------------------------------------------------------
67
+
68
+	/**
69
+	 * Sets a header value for the email. Not every service will provide this.
70
+	 *
71
+	 * @param $field
72
+	 * @param $value
73
+	 * @return mixed
74
+	 */
75
+	public function setHeader($field, $value);
76
+
77
+	//--------------------------------------------------------------------
78
+
79
+	//--------------------------------------------------------------------
80
+	// Options
81
+	//--------------------------------------------------------------------
82
+
83
+	/**
84
+	 * Sets the email address to send the email to.
85
+	 *
86
+	 * @param $email
87
+	 * @return mixed
88
+	 */
89
+	public function to($email);
90 90
     
91
-    //--------------------------------------------------------------------
92
-
93
-    /**
94
-     * Sets who the email is coming from.
95
-     *
96
-     * @param $email
97
-     * @param null $name
98
-     * @return mixed
99
-     */
100
-    public function from($email, $name=null);
101
-
102
-    //--------------------------------------------------------------------
103
-
104
-    /**
105
-     * Sets a single additional email address to 'cc'.
106
-     *
107
-     * @param $email
108
-     * @return mixed
109
-     */
110
-    public function cc($email);
111
-
112
-    //--------------------------------------------------------------------
113
-
114
-    /**
115
-     * Sets a single email address to 'bcc' to.
116
-     *
117
-     * @param $email
118
-     * @return mixed
119
-     */
120
-    public function bcc($email);
121
-
122
-    //--------------------------------------------------------------------
123
-
124
-    /**
125
-     * Sets the reply to address.
126
-     *
127
-     * @param $email
128
-     * @param $name
129
-     * @return mixed
130
-     */
131
-    public function reply_to($email, $name=null);
132
-
133
-    //--------------------------------------------------------------------
134
-
135
-    /**
136
-     * Sets the subject line of the email.
137
-     *
138
-     * @param $subject
139
-     * @return mixed
140
-     */
141
-    public function subject($subject);
142
-
143
-    //--------------------------------------------------------------------
144
-
145
-    /**
146
-     * Sets the HTML portion of the email address. Optional.
147
-     *
148
-     * @param $message
149
-     * @return mixed
150
-     */
151
-    public function html_message($message);
152
-
153
-    //--------------------------------------------------------------------
154
-
155
-    /**
156
-     * Sets the text portion of the email address. Optional.
157
-     *
158
-     * @param $message
159
-     * @return mixed
160
-     */
161
-    public function text_message($message);
162
-
163
-    //--------------------------------------------------------------------
164
-
165
-    /**
166
-     * Sets the format to send the email in. Either 'html' or 'text'.
167
-     *
168
-     * @param $format
169
-     * @return mixed
170
-     */
171
-    public function format($format);
172
-
173
-    //--------------------------------------------------------------------
174
-
175
-    /**
176
-     * Resets the state to blank, ready for a new email. Useful when
177
-     * sending emails in a loop and you need to make sure that the
178
-     * email is reset.
179
-     *
180
-     * @param bool $clear_attachments
181
-     * @return mixed
182
-     */
183
-    public function reset($clear_attachments=true);
184
-
185
-    //--------------------------------------------------------------------
91
+	//--------------------------------------------------------------------
92
+
93
+	/**
94
+	 * Sets who the email is coming from.
95
+	 *
96
+	 * @param $email
97
+	 * @param null $name
98
+	 * @return mixed
99
+	 */
100
+	public function from($email, $name=null);
101
+
102
+	//--------------------------------------------------------------------
103
+
104
+	/**
105
+	 * Sets a single additional email address to 'cc'.
106
+	 *
107
+	 * @param $email
108
+	 * @return mixed
109
+	 */
110
+	public function cc($email);
111
+
112
+	//--------------------------------------------------------------------
113
+
114
+	/**
115
+	 * Sets a single email address to 'bcc' to.
116
+	 *
117
+	 * @param $email
118
+	 * @return mixed
119
+	 */
120
+	public function bcc($email);
121
+
122
+	//--------------------------------------------------------------------
123
+
124
+	/**
125
+	 * Sets the reply to address.
126
+	 *
127
+	 * @param $email
128
+	 * @param $name
129
+	 * @return mixed
130
+	 */
131
+	public function reply_to($email, $name=null);
132
+
133
+	//--------------------------------------------------------------------
134
+
135
+	/**
136
+	 * Sets the subject line of the email.
137
+	 *
138
+	 * @param $subject
139
+	 * @return mixed
140
+	 */
141
+	public function subject($subject);
142
+
143
+	//--------------------------------------------------------------------
144
+
145
+	/**
146
+	 * Sets the HTML portion of the email address. Optional.
147
+	 *
148
+	 * @param $message
149
+	 * @return mixed
150
+	 */
151
+	public function html_message($message);
152
+
153
+	//--------------------------------------------------------------------
154
+
155
+	/**
156
+	 * Sets the text portion of the email address. Optional.
157
+	 *
158
+	 * @param $message
159
+	 * @return mixed
160
+	 */
161
+	public function text_message($message);
162
+
163
+	//--------------------------------------------------------------------
164
+
165
+	/**
166
+	 * Sets the format to send the email in. Either 'html' or 'text'.
167
+	 *
168
+	 * @param $format
169
+	 * @return mixed
170
+	 */
171
+	public function format($format);
172
+
173
+	//--------------------------------------------------------------------
174
+
175
+	/**
176
+	 * Resets the state to blank, ready for a new email. Useful when
177
+	 * sending emails in a loop and you need to make sure that the
178
+	 * email is reset.
179
+	 *
180
+	 * @param bool $clear_attachments
181
+	 * @return mixed
182
+	 */
183
+	public function reset($clear_attachments=true);
184
+
185
+	//--------------------------------------------------------------------
186 186
 }
Please login to merge, or discard this patch.
myth/Mail/Queue.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,41 +1,41 @@
 block discarded – undo
1 1
 <?php namespace Myth\Mail;
2 2
 /**
3
- * Sprint
4
- *
5
- * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in
15
- * all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- *
25
- * @package     Sprint
26
- * @author      Lonnie Ezell
27
- * @copyright   Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com)
28
- * @license     http://opensource.org/licenses/MIT  (MIT)
29
- * @link        http://sprintphp.com
30
- * @since       Version 1.0
31
- */
3
+	 * Sprint
4
+	 *
5
+	 * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow.
6
+	 *
7
+	 * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+	 * of this software and associated documentation files (the "Software"), to deal
9
+	 * in the Software without restriction, including without limitation the rights
10
+	 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+	 * copies of the Software, and to permit persons to whom the Software is
12
+	 * furnished to do so, subject to the following conditions:
13
+	 *
14
+	 * The above copyright notice and this permission notice shall be included in
15
+	 * all copies or substantial portions of the Software.
16
+	 *
17
+	 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+	 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+	 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+	 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+	 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+	 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+	 * THE SOFTWARE.
24
+	 *
25
+	 * @package     Sprint
26
+	 * @author      Lonnie Ezell
27
+	 * @copyright   Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com)
28
+	 * @license     http://opensource.org/licenses/MIT  (MIT)
29
+	 * @link        http://sprintphp.com
30
+	 * @since       Version 1.0
31
+	 */
32 32
 
33 33
 use Myth\Models\CIDbModel;
34 34
 
35 35
 class Queue extends CIDbModel {
36 36
 
37
-    protected $table_name = 'mail_queue';
37
+	protected $table_name = 'mail_queue';
38 38
 
39
-    protected $set_created = false;
40
-    protected $set_modified = false;
39
+	protected $set_created = false;
40
+	protected $set_modified = false;
41 41
 }
Please login to merge, or discard this patch.
myth/Settings/ConfigStore.php 3 patches
Indentation   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -49,143 +49,143 @@
 block discarded – undo
49 49
  */
50 50
 class ConfigStore implements SettingsStoreInterface {
51 51
 
52
-    protected $ci;
53
-
54
-    //--------------------------------------------------------------------
55
-
56
-    public function __construct( $ci=null )
57
-    {
58
-        if (is_object($ci))
59
-        {
60
-            $this->ci =& $ci;
61
-        }
62
-        else {
63
-            $this->ci =& get_instance();
64
-        }
65
-    }
66
-
67
-    //--------------------------------------------------------------------
68
-
69
-    /**
70
-     * Inserts/Replaces a single setting item.
71
-     *
72
-     * @param $key
73
-     * @param null $value
74
-     * @param string $group
75
-     */
76
-    public function save($key, $value=null, $group='app')
77
-    {
78
-        // Treat the 'app' group as our primary, un-sectioned
79
-        // config files.
80
-        if ($group != 'app')
81
-        {
82
-            return $this->ci->config->set_item($key, $value);
83
-        }
84
-
85
-        // Otherwise, we'll need to ensure a section exists
86
-        if (! isset($this->ci->config->config[$group]))
87
-        {
88
-            $this->ci->config->config[$group] = [];
89
-        }
90
-
91
-        $this->ci->config->config[$group][$key] = $value;
92
-    }
93
-
94
-    //--------------------------------------------------------------------
95
-
96
-    /**
97
-     * Retrieves a single item. If the config system doesn't have the
98
-     * value loaded, yet, it will attempt to load a config file matching
99
-     * the 'group' name and grab the value from that.
100
-     *
101
-     * @param $key
102
-     * @param string $group
103
-     * @return mixed
104
-     */
105
-    public function get($key, $group='application')
106
-    {
107
-        // First, see if CI already has this key loaded.
108
-        $result = $this->ci->config->item($key);
109
-
110
-        // This bit will fail when the actual value is NULL
111
-        // but should result in false hits infrequently.
112
-        if ($result !== null)
113
-        {
114
-            return $result;
115
-        }
116
-
117
-        // Try to load the 'group' file, then try to load a
118
-        // config file that matches the group name
119
-        $this->ci->load->config($group, false, true);
52
+	protected $ci;
53
+
54
+	//--------------------------------------------------------------------
55
+
56
+	public function __construct( $ci=null )
57
+	{
58
+		if (is_object($ci))
59
+		{
60
+			$this->ci =& $ci;
61
+		}
62
+		else {
63
+			$this->ci =& get_instance();
64
+		}
65
+	}
66
+
67
+	//--------------------------------------------------------------------
68
+
69
+	/**
70
+	 * Inserts/Replaces a single setting item.
71
+	 *
72
+	 * @param $key
73
+	 * @param null $value
74
+	 * @param string $group
75
+	 */
76
+	public function save($key, $value=null, $group='app')
77
+	{
78
+		// Treat the 'app' group as our primary, un-sectioned
79
+		// config files.
80
+		if ($group != 'app')
81
+		{
82
+			return $this->ci->config->set_item($key, $value);
83
+		}
84
+
85
+		// Otherwise, we'll need to ensure a section exists
86
+		if (! isset($this->ci->config->config[$group]))
87
+		{
88
+			$this->ci->config->config[$group] = [];
89
+		}
90
+
91
+		$this->ci->config->config[$group][$key] = $value;
92
+	}
93
+
94
+	//--------------------------------------------------------------------
95
+
96
+	/**
97
+	 * Retrieves a single item. If the config system doesn't have the
98
+	 * value loaded, yet, it will attempt to load a config file matching
99
+	 * the 'group' name and grab the value from that.
100
+	 *
101
+	 * @param $key
102
+	 * @param string $group
103
+	 * @return mixed
104
+	 */
105
+	public function get($key, $group='application')
106
+	{
107
+		// First, see if CI already has this key loaded.
108
+		$result = $this->ci->config->item($key);
109
+
110
+		// This bit will fail when the actual value is NULL
111
+		// but should result in false hits infrequently.
112
+		if ($result !== null)
113
+		{
114
+			return $result;
115
+		}
116
+
117
+		// Try to load the 'group' file, then try to load a
118
+		// config file that matches the group name
119
+		$this->ci->load->config($group, false, true);
120 120
         
121
-        $result = $this->ci->config->item($key);
122
-
123
-        return $result;
124
-    }
125
-
126
-    //--------------------------------------------------------------------
127
-
128
-    /**
129
-     * Deletes a single item.
130
-     *
131
-     * NOT supported by this store.
132
-     *
133
-     * @param $key
134
-     * @param $group
135
-     * @return mixed
136
-     */
137
-    public function delete($key, $group='app')
138
-    {
139
-        return false;
140
-    }
141
-
142
-    //--------------------------------------------------------------------
143
-
144
-    /**
145
-     * Searches the store for any items with $field = $value.
146
-     *
147
-     * Does not work.
148
-     *
149
-     * @param $field
150
-     * @param $value
151
-     * @return mixed
152
-     */
153
-    public function findBy($field, $value)
154
-    {
155
-        return false;
156
-    }
157
-
158
-    //--------------------------------------------------------------------
159
-
160
-    /**
161
-     * Retrieves all items in the store either globally or for a single group.
162
-     *
163
-     * @param string $group
164
-     * @return mixed
165
-     */
166
-    public function all($group=null)
167
-    {
168
-        if (empty($group))
169
-        {
170
-            return $this->ci->config->config;
171
-        }
172
-
173
-        // If we're a group, does the group already exists
174
-        // as a 'section' in the config array?
175
-        if (isset($this->ci->config->config[$group]))
176
-        {
177
-            return $this->ci->config->config[$group];
178
-        }
179
-
180
-        // Still here? Attempt to load the file into a section
181
-        // and try one last time.
182
-        if ($this->ci->load->config($group))
183
-        {
184
-            return $this->ci->config->config($group);
185
-        }
186
-
187
-        return null;
188
-    }
189
-
190
-    //--------------------------------------------------------------------
121
+		$result = $this->ci->config->item($key);
122
+
123
+		return $result;
124
+	}
125
+
126
+	//--------------------------------------------------------------------
127
+
128
+	/**
129
+	 * Deletes a single item.
130
+	 *
131
+	 * NOT supported by this store.
132
+	 *
133
+	 * @param $key
134
+	 * @param $group
135
+	 * @return mixed
136
+	 */
137
+	public function delete($key, $group='app')
138
+	{
139
+		return false;
140
+	}
141
+
142
+	//--------------------------------------------------------------------
143
+
144
+	/**
145
+	 * Searches the store for any items with $field = $value.
146
+	 *
147
+	 * Does not work.
148
+	 *
149
+	 * @param $field
150
+	 * @param $value
151
+	 * @return mixed
152
+	 */
153
+	public function findBy($field, $value)
154
+	{
155
+		return false;
156
+	}
157
+
158
+	//--------------------------------------------------------------------
159
+
160
+	/**
161
+	 * Retrieves all items in the store either globally or for a single group.
162
+	 *
163
+	 * @param string $group
164
+	 * @return mixed
165
+	 */
166
+	public function all($group=null)
167
+	{
168
+		if (empty($group))
169
+		{
170
+			return $this->ci->config->config;
171
+		}
172
+
173
+		// If we're a group, does the group already exists
174
+		// as a 'section' in the config array?
175
+		if (isset($this->ci->config->config[$group]))
176
+		{
177
+			return $this->ci->config->config[$group];
178
+		}
179
+
180
+		// Still here? Attempt to load the file into a section
181
+		// and try one last time.
182
+		if ($this->ci->load->config($group))
183
+		{
184
+			return $this->ci->config->config($group);
185
+		}
186
+
187
+		return null;
188
+	}
189
+
190
+	//--------------------------------------------------------------------
191 191
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 
54 54
     //--------------------------------------------------------------------
55 55
 
56
-    public function __construct( $ci=null )
56
+    public function __construct($ci = null)
57 57
     {
58 58
         if (is_object($ci))
59 59
         {
60
-            $this->ci =& $ci;
60
+            $this->ci = & $ci;
61 61
         }
62 62
         else {
63
-            $this->ci =& get_instance();
63
+            $this->ci = & get_instance();
64 64
         }
65 65
     }
66 66
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * @param null $value
74 74
      * @param string $group
75 75
      */
76
-    public function save($key, $value=null, $group='app')
76
+    public function save($key, $value = null, $group = 'app')
77 77
     {
78 78
         // Treat the 'app' group as our primary, un-sectioned
79 79
         // config files.
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         // Otherwise, we'll need to ensure a section exists
86
-        if (! isset($this->ci->config->config[$group]))
86
+        if ( ! isset($this->ci->config->config[$group]))
87 87
         {
88 88
             $this->ci->config->config[$group] = [];
89 89
         }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @param string $group
103 103
      * @return mixed
104 104
      */
105
-    public function get($key, $group='application')
105
+    public function get($key, $group = 'application')
106 106
     {
107 107
         // First, see if CI already has this key loaded.
108 108
         $result = $this->ci->config->item($key);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @param $group
135 135
      * @return mixed
136 136
      */
137
-    public function delete($key, $group='app')
137
+    public function delete($key, $group = 'app')
138 138
     {
139 139
         return false;
140 140
     }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      * @param string $group
164 164
      * @return mixed
165 165
      */
166
-    public function all($group=null)
166
+    public function all($group = null)
167 167
     {
168 168
         if (empty($group))
169 169
         {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@
 block discarded – undo
43 43
         if (is_object($ci))
44 44
         {
45 45
             $this->ci =& $ci;
46
-        }
47
-        else {
46
+        } else {
48 47
             $this->ci =& get_instance();
49 48
         }
50 49
 
Please login to merge, or discard this patch.
myth/Settings/DatabaseStore.php 3 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
 
39 39
     //--------------------------------------------------------------------
40 40
 
41
-    public function __construct( $ci=null )
41
+    public function __construct($ci = null)
42 42
     {
43 43
         if (is_object($ci))
44 44
         {
45
-            $this->ci =& $ci;
45
+            $this->ci = & $ci;
46 46
         }
47 47
         else {
48
-            $this->ci =& get_instance();
48
+            $this->ci = & get_instance();
49 49
         }
50 50
 
51 51
         // Ensure that the database is loaded.
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param string $group
66 66
      * @return bool
67 67
      */
68
-    public function save($key, $value=null, $group='app')
68
+    public function save($key, $value = null, $group = 'app')
69 69
     {
70 70
         if (empty($this->ci->db) || ! is_object($this->ci->db))
71 71
         {
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @param string $group
101 101
      * @return mixed
102 102
      */
103
-    public function get($key, $group='app')
103
+    public function get($key, $group = 'app')
104 104
     {
105 105
         if (empty($this->ci->db) || ! is_object($this->ci->db))
106 106
         {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $query = $this->ci->db->where($where)
116 116
                               ->get('settings');
117 117
 
118
-        if (! $query->num_rows())
118
+        if ( ! $query->num_rows())
119 119
         {
120 120
             return false;
121 121
         }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $value = $query->row()->value;
124 124
 
125 125
         // Check to see if it needs to be unserialized
126
-        $data = @unserialize($value);   // We don't need to issue an E_NOTICE here...
126
+        $data = @unserialize($value); // We don't need to issue an E_NOTICE here...
127 127
 
128 128
         // Check for a value of false or
129 129
         if ($value === 'b:0;' || $data !== false)
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      * @param $group
144 144
      * @return mixed
145 145
      */
146
-    public function delete($key, $group='app')
146
+    public function delete($key, $group = 'app')
147 147
     {
148 148
         if (empty($this->ci->db) || ! is_object($this->ci->db))
149 149
         {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $query = $this->ci->db->where($field, $value)
178 178
                               ->get('settings');
179 179
 
180
-        if (! $query->num_rows())
180
+        if ( ! $query->num_rows())
181 181
         {
182 182
             return false;
183 183
         }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      * @param string $group
194 194
      * @return mixed
195 195
      */
196
-    public function all($group=null)
196
+    public function all($group = null)
197 197
     {
198 198
         if (empty($this->ci->db) || ! is_object($this->ci->db))
199 199
         {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
         $query = $this->ci->db->get('settings');
204 204
 
205
-        if (! $query->num_rows())
205
+        if ( ! $query->num_rows())
206 206
         {
207 207
             return false;
208 208
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@
 block discarded – undo
43 43
         if (is_object($ci))
44 44
         {
45 45
             $this->ci =& $ci;
46
-        }
47
-        else {
46
+        } else {
48 47
             $this->ci =& get_instance();
49 48
         }
50 49
 
Please login to merge, or discard this patch.
Indentation   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -32,183 +32,183 @@
 block discarded – undo
32 32
 
33 33
 class DatabaseStore implements SettingsStoreInterface {
34 34
 
35
-    protected $ci;
36
-
37
-    protected $db;
38
-
39
-    //--------------------------------------------------------------------
40
-
41
-    public function __construct( $ci=null )
42
-    {
43
-        if (is_object($ci))
44
-        {
45
-            $this->ci =& $ci;
46
-        }
47
-        else {
48
-            $this->ci =& get_instance();
49
-        }
50
-
51
-        // Ensure that the database is loaded.
52
-        if (empty($this->ci->db))
53
-        {
54
-            $this->ci->load->database();
55
-        }
56
-    }
57
-
58
-    //--------------------------------------------------------------------
59
-
60
-    /**
61
-     * Inserts or Replaces an setting value.
62
-     *
63
-     * @param $key
64
-     * @param null $value
65
-     * @param string $group
66
-     * @return bool
67
-     */
68
-    public function save($key, $value=null, $group='app')
69
-    {
70
-        if (empty($this->ci->db) || ! is_object($this->ci->db))
71
-        {
72
-            return false;
73
-        }
74
-
75
-        $where = [
76
-            'name'  => $key,
77
-            'group' => $group
78
-        ];
79
-        $this->ci->db->delete('settings', $where);
80
-
81
-        if (is_array($value) || is_object($value))
82
-        {
83
-            $value = serialize($value);
84
-        }
85
-
86
-        $data = [
87
-            'name'  => $key,
88
-            'value' => $value,
89
-            'group' => $group
90
-        ];
91
-        return $this->ci->db->insert('settings', $data);
92
-    }
93
-
94
-    //--------------------------------------------------------------------
95
-
96
-    /**
97
-     * Retrieves a single item.
98
-     *
99
-     * @param $key
100
-     * @param string $group
101
-     * @return mixed
102
-     */
103
-    public function get($key, $group='app')
104
-    {
105
-        if (empty($this->ci->db) || ! is_object($this->ci->db))
106
-        {
107
-            return false;
108
-        }
109
-
110
-        $where = [
111
-            'name'  => $key,
112
-            'group' => $group
113
-        ];
114
-
115
-        $query = $this->ci->db->where($where)
116
-                              ->get('settings');
117
-
118
-        if (! $query->num_rows())
119
-        {
120
-            return false;
121
-        }
122
-
123
-        $value = $query->row()->value;
124
-
125
-        // Check to see if it needs to be unserialized
126
-        $data = @unserialize($value);   // We don't need to issue an E_NOTICE here...
127
-
128
-        // Check for a value of false or
129
-        if ($value === 'b:0;' || $data !== false)
130
-        {
131
-            $value = $data;
132
-        }
133
-
134
-        return $value;
135
-    }
136
-
137
-    //--------------------------------------------------------------------
138
-
139
-    /**
140
-     * Deletes a single item.
141
-     *
142
-     * @param $key
143
-     * @param $group
144
-     * @return mixed
145
-     */
146
-    public function delete($key, $group='app')
147
-    {
148
-        if (empty($this->ci->db) || ! is_object($this->ci->db))
149
-        {
150
-            return false;
151
-        }
152
-
153
-        $where = [
154
-            'name'  => $key,
155
-            'group' => $group
156
-        ];
157
-
158
-        return $this->ci->db->delete('settings', $where);
159
-    }
160
-
161
-    //--------------------------------------------------------------------
162
-
163
-    /**
164
-     * Searches the store for any items with $field = $value.
165
-     *
166
-     * @param $field
167
-     * @param $value
168
-     * @return mixed
169
-     */
170
-    public function findBy($field, $value)
171
-    {
172
-        if (empty($this->ci->db) || ! is_object($this->ci->db))
173
-        {
174
-            return false;
175
-        }
176
-
177
-        $query = $this->ci->db->where($field, $value)
178
-                              ->get('settings');
179
-
180
-        if (! $query->num_rows())
181
-        {
182
-            return false;
183
-        }
184
-
185
-        return $query->result_array();
186
-    }
187
-
188
-    //--------------------------------------------------------------------
189
-
190
-    /**
191
-     * Retrieves all items in the store either globally or for a single group.
192
-     *
193
-     * @param string $group
194
-     * @return mixed
195
-     */
196
-    public function all($group=null)
197
-    {
198
-        if (empty($this->ci->db) || ! is_object($this->ci->db))
199
-        {
200
-            return false;
201
-        }
202
-
203
-        $query = $this->ci->db->get('settings');
204
-
205
-        if (! $query->num_rows())
206
-        {
207
-            return false;
208
-        }
209
-
210
-        return $query->result_array();
211
-    }
212
-
213
-    //--------------------------------------------------------------------
35
+	protected $ci;
36
+
37
+	protected $db;
38
+
39
+	//--------------------------------------------------------------------
40
+
41
+	public function __construct( $ci=null )
42
+	{
43
+		if (is_object($ci))
44
+		{
45
+			$this->ci =& $ci;
46
+		}
47
+		else {
48
+			$this->ci =& get_instance();
49
+		}
50
+
51
+		// Ensure that the database is loaded.
52
+		if (empty($this->ci->db))
53
+		{
54
+			$this->ci->load->database();
55
+		}
56
+	}
57
+
58
+	//--------------------------------------------------------------------
59
+
60
+	/**
61
+	 * Inserts or Replaces an setting value.
62
+	 *
63
+	 * @param $key
64
+	 * @param null $value
65
+	 * @param string $group
66
+	 * @return bool
67
+	 */
68
+	public function save($key, $value=null, $group='app')
69
+	{
70
+		if (empty($this->ci->db) || ! is_object($this->ci->db))
71
+		{
72
+			return false;
73
+		}
74
+
75
+		$where = [
76
+			'name'  => $key,
77
+			'group' => $group
78
+		];
79
+		$this->ci->db->delete('settings', $where);
80
+
81
+		if (is_array($value) || is_object($value))
82
+		{
83
+			$value = serialize($value);
84
+		}
85
+
86
+		$data = [
87
+			'name'  => $key,
88
+			'value' => $value,
89
+			'group' => $group
90
+		];
91
+		return $this->ci->db->insert('settings', $data);
92
+	}
93
+
94
+	//--------------------------------------------------------------------
95
+
96
+	/**
97
+	 * Retrieves a single item.
98
+	 *
99
+	 * @param $key
100
+	 * @param string $group
101
+	 * @return mixed
102
+	 */
103
+	public function get($key, $group='app')
104
+	{
105
+		if (empty($this->ci->db) || ! is_object($this->ci->db))
106
+		{
107
+			return false;
108
+		}
109
+
110
+		$where = [
111
+			'name'  => $key,
112
+			'group' => $group
113
+		];
114
+
115
+		$query = $this->ci->db->where($where)
116
+							  ->get('settings');
117
+
118
+		if (! $query->num_rows())
119
+		{
120
+			return false;
121
+		}
122
+
123
+		$value = $query->row()->value;
124
+
125
+		// Check to see if it needs to be unserialized
126
+		$data = @unserialize($value);   // We don't need to issue an E_NOTICE here...
127
+
128
+		// Check for a value of false or
129
+		if ($value === 'b:0;' || $data !== false)
130
+		{
131
+			$value = $data;
132
+		}
133
+
134
+		return $value;
135
+	}
136
+
137
+	//--------------------------------------------------------------------
138
+
139
+	/**
140
+	 * Deletes a single item.
141
+	 *
142
+	 * @param $key
143
+	 * @param $group
144
+	 * @return mixed
145
+	 */
146
+	public function delete($key, $group='app')
147
+	{
148
+		if (empty($this->ci->db) || ! is_object($this->ci->db))
149
+		{
150
+			return false;
151
+		}
152
+
153
+		$where = [
154
+			'name'  => $key,
155
+			'group' => $group
156
+		];
157
+
158
+		return $this->ci->db->delete('settings', $where);
159
+	}
160
+
161
+	//--------------------------------------------------------------------
162
+
163
+	/**
164
+	 * Searches the store for any items with $field = $value.
165
+	 *
166
+	 * @param $field
167
+	 * @param $value
168
+	 * @return mixed
169
+	 */
170
+	public function findBy($field, $value)
171
+	{
172
+		if (empty($this->ci->db) || ! is_object($this->ci->db))
173
+		{
174
+			return false;
175
+		}
176
+
177
+		$query = $this->ci->db->where($field, $value)
178
+							  ->get('settings');
179
+
180
+		if (! $query->num_rows())
181
+		{
182
+			return false;
183
+		}
184
+
185
+		return $query->result_array();
186
+	}
187
+
188
+	//--------------------------------------------------------------------
189
+
190
+	/**
191
+	 * Retrieves all items in the store either globally or for a single group.
192
+	 *
193
+	 * @param string $group
194
+	 * @return mixed
195
+	 */
196
+	public function all($group=null)
197
+	{
198
+		if (empty($this->ci->db) || ! is_object($this->ci->db))
199
+		{
200
+			return false;
201
+		}
202
+
203
+		$query = $this->ci->db->get('settings');
204
+
205
+		if (! $query->num_rows())
206
+		{
207
+			return false;
208
+		}
209
+
210
+		return $query->result_array();
211
+	}
212
+
213
+	//--------------------------------------------------------------------
214 214
 }
Please login to merge, or discard this patch.
myth/Settings/Settings.php 2 patches
Indentation   +277 added lines, -277 removed lines patch added patch discarded remove patch
@@ -1,34 +1,34 @@  discard block
 block discarded – undo
1 1
 <?php namespace Myth\Settings;
2 2
 /**
3
- * Sprint
4
- *
5
- * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in
15
- * all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- *
25
- * @package     Sprint
26
- * @author      Lonnie Ezell
27
- * @copyright   Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com)
28
- * @license     http://opensource.org/licenses/MIT  (MIT)
29
- * @link        http://sprintphp.com
30
- * @since       Version 1.0
31
- */
3
+	 * Sprint
4
+	 *
5
+	 * A set of power tools to enhance the CodeIgniter framework and provide consistent workflow.
6
+	 *
7
+	 * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+	 * of this software and associated documentation files (the "Software"), to deal
9
+	 * in the Software without restriction, including without limitation the rights
10
+	 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+	 * copies of the Software, and to permit persons to whom the Software is
12
+	 * furnished to do so, subject to the following conditions:
13
+	 *
14
+	 * The above copyright notice and this permission notice shall be included in
15
+	 * all copies or substantial portions of the Software.
16
+	 *
17
+	 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+	 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+	 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+	 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+	 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+	 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+	 * THE SOFTWARE.
24
+	 *
25
+	 * @package     Sprint
26
+	 * @author      Lonnie Ezell
27
+	 * @copyright   Copyright 2014-2015, New Myth Media, LLC (http://newmythmedia.com)
28
+	 * @license     http://opensource.org/licenses/MIT  (MIT)
29
+	 * @link        http://sprintphp.com
30
+	 * @since       Version 1.0
31
+	 */
32 32
 
33 33
 /**
34 34
  * Class Settings
@@ -40,253 +40,253 @@  discard block
 block discarded – undo
40 40
  */
41 41
 class Settings {
42 42
 
43
-    /**
44
-     * Holds instantiated data stores.
45
-     *
46
-     * @var array
47
-     */
48
-    protected static $stores = [];
49
-
50
-    protected static $default_store = '';
51
-
52
-    protected static $initialized = false;
53
-
54
-    //--------------------------------------------------------------------
55
-
56
-    /**
57
-     * Fires up instances of the datastores and gets us ready to roll.
58
-     */
59
-    public static function init()
60
-    {
61
-        if (self::$initialized === true)
62
-        {
63
-            return;
64
-        }
65
-
66
-        // Load up and instantiate our setting stores.
67
-        $user_stores = config_item('settings.stores');
68
-
69
-        if (is_array($user_stores))
70
-        {
71
-            foreach ($user_stores as $alias => $class)
72
-            {
73
-                self::$stores[ strtolower($alias) ] = new $class();
74
-            }
75
-        }
76
-
77
-        self::$default_store = config_item('settings.default_store');
78
-
79
-        if (empty(self::$stores[ self::$default_store ]))
80
-        {
81
-            show_error( lang('settings.bad_default') );
82
-        }
83
-    }
84
-
85
-    //--------------------------------------------------------------------
86
-
87
-    /**
88
-     * Inserts/Replaces a single setting item.
89
-     *
90
-     * @param $key
91
-     * @param null $value
92
-     * @param string $group
93
-     * @param string $store
94
-     */
95
-    public static function save($key, $value=null, $group='app', $store=null)
96
-    {
97
-        self::init();
98
-
99
-        if (empty($store) || empty(self::$stores[$store]))
100
-        {
101
-            // we've already determined that the default store exists
102
-            // in the init() method.
103
-            $store = self::$default_store;
104
-        }
105
-
106
-        return self::$stores[ $store ]->save($key, $value, $group);
107
-    }
108
-
109
-    //--------------------------------------------------------------------
110
-
111
-    /**
112
-     * Retrieves a single item. If not $store is specified, will loop
113
-     * through the stores in order until it finds it. If $store is
114
-     * specified, will only look within that store for it.
115
-     *
116
-     * @param $key
117
-     * @param string $group
118
-     * @param string $store
119
-     * @return mixed
120
-     */
121
-    public static function get($key, $group='app', $store=null)
122
-    {
123
-        self::init();
124
-
125
-        $group = strtolower($group);
126
-
127
-        // If the store is specified but doesn't exist, crap out
128
-        // so that they developer has a chance to fix it.
129
-        if (! is_null($store) && empty(self::$stores[$store]))
130
-        {
131
-            show_error( sprintf( lang('settings.cant_retrieve'), $store ) );
132
-        }
133
-
134
-        // If $store is set, get the value from that store only.
135
-        if (! empty($store))
136
-        {
137
-            return self::$stores[$store]->get($key, $group);
138
-        }
139
-
140
-        // Otherwise loop through each store until we find it
141
-        foreach (self::$stores as $s)
142
-        {
143
-            if ($found = $s->get($key, $group))
144
-            {
145
-                return $found;
146
-            }
147
-        }
148
-
149
-        // Still here... guess we didn't find anything, then...
150
-        return false;
151
-    }
152
-
153
-    //--------------------------------------------------------------------
154
-
155
-    /**
156
-     * Deletes a single item.
157
-     *
158
-     * @param $key
159
-     * @param $group
160
-     * @param $store
161
-     * @return mixed
162
-     */
163
-    public static function delete($key, $group='app', $store=null)
164
-    {
165
-        self::init();
166
-
167
-        $group = strtolower($group);
168
-
169
-        // If the store is specified but doesn't exist, crap out
170
-        // so that they developer has a chance to fix it.
171
-        if (! is_null($store) && empty(self::$stores[$store]))
172
-        {
173
-            show_error( sprintf( lang('settings.cant_retrieve'), $store ) );
174
-        }
175
-
176
-        // If $store is set, get the value from that store only.
177
-        if (! empty($store))
178
-        {
179
-            return self::$stores[$store]->delete($key, $group);
180
-        }
181
-
182
-        // Otherwise delete from the default store
183
-        return self::$stores[ self::$default_store ]->delete($key, $group);
184
-    }
185
-
186
-    //--------------------------------------------------------------------
187
-
188
-    /**
189
-     * Searches the store for any items with $field = $value.
190
-     *
191
-     * @param $field
192
-     * @param $value
193
-     * @return mixed
194
-     */
195
-    public static function findBy($field, $value)
196
-    {
197
-        self::init();
198
-
199
-        foreach (self::$stores as $s)
200
-        {
201
-            if ($found = $s->findBy($field, $value))
202
-            {
203
-                return $found;
204
-            }
205
-        }
206
-
207
-        return false;
208
-    }
209
-
210
-    //--------------------------------------------------------------------
211
-
212
-    /**
213
-     * Retrieves all items in the store either globally or for a single group.
214
-     *
215
-     * @param string $group
216
-     * @return mixed
217
-     */
218
-    public static function all($group=null, $store=null)
219
-    {
220
-        self::init();
221
-
222
-        $group = strtolower($group);
223
-
224
-        if (! empty($store))
225
-        {
226
-            return self::$stores[ $store ]->all($group);
227
-        }
228
-
229
-        // Otherwise combine the results from all stores
230
-        $results = [];
231
-
232
-        foreach (self::$stores as $s)
233
-        {
234
-            $found = $s->all($group);
235
-            if ($found)
236
-            {
237
-                $results = array_merge($results, (array)$found);
238
-            }
239
-        }
240
-
241
-        return $results;
242
-    }
243
-
244
-    //--------------------------------------------------------------------
245
-
246
-    /**
247
-     * Appends a new datastore the end of the curent stores.
248
-     *
249
-     * @param $alias
250
-     * @param $class
251
-     * @return bool
252
-     */
253
-    public static function addStore($alias, $class)
254
-    {
255
-        self::init();
256
-
257
-        if (class_exists($class))
258
-        {
259
-            self::$stores[ strtolower($alias) ] = new $class();
260
-            return true;
261
-        }
262
-
263
-        return false;
264
-    }
265
-
266
-    //--------------------------------------------------------------------
267
-
268
-    /**
269
-     * Removes a datastore from the list of stores currently available.
270
-     *
271
-     * @param $alias
272
-     * @return bool
273
-     */
274
-    public static function removeStore($alias)
275
-    {
276
-        self::init();
277
-
278
-        $alias = strtolower($alias);
279
-
280
-        if (empty(self::$stores[$alias]))
281
-        {
282
-            return false;
283
-        }
284
-
285
-        unset(self::$stores[$alias]);
286
-
287
-        return true;
288
-    }
289
-
290
-    //--------------------------------------------------------------------
43
+	/**
44
+	 * Holds instantiated data stores.
45
+	 *
46
+	 * @var array
47
+	 */
48
+	protected static $stores = [];
49
+
50
+	protected static $default_store = '';
51
+
52
+	protected static $initialized = false;
53
+
54
+	//--------------------------------------------------------------------
55
+
56
+	/**
57
+	 * Fires up instances of the datastores and gets us ready to roll.
58
+	 */
59
+	public static function init()
60
+	{
61
+		if (self::$initialized === true)
62
+		{
63
+			return;
64
+		}
65
+
66
+		// Load up and instantiate our setting stores.
67
+		$user_stores = config_item('settings.stores');
68
+
69
+		if (is_array($user_stores))
70
+		{
71
+			foreach ($user_stores as $alias => $class)
72
+			{
73
+				self::$stores[ strtolower($alias) ] = new $class();
74
+			}
75
+		}
76
+
77
+		self::$default_store = config_item('settings.default_store');
78
+
79
+		if (empty(self::$stores[ self::$default_store ]))
80
+		{
81
+			show_error( lang('settings.bad_default') );
82
+		}
83
+	}
84
+
85
+	//--------------------------------------------------------------------
86
+
87
+	/**
88
+	 * Inserts/Replaces a single setting item.
89
+	 *
90
+	 * @param $key
91
+	 * @param null $value
92
+	 * @param string $group
93
+	 * @param string $store
94
+	 */
95
+	public static function save($key, $value=null, $group='app', $store=null)
96
+	{
97
+		self::init();
98
+
99
+		if (empty($store) || empty(self::$stores[$store]))
100
+		{
101
+			// we've already determined that the default store exists
102
+			// in the init() method.
103
+			$store = self::$default_store;
104
+		}
105
+
106
+		return self::$stores[ $store ]->save($key, $value, $group);
107
+	}
108
+
109
+	//--------------------------------------------------------------------
110
+
111
+	/**
112
+	 * Retrieves a single item. If not $store is specified, will loop
113
+	 * through the stores in order until it finds it. If $store is
114
+	 * specified, will only look within that store for it.
115
+	 *
116
+	 * @param $key
117
+	 * @param string $group
118
+	 * @param string $store
119
+	 * @return mixed
120
+	 */
121
+	public static function get($key, $group='app', $store=null)
122
+	{
123
+		self::init();
124
+
125
+		$group = strtolower($group);
126
+
127
+		// If the store is specified but doesn't exist, crap out
128
+		// so that they developer has a chance to fix it.
129
+		if (! is_null($store) && empty(self::$stores[$store]))
130
+		{
131
+			show_error( sprintf( lang('settings.cant_retrieve'), $store ) );
132
+		}
133
+
134
+		// If $store is set, get the value from that store only.
135
+		if (! empty($store))
136
+		{
137
+			return self::$stores[$store]->get($key, $group);
138
+		}
139
+
140
+		// Otherwise loop through each store until we find it
141
+		foreach (self::$stores as $s)
142
+		{
143
+			if ($found = $s->get($key, $group))
144
+			{
145
+				return $found;
146
+			}
147
+		}
148
+
149
+		// Still here... guess we didn't find anything, then...
150
+		return false;
151
+	}
152
+
153
+	//--------------------------------------------------------------------
154
+
155
+	/**
156
+	 * Deletes a single item.
157
+	 *
158
+	 * @param $key
159
+	 * @param $group
160
+	 * @param $store
161
+	 * @return mixed
162
+	 */
163
+	public static function delete($key, $group='app', $store=null)
164
+	{
165
+		self::init();
166
+
167
+		$group = strtolower($group);
168
+
169
+		// If the store is specified but doesn't exist, crap out
170
+		// so that they developer has a chance to fix it.
171
+		if (! is_null($store) && empty(self::$stores[$store]))
172
+		{
173
+			show_error( sprintf( lang('settings.cant_retrieve'), $store ) );
174
+		}
175
+
176
+		// If $store is set, get the value from that store only.
177
+		if (! empty($store))
178
+		{
179
+			return self::$stores[$store]->delete($key, $group);
180
+		}
181
+
182
+		// Otherwise delete from the default store
183
+		return self::$stores[ self::$default_store ]->delete($key, $group);
184
+	}
185
+
186
+	//--------------------------------------------------------------------
187
+
188
+	/**
189
+	 * Searches the store for any items with $field = $value.
190
+	 *
191
+	 * @param $field
192
+	 * @param $value
193
+	 * @return mixed
194
+	 */
195
+	public static function findBy($field, $value)
196
+	{
197
+		self::init();
198
+
199
+		foreach (self::$stores as $s)
200
+		{
201
+			if ($found = $s->findBy($field, $value))
202
+			{
203
+				return $found;
204
+			}
205
+		}
206
+
207
+		return false;
208
+	}
209
+
210
+	//--------------------------------------------------------------------
211
+
212
+	/**
213
+	 * Retrieves all items in the store either globally or for a single group.
214
+	 *
215
+	 * @param string $group
216
+	 * @return mixed
217
+	 */
218
+	public static function all($group=null, $store=null)
219
+	{
220
+		self::init();
221
+
222
+		$group = strtolower($group);
223
+
224
+		if (! empty($store))
225
+		{
226
+			return self::$stores[ $store ]->all($group);
227
+		}
228
+
229
+		// Otherwise combine the results from all stores
230
+		$results = [];
231
+
232
+		foreach (self::$stores as $s)
233
+		{
234
+			$found = $s->all($group);
235
+			if ($found)
236
+			{
237
+				$results = array_merge($results, (array)$found);
238
+			}
239
+		}
240
+
241
+		return $results;
242
+	}
243
+
244
+	//--------------------------------------------------------------------
245
+
246
+	/**
247
+	 * Appends a new datastore the end of the curent stores.
248
+	 *
249
+	 * @param $alias
250
+	 * @param $class
251
+	 * @return bool
252
+	 */
253
+	public static function addStore($alias, $class)
254
+	{
255
+		self::init();
256
+
257
+		if (class_exists($class))
258
+		{
259
+			self::$stores[ strtolower($alias) ] = new $class();
260
+			return true;
261
+		}
262
+
263
+		return false;
264
+	}
265
+
266
+	//--------------------------------------------------------------------
267
+
268
+	/**
269
+	 * Removes a datastore from the list of stores currently available.
270
+	 *
271
+	 * @param $alias
272
+	 * @return bool
273
+	 */
274
+	public static function removeStore($alias)
275
+	{
276
+		self::init();
277
+
278
+		$alias = strtolower($alias);
279
+
280
+		if (empty(self::$stores[$alias]))
281
+		{
282
+			return false;
283
+		}
284
+
285
+		unset(self::$stores[$alias]);
286
+
287
+		return true;
288
+	}
289
+
290
+	//--------------------------------------------------------------------
291 291
 
292 292
 }
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -70,15 +70,15 @@  discard block
 block discarded – undo
70 70
         {
71 71
             foreach ($user_stores as $alias => $class)
72 72
             {
73
-                self::$stores[ strtolower($alias) ] = new $class();
73
+                self::$stores[strtolower($alias)] = new $class();
74 74
             }
75 75
         }
76 76
 
77 77
         self::$default_store = config_item('settings.default_store');
78 78
 
79
-        if (empty(self::$stores[ self::$default_store ]))
79
+        if (empty(self::$stores[self::$default_store]))
80 80
         {
81
-            show_error( lang('settings.bad_default') );
81
+            show_error(lang('settings.bad_default'));
82 82
         }
83 83
     }
84 84
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      * @param string $group
93 93
      * @param string $store
94 94
      */
95
-    public static function save($key, $value=null, $group='app', $store=null)
95
+    public static function save($key, $value = null, $group = 'app', $store = null)
96 96
     {
97 97
         self::init();
98 98
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $store = self::$default_store;
104 104
         }
105 105
 
106
-        return self::$stores[ $store ]->save($key, $value, $group);
106
+        return self::$stores[$store]->save($key, $value, $group);
107 107
     }
108 108
 
109 109
     //--------------------------------------------------------------------
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      * @param string $store
119 119
      * @return mixed
120 120
      */
121
-    public static function get($key, $group='app', $store=null)
121
+    public static function get($key, $group = 'app', $store = null)
122 122
     {
123 123
         self::init();
124 124
 
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
 
127 127
         // If the store is specified but doesn't exist, crap out
128 128
         // so that they developer has a chance to fix it.
129
-        if (! is_null($store) && empty(self::$stores[$store]))
129
+        if ( ! is_null($store) && empty(self::$stores[$store]))
130 130
         {
131
-            show_error( sprintf( lang('settings.cant_retrieve'), $store ) );
131
+            show_error(sprintf(lang('settings.cant_retrieve'), $store));
132 132
         }
133 133
 
134 134
         // If $store is set, get the value from that store only.
135
-        if (! empty($store))
135
+        if ( ! empty($store))
136 136
         {
137 137
             return self::$stores[$store]->get($key, $group);
138 138
         }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param $store
161 161
      * @return mixed
162 162
      */
163
-    public static function delete($key, $group='app', $store=null)
163
+    public static function delete($key, $group = 'app', $store = null)
164 164
     {
165 165
         self::init();
166 166
 
@@ -168,19 +168,19 @@  discard block
 block discarded – undo
168 168
 
169 169
         // If the store is specified but doesn't exist, crap out
170 170
         // so that they developer has a chance to fix it.
171
-        if (! is_null($store) && empty(self::$stores[$store]))
171
+        if ( ! is_null($store) && empty(self::$stores[$store]))
172 172
         {
173
-            show_error( sprintf( lang('settings.cant_retrieve'), $store ) );
173
+            show_error(sprintf(lang('settings.cant_retrieve'), $store));
174 174
         }
175 175
 
176 176
         // If $store is set, get the value from that store only.
177
-        if (! empty($store))
177
+        if ( ! empty($store))
178 178
         {
179 179
             return self::$stores[$store]->delete($key, $group);
180 180
         }
181 181
 
182 182
         // Otherwise delete from the default store
183
-        return self::$stores[ self::$default_store ]->delete($key, $group);
183
+        return self::$stores[self::$default_store]->delete($key, $group);
184 184
     }
185 185
 
186 186
     //--------------------------------------------------------------------
@@ -215,15 +215,15 @@  discard block
 block discarded – undo
215 215
      * @param string $group
216 216
      * @return mixed
217 217
      */
218
-    public static function all($group=null, $store=null)
218
+    public static function all($group = null, $store = null)
219 219
     {
220 220
         self::init();
221 221
 
222 222
         $group = strtolower($group);
223 223
 
224
-        if (! empty($store))
224
+        if ( ! empty($store))
225 225
         {
226
-            return self::$stores[ $store ]->all($group);
226
+            return self::$stores[$store]->all($group);
227 227
         }
228 228
 
229 229
         // Otherwise combine the results from all stores
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
             $found = $s->all($group);
235 235
             if ($found)
236 236
             {
237
-                $results = array_merge($results, (array)$found);
237
+                $results = array_merge($results, (array) $found);
238 238
             }
239 239
         }
240 240
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         if (class_exists($class))
258 258
         {
259
-            self::$stores[ strtolower($alias) ] = new $class();
259
+            self::$stores[strtolower($alias)] = new $class();
260 260
             return true;
261 261
         }
262 262
 
Please login to merge, or discard this patch.