Completed
Push — master ( 67df75...25777a )
by Jacob
09:40 queued 05:17
created
controller/home/HomeController.class.inc.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
 
44 44
 	private function get_recent_posts()
45 45
 	{
46
-    global $container;
47
-    $postRepository = new MysqlPostRepository($container['db_connection_locator']);
48
-    $recentPosts = $postRepository->getActivePosts(3);
46
+	global $container;
47
+	$postRepository = new MysqlPostRepository($container['db_connection_locator']);
48
+	$recentPosts = $postRepository->getActivePosts(3);
49 49
 
50 50
 		$recent_post_array = array();
51 51
 		foreach($recentPosts as $postResult)
Please login to merge, or discard this patch.
utility/Debugger.class.inc.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 	private function __construct()
19 19
 	{
20 20
 		$this->console = new Console();
21
-    $this->profiler = new PhpQuickProfiler();
22
-    $this->profiler->setConsole($this->console);
21
+	$this->profiler = new PhpQuickProfiler();
22
+	$this->profiler->setConsole($this->console);
23 23
 	}
24 24
 
25 25
 	public static function instance()
@@ -82,29 +82,29 @@  discard block
 block discarded – undo
82 82
 
83 83
 	public static function display()
84 84
 	{
85
-    if ($_COOKIE['debugger'] == 'display' && self::instance()->display) {
86
-      $pdo = '';
87
-      global $container;
88
-      if (!empty($container) && !empty($container['db_connection_locator'])) {
89
-        $pdo = $container['db_connection_locator']->getRead();
90
-      }
91
-      if (!empty($pdo)) {
92
-        $profiles = $pdo->getProfiler()->getProfiles();
93
-        $profiles = array_filter($profiles, function ($profile) {
94
-            return $profile['function'] == 'perform';
95
-        });
96
-        $profiles = array_map(function ($profile) {
97
-            return array(
98
-                'sql' => trim(preg_replace('/\s+/', ' ', $profile['statement'])),
99
-                'parameters' => $profile['bind_values'],
100
-                'time' => $profile['duration']
101
-            );
102
-        }, $profiles);
103
-        self::instance()->profiler->setProfiledQueries($profiles);
104
-      }
105
-      self::instance()->profiler->setDisplay(new Particletree\Pqp\Display());
106
-      self::instance()->profiler->display($pdo);
107
-    }
85
+	if ($_COOKIE['debugger'] == 'display' && self::instance()->display) {
86
+	  $pdo = '';
87
+	  global $container;
88
+	  if (!empty($container) && !empty($container['db_connection_locator'])) {
89
+		$pdo = $container['db_connection_locator']->getRead();
90
+	  }
91
+	  if (!empty($pdo)) {
92
+		$profiles = $pdo->getProfiler()->getProfiles();
93
+		$profiles = array_filter($profiles, function ($profile) {
94
+			return $profile['function'] == 'perform';
95
+		});
96
+		$profiles = array_map(function ($profile) {
97
+			return array(
98
+				'sql' => trim(preg_replace('/\s+/', ' ', $profile['statement'])),
99
+				'parameters' => $profile['bind_values'],
100
+				'time' => $profile['duration']
101
+			);
102
+		}, $profiles);
103
+		self::instance()->profiler->setProfiledQueries($profiles);
104
+	  }
105
+	  self::instance()->profiler->setDisplay(new Particletree\Pqp\Display());
106
+	  self::instance()->profiler->display($pdo);
107
+	}
108 108
 	}
109 109
 
110 110
 }
Please login to merge, or discard this patch.
router/WaterfallRouter.class.inc.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 Loader::load('collector', array(
4
-    'waterfall/LogCollector',
5
-    'waterfall/WaterfallCollector'));
4
+	'waterfall/LogCollector',
5
+	'waterfall/WaterfallCollector'));
6 6
 Loader::load('router', 'Router');
7 7
 
8 8
 class WaterfallRouter extends Router
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
 			(object) array(
27 27
 				'pattern' => '@^/falls/results(/?)$@',
28 28
 				'replace' => '/falls/'),
29
-            (object) array(
30
-                'pattern' => '@^/log(/?)$@',
31
-                'replace' => '/journal/'),
32
-            (object) array(
33
-                'pattern' => '@^/log/(\d+)(/?)$@',
34
-                'replace' => '/journal/$1'),
35
-            (object) array(
36
-                'pattern' => '@^/map/([^/]+)(/?)$@',
37
-                'replace' => '/map/'),
29
+			(object) array(
30
+				'pattern' => '@^/log(/?)$@',
31
+				'replace' => '/journal/'),
32
+			(object) array(
33
+				'pattern' => '@^/log/(\d+)(/?)$@',
34
+				'replace' => '/journal/$1'),
35
+			(object) array(
36
+				'pattern' => '@^/map/([^/]+)(/?)$@',
37
+				'replace' => '/map/'),
38 38
 			(object) array(
39 39
 				'pattern' => '@^/about/([a-z]*)(/?)$@',
40 40
 				'replace' => '/about/'),
@@ -73,57 +73,57 @@  discard block
 block discarded – undo
73 73
 
74 74
 	protected function check_for_special_redirect($uri)
75 75
 	{
76
-        if (preg_match('@^/falls/([a-z\'-]+)(/?)$@', $uri, $matches)) {
77
-            $alias = $matches[1];
78
-            $alias = str_replace("'", '', $alias);
79
-            $alias .= '-falls';
80
-            $result = WaterfallCollector::getByOldAlias($alias);
81
-            if ($result !== null) {
82
-                return "/{$result->watercourse_alias}/{$result->alias}/";
83
-            } else {
84
-                Loader::loadNew('controller', '/Error404Controller')->activate();
85
-            }
86
-        }
76
+		if (preg_match('@^/falls/([a-z\'-]+)(/?)$@', $uri, $matches)) {
77
+			$alias = $matches[1];
78
+			$alias = str_replace("'", '', $alias);
79
+			$alias .= '-falls';
80
+			$result = WaterfallCollector::getByOldAlias($alias);
81
+			if ($result !== null) {
82
+				return "/{$result->watercourse_alias}/{$result->alias}/";
83
+			} else {
84
+				Loader::loadNew('controller', '/Error404Controller')->activate();
85
+			}
86
+		}
87 87
         
88
-        if (preg_match('@^/photos/([a-z\'-]+)-([^/]+)(/?)$@', $uri, $matches)) {
89
-            $alias = $matches[1];
90
-            $alias = explode('-', $alias);
91
-            array_pop($alias);
92
-            $alias = implode('-', $alias);
93
-            $alias = str_replace("'", '', $alias);
94
-            $alias .= '-falls';
95
-            $result = WaterfallCollector::getByOldAlias($alias);
96
-            if ($result !== null) {
97
-                return "/{$result->watercourse_alias}/{$result->alias}/";
98
-            } else {
99
-                Loader::loadNew('controller', '/Error404Controller')->activate();
100
-            }
101
-        }
88
+		if (preg_match('@^/photos/([a-z\'-]+)-([^/]+)(/?)$@', $uri, $matches)) {
89
+			$alias = $matches[1];
90
+			$alias = explode('-', $alias);
91
+			array_pop($alias);
92
+			$alias = implode('-', $alias);
93
+			$alias = str_replace("'", '', $alias);
94
+			$alias .= '-falls';
95
+			$result = WaterfallCollector::getByOldAlias($alias);
96
+			if ($result !== null) {
97
+				return "/{$result->watercourse_alias}/{$result->alias}/";
98
+			} else {
99
+				Loader::loadNew('controller', '/Error404Controller')->activate();
100
+			}
101
+		}
102 102
         
103
-        if (preg_match('@/log/([a-z]+-\d{2}-\d{4})(/?)$@', $uri, $matches)) {
104
-            $date = $matches[1];
105
-            $date = explode('-', $date);
106
-            $date = mktime(0, 0, 0, date('n', strtotime($date[0])), $date[1], $date[2]);
107
-            $date = date('Y-m-d', $date);
108
-            $result = LogCollector::getByDate($date);
109
-            if ($result !== null) {
110
-                return "/journal/{$result->alias}/";
111
-            } else {
112
-                Loader::loadNew('controller', '/Error404Controller')->activate();
113
-            }
114
-        }
103
+		if (preg_match('@/log/([a-z]+-\d{2}-\d{4})(/?)$@', $uri, $matches)) {
104
+			$date = $matches[1];
105
+			$date = explode('-', $date);
106
+			$date = mktime(0, 0, 0, date('n', strtotime($date[0])), $date[1], $date[2]);
107
+			$date = date('Y-m-d', $date);
108
+			$result = LogCollector::getByDate($date);
109
+			if ($result !== null) {
110
+				return "/journal/{$result->alias}/";
111
+			} else {
112
+				Loader::loadNew('controller', '/Error404Controller')->activate();
113
+			}
114
+		}
115 115
         
116
-        if (preg_match('@/map/([a-z\'-]+)(/?)$@', $uri, $matches)) {
117
-            $alias = $matches[1];
118
-            $alias = str_replace("'", '', $alias);
119
-            $alias .= '-falls';
120
-            $result = WaterfallCollector::getByOldAlias($alias);
121
-            if ($result !== null) {
122
-                return "/map/#{$result->watercourse_alias}/{$result->alias}";
123
-            } else {
124
-                Loader::loadNew('controller', '/Error404Controller')->activate();
125
-            }
126
-        }
116
+		if (preg_match('@/map/([a-z\'-]+)(/?)$@', $uri, $matches)) {
117
+			$alias = $matches[1];
118
+			$alias = str_replace("'", '', $alias);
119
+			$alias .= '-falls';
120
+			$result = WaterfallCollector::getByOldAlias($alias);
121
+			if ($result !== null) {
122
+				return "/map/#{$result->watercourse_alias}/{$result->alias}";
123
+			} else {
124
+				Loader::loadNew('controller', '/Error404Controller')->activate();
125
+			}
126
+		}
127 127
         
128 128
 		return $uri;
129 129
 	}
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 			(object) array(
165 165
 				'match' => '/map/',
166 166
 				'controller' => 'MapController'),
167
-            (object) array(
168
-                'match' => '/map/#[a-z-/]+',
169
-                'controller' => 'MapController'),
167
+			(object) array(
168
+				'match' => '/map/#[a-z-/]+',
169
+				'controller' => 'MapController'),
170 170
 			(object) array(
171 171
 				'match' => '/journal/',
172 172
 				'controller' => 'LogListController'),
Please login to merge, or discard this patch.
router/Router.class.inc.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 		if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/')
97 97
 			$redirect_uri .= '/';
98 98
 		
99
-        if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') {
100
-            $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri;
101
-        }
99
+		if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') {
100
+			$redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri;
101
+		}
102 102
         
103 103
 		if($redirect_uri == URLDecode::getURI())
104 104
 			return;
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
 			}
130 130
 
131 131
 			$image = new ImageOld($file);
132
-        	        if(!$image->isValid()) {
133
-                	        Loader::loadNew('controller', '/Error404Controller')->activate();
132
+					if(!$image->isValid()) {
133
+							Loader::loadNew('controller', '/Error404Controller')->activate();
134 134
 				exit();
135 135
 			}
136 136
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			URLDecode::getExtension() != 'jpg' &&
202 202
 			URLDecode::getExtension() != 'png' &&
203 203
 			URLDecode::getExtension() != 'ico' &&
204
-            strstr(URLDecode::getURI(), '#') === false);
204
+			strstr(URLDecode::getURI(), '#') === false);
205 205
 	}
206 206
 
207 207
 }
Please login to merge, or discard this patch.
router/SitemapRouter.class.inc.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@
 block discarded – undo
16 16
 	protected function get_direct_array()
17 17
 	{
18 18
 		$site = URLDecode::getSite();
19
-        if ($site == 'waterfalls') {
20
-            $site = 'waterfall';
21
-        }
19
+		if ($site == 'waterfalls') {
20
+			$site = 'waterfall';
21
+		}
22 22
 		$site = ucwords($site);
23 23
 		
24 24
 		return array(
Please login to merge, or discard this patch.
collector/comment/CommentCollector.class.inc.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 		return self::run_query($query);
115 115
 	}
116 116
 
117
-    public static function getRecentWaterfallComments($count = 5)
118
-    {
119
-        $query = "
117
+	public static function getRecentWaterfallComments($count = 5)
118
+	{
119
+		$query = "
120 120
             SELECT
121 121
                 `comment_meta`.`id`,
122 122
                 CONCAT('journal/', `log`.`alias`) AS `log_path`,
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
                 `comment_meta`.`date` DESC
157 157
             LIMIT {$count}";
158 158
         
159
-        return self::run_query($query);
160
-    }
159
+		return self::run_query($query);
160
+	}
161 161
 
162 162
 	public static function getCommentsForURL($site, $path, $commenter = 0)
163 163
 	{
Please login to merge, or discard this patch.
collector/waterfall/WaterfallCollector.class.inc.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 		return self::run_query($query);
44 44
 	}
45 45
 
46
-    public static function getMapList()
47
-    {
48
-        $query = "
46
+	public static function getMapList()
47
+	{
48
+		$query = "
49 49
             SELECT
50 50
                 `waterfall`.`name`,
51 51
                 `waterfall`.`alias`,
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
             ORDER BY
72 72
                 `waterfall`.`name`";
73 73
         
74
-        return self::run_query($query);
75
-    }
74
+		return self::run_query($query);
75
+	}
76 76
 
77 77
 	public static function getListCount()
78 78
 	{
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 		return self::get_count($query);
93 93
 	}
94 94
 
95
-    public static function getNearbyList($waterfall)
96
-    {
97
-        $query = "
95
+	public static function getNearbyList($waterfall)
96
+	{
97
+		$query = "
98 98
             SELECT
99 99
                 `waterfall`.`name`,
100 100
                 `waterfall`.`alias` AS `alias`,
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
                 `waterfall`.`name`,
115 115
                 `watercourse`.`name`";
116 116
         
117
-        return self::run_query($query);
118
-    }
117
+		return self::run_query($query);
118
+	}
119 119
 
120
-    public static function getByOldAlias($alias)
121
-    {
122
-        $alias = self::escape($alias);
120
+	public static function getByOldAlias($alias)
121
+	{
122
+		$alias = self::escape($alias);
123 123
         
124
-        $query = "
124
+		$query = "
125 125
             SELECT
126 126
                 `waterfall`.`alias`,
127 127
                 `watercourse`.`alias` AS `watercourse_alias`
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
                 `waterfall`.`is_public` = '1'
135 135
             LIMIT 1";
136 136
         
137
-        return self::run_row_query($query);
138
-    }
137
+		return self::run_row_query($query);
138
+	}
139 139
 
140 140
 	public static function getByAlias($watercourse, $waterfall)
141 141
 	{
Please login to merge, or discard this patch.
collector/waterfall/LogCollector.class.inc.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 		return self::run_query($query);
35 35
 	}
36 36
 
37
-    public static function getRecentList($total)
38
-    {
39
-        $query = "
37
+	public static function getRecentList($total)
38
+	{
39
+		$query = "
40 40
             SELECT
41 41
                 `log`.`title`,
42 42
                 `log`.`alias`,
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
                 `log`.`date` DESC
60 60
             LIMIT
61 61
                 {$total}";
62
-        return self::run_query($query);
63
-    }
62
+		return self::run_query($query);
63
+	}
64 64
 
65 65
 	public static function getListCount()
66 66
 	{
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 		return self::run_row_query($query);
179 179
 	}
180 180
 
181
-    public static function getByDate($date)
182
-    {
183
-        $date = self::escape($date);
181
+	public static function getByDate($date)
182
+	{
183
+		$date = self::escape($date);
184 184
         
185
-        $query = "
185
+		$query = "
186 186
             SELECT
187 187
                 `log`.`alias`
188 188
             FROM
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
                 `log`.`is_public` = '1'
193 193
             LIMIT 1";
194 194
         
195
-        return self::run_row_query($query);
196
-    }
195
+		return self::run_row_query($query);
196
+	}
197 197
 	
198 198
 	public static function getById($log)
199 199
 	{
Please login to merge, or discard this patch.
collector/waterfall/WatercourseCollector.class.inc.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -153,9 +153,9 @@
 block discarded – undo
153 153
 		return self::run_query($query);
154 154
 	}
155 155
 
156
-    public static function getParentWatercourse($watercourse)
157
-    {
158
-    }
156
+	public static function getParentWatercourse($watercourse)
157
+	{
158
+	}
159 159
 
160 160
 	public static function getLogCountForWatercourse($watercourse)
161 161
 	{
Please login to merge, or discard this patch.