@@ -16,17 +16,17 @@ discard block |
||
16 | 16 | |
17 | 17 | private function __construct($write_params, $read_params) |
18 | 18 | { |
19 | - $this->write_connection = $this->connect( |
|
20 | - $write_params->host, |
|
21 | - $write_params->user, |
|
22 | - $write_params->password |
|
23 | - ); |
|
24 | - |
|
25 | - $this->read_connection = $this->connect( |
|
26 | - $read_params->host, |
|
27 | - $read_params->user, |
|
28 | - $read_params->password |
|
29 | - ); |
|
19 | + $this->write_connection = $this->connect( |
|
20 | + $write_params->host, |
|
21 | + $write_params->user, |
|
22 | + $write_params->password |
|
23 | + ); |
|
24 | + |
|
25 | + $this->read_connection = $this->connect( |
|
26 | + $read_params->host, |
|
27 | + $read_params->user, |
|
28 | + $read_params->password |
|
29 | + ); |
|
30 | 30 | |
31 | 31 | return $this; |
32 | 32 | } |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | public static function instance() |
46 | 46 | { |
47 | 47 | if(!isset(self::$instance)) { |
48 | - global $config; |
|
49 | - self::$instance = new Database( |
|
50 | - $config->database->master, |
|
51 | - $config->database->slave |
|
52 | - ); |
|
53 | - } |
|
48 | + global $config; |
|
49 | + self::$instance = new Database( |
|
50 | + $config->database->master, |
|
51 | + $config->database->slave |
|
52 | + ); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | return self::$instance; |
56 | 56 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $mysqli = new mysqli($host, $username, $password); |
37 | 37 | |
38 | 38 | $has_connection_error = $mysqli->connect_error; |
39 | - if(isset($has_connection_error)) |
|
39 | + if (isset($has_connection_error)) |
|
40 | 40 | $this->has_connection_error = true; |
41 | 41 | |
42 | 42 | return $mysqli; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public static function instance() |
46 | 46 | { |
47 | - if(!isset(self::$instance)) { |
|
47 | + if (!isset(self::$instance)) { |
|
48 | 48 | global $config; |
49 | 49 | self::$instance = new Database( |
50 | 50 | $config->database->master, |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | public static function select($query) |
64 | 64 | { |
65 | 65 | $start = microtime(true); |
66 | - if($result = self::instance()->read_connection->query($query)) |
|
66 | + if ($result = self::instance()->read_connection->query($query)) |
|
67 | 67 | { |
68 | 68 | self::instance()->log_query($query, $start); |
69 | 69 | $array = array(); |
70 | - while($row = $result->fetch_object()) |
|
70 | + while ($row = $result->fetch_object()) |
|
71 | 71 | $array[] = $row; |
72 | 72 | $result->close(); |
73 | 73 | return $array; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public static function selectRow($query) |
80 | 80 | { |
81 | 81 | $result = self::select($query); |
82 | - if(is_array($result)) |
|
82 | + if (is_array($result)) |
|
83 | 83 | return array_pop($result); |
84 | 84 | return false; |
85 | 85 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public static function execute($query) |
88 | 88 | { |
89 | 89 | $start = microtime(true); |
90 | - if(self::instance()->write_connection->query($query)) |
|
90 | + if (self::instance()->write_connection->query($query)) |
|
91 | 91 | { |
92 | 92 | self::instance()->log_query($query, $start); |
93 | 93 | return true; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public static function lastInsertID() |
100 | 100 | { |
101 | 101 | $id = self::instance()->write_connection->insert_id; |
102 | - if($id == 0) |
|
102 | + if ($id == 0) |
|
103 | 103 | return false; |
104 | 104 | return $id; |
105 | 105 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | private function gather_query_data() |
120 | 120 | { |
121 | 121 | $query_data = array(); |
122 | - foreach($this->query_log as $query) |
|
122 | + foreach ($this->query_log as $query) |
|
123 | 123 | { |
124 | 124 | $query = self::explain($query); |
125 | 125 | $query_data[] = $query; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | $sql = 'EXPLAIN ' . $query['sql']; |
133 | 133 | |
134 | - if($result = self::instance()->read_connection->query($sql)) |
|
134 | + if ($result = self::instance()->read_connection->query($sql)) |
|
135 | 135 | { |
136 | 136 | $row = $result->fetch_assoc(); |
137 | 137 | $query['explain'] = $row; |
@@ -36,8 +36,9 @@ discard block |
||
36 | 36 | $mysqli = new mysqli($host, $username, $password); |
37 | 37 | |
38 | 38 | $has_connection_error = $mysqli->connect_error; |
39 | - if(isset($has_connection_error)) |
|
40 | - $this->has_connection_error = true; |
|
39 | + if(isset($has_connection_error)) { |
|
40 | + $this->has_connection_error = true; |
|
41 | + } |
|
41 | 42 | |
42 | 43 | return $mysqli; |
43 | 44 | } |
@@ -67,8 +68,9 @@ discard block |
||
67 | 68 | { |
68 | 69 | self::instance()->log_query($query, $start); |
69 | 70 | $array = array(); |
70 | - while($row = $result->fetch_object()) |
|
71 | - $array[] = $row; |
|
71 | + while($row = $result->fetch_object()) { |
|
72 | + $array[] = $row; |
|
73 | + } |
|
72 | 74 | $result->close(); |
73 | 75 | return $array; |
74 | 76 | } |
@@ -79,8 +81,9 @@ discard block |
||
79 | 81 | public static function selectRow($query) |
80 | 82 | { |
81 | 83 | $result = self::select($query); |
82 | - if(is_array($result)) |
|
83 | - return array_pop($result); |
|
84 | + if(is_array($result)) { |
|
85 | + return array_pop($result); |
|
86 | + } |
|
84 | 87 | return false; |
85 | 88 | } |
86 | 89 | |
@@ -99,8 +102,9 @@ discard block |
||
99 | 102 | public static function lastInsertID() |
100 | 103 | { |
101 | 104 | $id = self::instance()->write_connection->insert_id; |
102 | - if($id == 0) |
|
103 | - return false; |
|
105 | + if($id == 0) { |
|
106 | + return false; |
|
107 | + } |
|
104 | 108 | return $id; |
105 | 109 | } |
106 | 110 |
@@ -84,6 +84,9 @@ |
||
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
87 | + /** |
|
88 | + * @param string $query |
|
89 | + */ |
|
87 | 90 | public static function execute($query) |
88 | 91 | { |
89 | 92 | $start = microtime(true); |
@@ -22,10 +22,10 @@ |
||
22 | 22 | |
23 | 23 | protected function getDomain() |
24 | 24 | { |
25 | - $site = URLDecode::getSite(); |
|
26 | - if ($site == 'waterfalls' && Loader::isLive()) { |
|
27 | - return 'waterfallsofthekeweenaw.com'; |
|
28 | - } |
|
25 | + $site = URLDecode::getSite(); |
|
26 | + if ($site == 'waterfalls' && Loader::isLive()) { |
|
27 | + return 'waterfallsofthekeweenaw.com'; |
|
28 | + } |
|
29 | 29 | return self::$COOKIE_DOMAIN; |
30 | 30 | } |
31 | 31 |
@@ -6,8 +6,8 @@ |
||
6 | 6 | { |
7 | 7 | |
8 | 8 | private static $COOKIE_NAME = 'commenter'; |
9 | - private static $COOKIE_DURATION = 31536000; // one year |
|
10 | - private static $COOKIE_DOMAIN = 'jacobemerick.com'; |
|
9 | + private static $COOKIE_DURATION = 31536000; // one year |
|
10 | + private static $COOKIE_DOMAIN = 'jacobemerick.com'; |
|
11 | 11 | private static $COOKIE_PATH = '/'; |
12 | 12 | |
13 | 13 | protected function getName() |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | static private function form_url_array($host, $uri) |
16 | 16 | { |
17 | 17 | $uri = substr($uri, 1); |
18 | - if(strpos($uri, '?')) |
|
18 | + if (strpos($uri, '?')) |
|
19 | 19 | $uri = substr($uri, 0, strpos($uri, '?')); |
20 | 20 | $uri_array = explode('/', $uri); |
21 | 21 | |
22 | - if(!Loader::isLive()) |
|
22 | + if (!Loader::isLive()) |
|
23 | 23 | $host = substr($host, strpos($host, '.') + 1); |
24 | 24 | |
25 | 25 | self::$array['host'] = $host; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | self::$array['base'] = 'http://' . (!Loader::isLive() ? 'dev.' : '') . $host . '/'; |
34 | 34 | self::$array['uri'] = '/' . implode('/', $uri_array); |
35 | 35 | |
36 | - if(end($uri_array) == '') |
|
36 | + if (end($uri_array) == '') |
|
37 | 37 | $uri_array = array_slice($uri_array, 0, count($uri_array) - 1); |
38 | 38 | self::$array['pieces'] = (array) $uri_array; |
39 | 39 | } |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | static function getExtension() |
62 | 62 | { |
63 | 63 | $file = self::getPiece(-1); |
64 | - if(substr($file, -1) == '/') |
|
64 | + if (substr($file, -1) == '/') |
|
65 | 65 | return false; |
66 | - return substr($file, strrpos($file, '.') + 1);; |
|
66 | + return substr($file, strrpos($file, '.') + 1); ; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | static function getPiece($piece = null) |
70 | 70 | { |
71 | - if(!$piece) |
|
71 | + if (!$piece) |
|
72 | 72 | return self::$array['pieces']; |
73 | 73 | |
74 | - if($piece == -1) |
|
74 | + if ($piece == -1) |
|
75 | 75 | return end(self::$array['pieces']); |
76 | 76 | |
77 | 77 | $piece = $piece - 1; |
78 | - if(array_key_exists($piece, self::$array['pieces'])) |
|
78 | + if (array_key_exists($piece, self::$array['pieces'])) |
|
79 | 79 | return self::$array['pieces'][$piece]; |
80 | 80 | return; |
81 | 81 | } |
@@ -15,12 +15,14 @@ discard block |
||
15 | 15 | static private function form_url_array($host, $uri) |
16 | 16 | { |
17 | 17 | $uri = substr($uri, 1); |
18 | - if(strpos($uri, '?')) |
|
19 | - $uri = substr($uri, 0, strpos($uri, '?')); |
|
18 | + if(strpos($uri, '?')) { |
|
19 | + $uri = substr($uri, 0, strpos($uri, '?')); |
|
20 | + } |
|
20 | 21 | $uri_array = explode('/', $uri); |
21 | 22 | |
22 | - if(!Loader::isLive()) |
|
23 | - $host = substr($host, strpos($host, '.') + 1); |
|
23 | + if(!Loader::isLive()) { |
|
24 | + $host = substr($host, strpos($host, '.') + 1); |
|
25 | + } |
|
24 | 26 | |
25 | 27 | self::$array['host'] = $host; |
26 | 28 | |
@@ -33,8 +35,9 @@ discard block |
||
33 | 35 | self::$array['base'] = 'http://' . (!Loader::isLive() ? 'dev.' : '') . $host . '/'; |
34 | 36 | self::$array['uri'] = '/' . implode('/', $uri_array); |
35 | 37 | |
36 | - if(end($uri_array) == '') |
|
37 | - $uri_array = array_slice($uri_array, 0, count($uri_array) - 1); |
|
38 | + if(end($uri_array) == '') { |
|
39 | + $uri_array = array_slice($uri_array, 0, count($uri_array) - 1); |
|
40 | + } |
|
38 | 41 | self::$array['pieces'] = (array) $uri_array; |
39 | 42 | } |
40 | 43 | |
@@ -61,22 +64,26 @@ discard block |
||
61 | 64 | static function getExtension() |
62 | 65 | { |
63 | 66 | $file = self::getPiece(-1); |
64 | - if(substr($file, -1) == '/') |
|
65 | - return false; |
|
67 | + if(substr($file, -1) == '/') { |
|
68 | + return false; |
|
69 | + } |
|
66 | 70 | return substr($file, strrpos($file, '.') + 1);; |
67 | 71 | } |
68 | 72 | |
69 | 73 | static function getPiece($piece = null) |
70 | 74 | { |
71 | - if(!$piece) |
|
72 | - return self::$array['pieces']; |
|
75 | + if(!$piece) { |
|
76 | + return self::$array['pieces']; |
|
77 | + } |
|
73 | 78 | |
74 | - if($piece == -1) |
|
75 | - return end(self::$array['pieces']); |
|
79 | + if($piece == -1) { |
|
80 | + return end(self::$array['pieces']); |
|
81 | + } |
|
76 | 82 | |
77 | 83 | $piece = $piece - 1; |
78 | - if(array_key_exists($piece, self::$array['pieces'])) |
|
79 | - return self::$array['pieces'][$piece]; |
|
84 | + if(array_key_exists($piece, self::$array['pieces'])) { |
|
85 | + return self::$array['pieces'][$piece]; |
|
86 | + } |
|
80 | 87 | return; |
81 | 88 | } |
82 | 89 |
@@ -24,10 +24,10 @@ |
||
24 | 24 | |
25 | 25 | self::$array['host'] = $host; |
26 | 26 | |
27 | - if ( |
|
28 | - $host == 'www.waterfallsofthekeweenaw.com' || |
|
29 | - $host == 'waterfallsofthekeweenaw.com' |
|
30 | - ) { |
|
27 | + if ( |
|
28 | + $host == 'www.waterfallsofthekeweenaw.com' || |
|
29 | + $host == 'waterfallsofthekeweenaw.com' |
|
30 | + ) { |
|
31 | 31 | self::$array['site'] = 'waterfalls'; |
32 | 32 | } else { |
33 | 33 | self::$array['site'] = substr($host, 0, strpos($host, '.')); |
@@ -69,6 +69,9 @@ |
||
69 | 69 | return substr($file, strrpos($file, '.') + 1);; |
70 | 70 | } |
71 | 71 | |
72 | + /** |
|
73 | + * @param integer $piece |
|
74 | + */ |
|
72 | 75 | static function getPiece($piece = null) |
73 | 76 | { |
74 | 77 | if(!$piece) |
@@ -5,56 +5,56 @@ |
||
5 | 5 | final class ImperialUnitContent extends Content |
6 | 6 | { |
7 | 7 | |
8 | - protected function execute($type = '') |
|
9 | - { |
|
10 | - $number = floatval($this->content); |
|
11 | - $number *= 39.37; // convert to inches |
|
8 | + protected function execute($type = '') |
|
9 | + { |
|
10 | + $number = floatval($this->content); |
|
11 | + $number *= 39.37; // convert to inches |
|
12 | 12 | |
13 | - if ($type == '') { |
|
14 | - if ($number > (12 * 3 * 1760 * 5)) { |
|
15 | - $type = 'full miles'; |
|
16 | - } else if ($number > (12 * 3 * 1760 * .5)) { |
|
17 | - $type = 'tenth miles'; |
|
18 | - } else if ($number > (12 * 3 * 150)) { |
|
19 | - $type = 'yards'; |
|
20 | - } else if ($number > (12 * 10)) { |
|
21 | - $type = 'feet'; |
|
22 | - } else { |
|
23 | - $type = 'inches'; |
|
24 | - } |
|
25 | - } |
|
13 | + if ($type == '') { |
|
14 | + if ($number > (12 * 3 * 1760 * 5)) { |
|
15 | + $type = 'full miles'; |
|
16 | + } else if ($number > (12 * 3 * 1760 * .5)) { |
|
17 | + $type = 'tenth miles'; |
|
18 | + } else if ($number > (12 * 3 * 150)) { |
|
19 | + $type = 'yards'; |
|
20 | + } else if ($number > (12 * 10)) { |
|
21 | + $type = 'feet'; |
|
22 | + } else { |
|
23 | + $type = 'inches'; |
|
24 | + } |
|
25 | + } |
|
26 | 26 | |
27 | - switch ($type) { |
|
28 | - case 'full miles' : |
|
29 | - $this->content = number_format(round($number / (12 * 3 * 1760))) . ' miles'; |
|
30 | - break; |
|
31 | - case 'tenth miles' : |
|
32 | - $this->content = round($number / (12 * 3 * 1760), 1) . ' miles'; |
|
33 | - break; |
|
34 | - case 'yards' : |
|
35 | - $this->content = number_format(round($number / (12 * 3))) . ' yards'; |
|
36 | - break; |
|
37 | - case 'feet' : |
|
38 | - $this->content = number_format(round($number / 12)) . "'"; |
|
39 | - break; |
|
40 | - case 'inches' : |
|
41 | - $feet = floor($number / 12); |
|
27 | + switch ($type) { |
|
28 | + case 'full miles' : |
|
29 | + $this->content = number_format(round($number / (12 * 3 * 1760))) . ' miles'; |
|
30 | + break; |
|
31 | + case 'tenth miles' : |
|
32 | + $this->content = round($number / (12 * 3 * 1760), 1) . ' miles'; |
|
33 | + break; |
|
34 | + case 'yards' : |
|
35 | + $this->content = number_format(round($number / (12 * 3))) . ' yards'; |
|
36 | + break; |
|
37 | + case 'feet' : |
|
38 | + $this->content = number_format(round($number / 12)) . "'"; |
|
39 | + break; |
|
40 | + case 'inches' : |
|
41 | + $feet = floor($number / 12); |
|
42 | 42 | |
43 | - $inches = $number - $feet * 12; |
|
44 | - $inches = round($inches); |
|
43 | + $inches = $number - $feet * 12; |
|
44 | + $inches = round($inches); |
|
45 | 45 | |
46 | - if ($inches == 12) { |
|
47 | - $feet++; |
|
48 | - $inches = 0; |
|
49 | - } |
|
46 | + if ($inches == 12) { |
|
47 | + $feet++; |
|
48 | + $inches = 0; |
|
49 | + } |
|
50 | 50 | |
51 | - $this->content = ''; |
|
52 | - $this->content .= number_format($feet) . "'"; |
|
53 | - if (isset($inches) && $inches > 0) { |
|
54 | - $this->content .= " {$inches}\""; |
|
55 | - } |
|
56 | - break; |
|
57 | - } |
|
58 | - } |
|
51 | + $this->content = ''; |
|
52 | + $this->content .= number_format($feet) . "'"; |
|
53 | + if (isset($inches) && $inches > 0) { |
|
54 | + $this->content .= " {$inches}\""; |
|
55 | + } |
|
56 | + break; |
|
57 | + } |
|
58 | + } |
|
59 | 59 | |
60 | 60 | } |
61 | 61 | \ No newline at end of file |
@@ -44,9 +44,9 @@ |
||
44 | 44 | $width = $file_size[0]; |
45 | 45 | $description = $photo_result->description; |
46 | 46 | |
47 | - if ($description == '') { |
|
48 | - Debugger::logMessage("No description for {$category}/{$photo}"); |
|
49 | - } |
|
47 | + if ($description == '') { |
|
48 | + Debugger::logMessage("No description for {$category}/{$photo}"); |
|
49 | + } |
|
50 | 50 | |
51 | 51 | $domain = '/'; |
52 | 52 | if($is_absolute) |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | protected function execute($is_absolute = false, $size = 'medium') |
13 | 13 | { |
14 | 14 | preg_match_all(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $matches); |
15 | - foreach($matches[1] as $key => $match) |
|
15 | + foreach ($matches[1] as $key => $match) |
|
16 | 16 | { |
17 | 17 | $photo_content = $this->get_photo_content($match, $size, $is_absolute); |
18 | 18 | $this->content = str_replace($matches[0][$key], $photo_content, $this->content); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | Loader::load('collector', 'image/PhotoCollector'); |
39 | 39 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
40 | - if($photo_result == false) |
|
40 | + if ($photo_result == false) |
|
41 | 41 | return ''; |
42 | 42 | |
43 | 43 | $height = $file_size[1]; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | $domain = '/'; |
52 | - if($is_absolute) |
|
52 | + if ($is_absolute) |
|
53 | 53 | $domain = Loader::getRootUrl('blog'); |
54 | 54 | |
55 | 55 | return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description); |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | |
38 | 38 | Loader::load('collector', 'image/PhotoCollector'); |
39 | 39 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
40 | - if($photo_result == false) |
|
41 | - return ''; |
|
40 | + if($photo_result == false) { |
|
41 | + return ''; |
|
42 | + } |
|
42 | 43 | |
43 | 44 | $height = $file_size[1]; |
44 | 45 | $width = $file_size[0]; |
@@ -49,8 +50,9 @@ discard block |
||
49 | 50 | } |
50 | 51 | |
51 | 52 | $domain = '/'; |
52 | - if($is_absolute) |
|
53 | - $domain = Loader::getRootUrl('blog'); |
|
53 | + if($is_absolute) { |
|
54 | + $domain = Loader::getRootUrl('blog'); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description); |
56 | 58 | } |
@@ -10,61 +10,61 @@ |
||
10 | 10 | $previous_time = strtotime($this->content); |
11 | 11 | $current_time = time(); |
12 | 12 | |
13 | - if($current_time <= $previous_time) |
|
13 | + if ($current_time <= $previous_time) |
|
14 | 14 | $this->content = 'few seconds ago'; |
15 | - else if(($current_time - $previous_time) < 30) |
|
15 | + else if (($current_time - $previous_time) < 30) |
|
16 | 16 | $this->content = 'few seconds ago'; |
17 | - else if(($current_time - $previous_time) < 1.5 * 60) |
|
17 | + else if (($current_time - $previous_time) < 1.5 * 60) |
|
18 | 18 | $this->content = 'a minute ago'; |
19 | - else if(($current_time - $previous_time) < 4 * 60) |
|
19 | + else if (($current_time - $previous_time) < 4 * 60) |
|
20 | 20 | $this->content = 'few minutes ago'; |
21 | - else if(($current_time - $previous_time) < 7 * 60) |
|
21 | + else if (($current_time - $previous_time) < 7 * 60) |
|
22 | 22 | $this->content = 'five minutes ago'; |
23 | - else if(($current_time - $previous_time) < 12 * 60) |
|
23 | + else if (($current_time - $previous_time) < 12 * 60) |
|
24 | 24 | $this->content = 'ten minutes ago'; |
25 | - else if(($current_time - $previous_time) < 17 * 60) |
|
25 | + else if (($current_time - $previous_time) < 17 * 60) |
|
26 | 26 | $this->content = 'fifteen minutes ago'; |
27 | - else if(($current_time - $previous_time) < 22 * 60) |
|
27 | + else if (($current_time - $previous_time) < 22 * 60) |
|
28 | 28 | $this->content = 'twenty minutes ago'; |
29 | - else if(($current_time - $previous_time) < 37 * 60) |
|
29 | + else if (($current_time - $previous_time) < 37 * 60) |
|
30 | 30 | $this->content = 'half hour ago'; |
31 | - else if(($current_time - $previous_time) < 52 * 60) |
|
31 | + else if (($current_time - $previous_time) < 52 * 60) |
|
32 | 32 | $this->content = 'forty-five minutes ago'; |
33 | - else if(($current_time - $previous_time) < 1.5 * 60 * 60) |
|
33 | + else if (($current_time - $previous_time) < 1.5 * 60 * 60) |
|
34 | 34 | $this->content = 'an hour ago'; |
35 | - else if(($current_time - $previous_time) < 2.5 * 60 * 60) |
|
35 | + else if (($current_time - $previous_time) < 2.5 * 60 * 60) |
|
36 | 36 | $this->content = 'two hours ago'; |
37 | - else if(($current_time - $previous_time) < 3.5 * 60 * 60) |
|
37 | + else if (($current_time - $previous_time) < 3.5 * 60 * 60) |
|
38 | 38 | $this->content = 'three hours ago'; |
39 | - else if(($current_time - $previous_time) < 4.5 * 60 * 60) |
|
39 | + else if (($current_time - $previous_time) < 4.5 * 60 * 60) |
|
40 | 40 | $this->content = 'few hours ago'; |
41 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') |
|
41 | + else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') |
|
42 | 42 | $this->content = 'this afternoon'; |
43 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') |
|
43 | + else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') |
|
44 | 44 | $this->content = 'this morning'; |
45 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) |
|
45 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) |
|
46 | 46 | $this->content = 'yesterday evening'; |
47 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') |
|
47 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') |
|
48 | 48 | $this->content = 'yesterday afternoon'; |
49 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') |
|
49 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') |
|
50 | 50 | $this->content = 'yesterday morning'; |
51 | - else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) |
|
51 | + else if (($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) |
|
52 | 52 | $this->content = 'two days ago'; |
53 | - else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) |
|
53 | + else if (($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) |
|
54 | 54 | $this->content = 'three days ago'; |
55 | - else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) |
|
55 | + else if (($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) |
|
56 | 56 | $this->content = 'earlier this week'; |
57 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) |
|
57 | + else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) |
|
58 | 58 | $this->content = 'late last week'; |
59 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) |
|
59 | + else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) |
|
60 | 60 | $this->content = 'early last week'; |
61 | - else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) |
|
61 | + else if (($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) |
|
62 | 62 | $this->content = 'few weeks ago'; |
63 | - else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) |
|
63 | + else if (($current_time - $previous_time) < 1.25 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) |
|
64 | 64 | $this->content = 'earlier this month'; |
65 | - else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) |
|
65 | + else if (($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) |
|
66 | 66 | $this->content = 'last month'; |
67 | - else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) |
|
67 | + else if (($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) |
|
68 | 68 | $this->content = 'several months ago'; |
69 | 69 | else |
70 | 70 | $this->content = 'long ago'; |
@@ -10,64 +10,65 @@ |
||
10 | 10 | $previous_time = strtotime($this->content); |
11 | 11 | $current_time = time(); |
12 | 12 | |
13 | - if($current_time <= $previous_time) |
|
14 | - $this->content = 'few seconds ago'; |
|
15 | - else if(($current_time - $previous_time) < 30) |
|
16 | - $this->content = 'few seconds ago'; |
|
17 | - else if(($current_time - $previous_time) < 1.5 * 60) |
|
18 | - $this->content = 'a minute ago'; |
|
19 | - else if(($current_time - $previous_time) < 4 * 60) |
|
20 | - $this->content = 'few minutes ago'; |
|
21 | - else if(($current_time - $previous_time) < 7 * 60) |
|
22 | - $this->content = 'five minutes ago'; |
|
23 | - else if(($current_time - $previous_time) < 12 * 60) |
|
24 | - $this->content = 'ten minutes ago'; |
|
25 | - else if(($current_time - $previous_time) < 17 * 60) |
|
26 | - $this->content = 'fifteen minutes ago'; |
|
27 | - else if(($current_time - $previous_time) < 22 * 60) |
|
28 | - $this->content = 'twenty minutes ago'; |
|
29 | - else if(($current_time - $previous_time) < 37 * 60) |
|
30 | - $this->content = 'half hour ago'; |
|
31 | - else if(($current_time - $previous_time) < 52 * 60) |
|
32 | - $this->content = 'forty-five minutes ago'; |
|
33 | - else if(($current_time - $previous_time) < 1.5 * 60 * 60) |
|
34 | - $this->content = 'an hour ago'; |
|
35 | - else if(($current_time - $previous_time) < 2.5 * 60 * 60) |
|
36 | - $this->content = 'two hours ago'; |
|
37 | - else if(($current_time - $previous_time) < 3.5 * 60 * 60) |
|
38 | - $this->content = 'three hours ago'; |
|
39 | - else if(($current_time - $previous_time) < 4.5 * 60 * 60) |
|
40 | - $this->content = 'few hours ago'; |
|
41 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') |
|
42 | - $this->content = 'this afternoon'; |
|
43 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') |
|
44 | - $this->content = 'this morning'; |
|
45 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) |
|
46 | - $this->content = 'yesterday evening'; |
|
47 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') |
|
48 | - $this->content = 'yesterday afternoon'; |
|
49 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') |
|
50 | - $this->content = 'yesterday morning'; |
|
51 | - else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) |
|
52 | - $this->content = 'two days ago'; |
|
53 | - else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) |
|
54 | - $this->content = 'three days ago'; |
|
55 | - else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) |
|
56 | - $this->content = 'earlier this week'; |
|
57 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) |
|
58 | - $this->content = 'late last week'; |
|
59 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) |
|
60 | - $this->content = 'early last week'; |
|
61 | - else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) |
|
62 | - $this->content = 'few weeks ago'; |
|
63 | - else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) |
|
64 | - $this->content = 'earlier this month'; |
|
65 | - else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) |
|
66 | - $this->content = 'last month'; |
|
67 | - else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) |
|
68 | - $this->content = 'several months ago'; |
|
69 | - else |
|
70 | - $this->content = 'long ago'; |
|
13 | + if($current_time <= $previous_time) { |
|
14 | + $this->content = 'few seconds ago'; |
|
15 | + } else if(($current_time - $previous_time) < 30) { |
|
16 | + $this->content = 'few seconds ago'; |
|
17 | + } else if(($current_time - $previous_time) < 1.5 * 60) { |
|
18 | + $this->content = 'a minute ago'; |
|
19 | + } else if(($current_time - $previous_time) < 4 * 60) { |
|
20 | + $this->content = 'few minutes ago'; |
|
21 | + } else if(($current_time - $previous_time) < 7 * 60) { |
|
22 | + $this->content = 'five minutes ago'; |
|
23 | + } else if(($current_time - $previous_time) < 12 * 60) { |
|
24 | + $this->content = 'ten minutes ago'; |
|
25 | + } else if(($current_time - $previous_time) < 17 * 60) { |
|
26 | + $this->content = 'fifteen minutes ago'; |
|
27 | + } else if(($current_time - $previous_time) < 22 * 60) { |
|
28 | + $this->content = 'twenty minutes ago'; |
|
29 | + } else if(($current_time - $previous_time) < 37 * 60) { |
|
30 | + $this->content = 'half hour ago'; |
|
31 | + } else if(($current_time - $previous_time) < 52 * 60) { |
|
32 | + $this->content = 'forty-five minutes ago'; |
|
33 | + } else if(($current_time - $previous_time) < 1.5 * 60 * 60) { |
|
34 | + $this->content = 'an hour ago'; |
|
35 | + } else if(($current_time - $previous_time) < 2.5 * 60 * 60) { |
|
36 | + $this->content = 'two hours ago'; |
|
37 | + } else if(($current_time - $previous_time) < 3.5 * 60 * 60) { |
|
38 | + $this->content = 'three hours ago'; |
|
39 | + } else if(($current_time - $previous_time) < 4.5 * 60 * 60) { |
|
40 | + $this->content = 'few hours ago'; |
|
41 | + } else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') { |
|
42 | + $this->content = 'this afternoon'; |
|
43 | + } else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') { |
|
44 | + $this->content = 'this morning'; |
|
45 | + } else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) { |
|
46 | + $this->content = 'yesterday evening'; |
|
47 | + } else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') { |
|
48 | + $this->content = 'yesterday afternoon'; |
|
49 | + } else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') { |
|
50 | + $this->content = 'yesterday morning'; |
|
51 | + } else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) { |
|
52 | + $this->content = 'two days ago'; |
|
53 | + } else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) { |
|
54 | + $this->content = 'three days ago'; |
|
55 | + } else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) { |
|
56 | + $this->content = 'earlier this week'; |
|
57 | + } else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) { |
|
58 | + $this->content = 'late last week'; |
|
59 | + } else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) { |
|
60 | + $this->content = 'early last week'; |
|
61 | + } else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) { |
|
62 | + $this->content = 'few weeks ago'; |
|
63 | + } else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) { |
|
64 | + $this->content = 'earlier this month'; |
|
65 | + } else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) { |
|
66 | + $this->content = 'last month'; |
|
67 | + } else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) { |
|
68 | + $this->content = 'several months ago'; |
|
69 | + } else { |
|
70 | + $this->content = 'long ago'; |
|
71 | + } |
|
71 | 72 | } |
72 | 73 | |
73 | 74 | } |
74 | 75 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | protected function execute($is_absolute = false, $size = 'thumb') |
13 | 13 | { |
14 | - if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) |
|
14 | + if (preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) |
|
15 | 15 | $this->content = $this->get_thumb($match[1], $is_absolute, $size); |
16 | 16 | else |
17 | 17 | $this->content = self::$DEFAULT_RETURN; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | Loader::load('collector', 'image/PhotoCollector'); |
36 | 36 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
37 | - if($photo_result == false) |
|
37 | + if ($photo_result == false) |
|
38 | 38 | return ''; |
39 | 39 | |
40 | 40 | $height = $file_size[1]; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $description = $photo_result->description; |
43 | 43 | |
44 | 44 | $domain = '/'; |
45 | - if($is_absolute) |
|
45 | + if ($is_absolute) |
|
46 | 46 | $domain = Loader::getRootUrl(); |
47 | 47 | |
48 | 48 | return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description); |
@@ -11,10 +11,11 @@ discard block |
||
11 | 11 | |
12 | 12 | protected function execute($is_absolute = false, $size = 'thumb') |
13 | 13 | { |
14 | - if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) |
|
15 | - $this->content = $this->get_thumb($match[1], $is_absolute, $size); |
|
16 | - else |
|
17 | - $this->content = self::$DEFAULT_RETURN; |
|
14 | + if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) { |
|
15 | + $this->content = $this->get_thumb($match[1], $is_absolute, $size); |
|
16 | + } else { |
|
17 | + $this->content = self::$DEFAULT_RETURN; |
|
18 | + } |
|
18 | 19 | return; |
19 | 20 | } |
20 | 21 | |
@@ -34,16 +35,18 @@ discard block |
||
34 | 35 | |
35 | 36 | Loader::load('collector', 'image/PhotoCollector'); |
36 | 37 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
37 | - if($photo_result == false) |
|
38 | - return ''; |
|
38 | + if($photo_result == false) { |
|
39 | + return ''; |
|
40 | + } |
|
39 | 41 | |
40 | 42 | $height = $file_size[1]; |
41 | 43 | $width = $file_size[0]; |
42 | 44 | $description = $photo_result->description; |
43 | 45 | |
44 | 46 | $domain = '/'; |
45 | - if($is_absolute) |
|
46 | - $domain = Loader::getRootUrl(); |
|
47 | + if($is_absolute) { |
|
48 | + $domain = Loader::getRootUrl(); |
|
49 | + } |
|
47 | 50 | |
48 | 51 | return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description); |
49 | 52 | } |
@@ -22,13 +22,13 @@ |
||
22 | 22 | |
23 | 23 | public function activate() |
24 | 24 | { |
25 | - foreach($this->post_array as $post) |
|
25 | + foreach ($this->post_array as $post) |
|
26 | 26 | { |
27 | 27 | $blog_result = BlogCollector::getBlogByTitle($post->title); |
28 | - if($blog_result !== null) |
|
28 | + if ($blog_result !== null) |
|
29 | 29 | { |
30 | 30 | $comments = CommentCollector::getCommentCountForURL(2, $post->path); |
31 | - if($blog_result->comments != $comments) |
|
31 | + if ($blog_result->comments != $comments) |
|
32 | 32 | { |
33 | 33 | $query = sprintf(self::$UPDATE_COMMENTS_QUERY, $comments, $blog_result->id); |
34 | 34 | Database::execute($query); |
@@ -33,8 +33,7 @@ |
||
33 | 33 | $query = sprintf(self::$UPDATE_COMMENTS_QUERY, $comments, $blog_result->id); |
34 | 34 | Database::execute($query); |
35 | 35 | } |
36 | - } |
|
37 | - else |
|
36 | + } else |
|
38 | 37 | { |
39 | 38 | $title = Database::escape($post->title); |
40 | 39 | $category = Database::escape($post->category); |
@@ -13,23 +13,23 @@ discard block |
||
13 | 13 | |
14 | 14 | function __construct() |
15 | 15 | { |
16 | - if(Loader::isLive()) |
|
16 | + if (Loader::isLive()) |
|
17 | 17 | $handle[] = self::$live_root; |
18 | 18 | else |
19 | 19 | $handle[] = self::$test_root; |
20 | 20 | |
21 | 21 | $i = 0; |
22 | - while(isset($handle[$i])) |
|
22 | + while (isset($handle[$i])) |
|
23 | 23 | { |
24 | 24 | $path = $handle[$i]; |
25 | 25 | $fh = opendir($path); |
26 | - while(false !== ($file = readdir($fh))) |
|
26 | + while (false !== ($file = readdir($fh))) |
|
27 | 27 | { |
28 | - if($file != '.' && $file != '..') |
|
28 | + if ($file != '.' && $file != '..') |
|
29 | 29 | { |
30 | - if(is_dir("{$path}/{$file}")) |
|
30 | + if (is_dir("{$path}/{$file}")) |
|
31 | 31 | $handle[] = "{$path}/{$file}"; |
32 | - if($file == 'error.log') |
|
32 | + if ($file == 'error.log') |
|
33 | 33 | $this->error_files[] = "{$path}/{$file}"; |
34 | 34 | } |
35 | 35 | } |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | { |
43 | 43 | $message = ''; |
44 | 44 | |
45 | - if(count($this->error_files) > 0) |
|
45 | + if (count($this->error_files) > 0) |
|
46 | 46 | { |
47 | 47 | $message .= "Errors from flat-file logs.\n\n"; |
48 | - foreach($this->error_files as $error_file) |
|
48 | + foreach ($this->error_files as $error_file) |
|
49 | 49 | { |
50 | 50 | $contents = file_get_contents($error_file); |
51 | 51 | $message .= "{$error_file}\n{$contents}\n\n"; |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | $mail->setMessage($message); |
61 | 61 | $mail->send(); |
62 | 62 | |
63 | - if(count($this->error_files) > 0) |
|
63 | + if (count($this->error_files) > 0) |
|
64 | 64 | { |
65 | - foreach($this->error_files as $error_file) |
|
65 | + foreach ($this->error_files as $error_file) |
|
66 | 66 | { |
67 | 67 | // if(file_exists($error_file)) |
68 | 68 | // unlink($error_file); |
@@ -13,10 +13,11 @@ discard block |
||
13 | 13 | |
14 | 14 | function __construct() |
15 | 15 | { |
16 | - if(Loader::isLive()) |
|
17 | - $handle[] = self::$live_root; |
|
18 | - else |
|
19 | - $handle[] = self::$test_root; |
|
16 | + if(Loader::isLive()) { |
|
17 | + $handle[] = self::$live_root; |
|
18 | + } else { |
|
19 | + $handle[] = self::$test_root; |
|
20 | + } |
|
20 | 21 | |
21 | 22 | $i = 0; |
22 | 23 | while(isset($handle[$i])) |
@@ -27,10 +28,12 @@ discard block |
||
27 | 28 | { |
28 | 29 | if($file != '.' && $file != '..') |
29 | 30 | { |
30 | - if(is_dir("{$path}/{$file}")) |
|
31 | - $handle[] = "{$path}/{$file}"; |
|
32 | - if($file == 'error.log') |
|
33 | - $this->error_files[] = "{$path}/{$file}"; |
|
31 | + if(is_dir("{$path}/{$file}")) { |
|
32 | + $handle[] = "{$path}/{$file}"; |
|
33 | + } |
|
34 | + if($file == 'error.log') { |
|
35 | + $this->error_files[] = "{$path}/{$file}"; |
|
36 | + } |
|
34 | 37 | } |
35 | 38 | } |
36 | 39 | closedir($fh); |
@@ -50,9 +53,9 @@ discard block |
||
50 | 53 | $contents = file_get_contents($error_file); |
51 | 54 | $message .= "{$error_file}\n{$contents}\n\n"; |
52 | 55 | } |
53 | - } |
|
54 | - else |
|
55 | - $message = 'No errors found in the flat-files!'; |
|
56 | + } else { |
|
57 | + $message = 'No errors found in the flat-files!'; |
|
58 | + } |
|
56 | 59 | |
57 | 60 | $mail = new Mail(); |
58 | 61 | $mail->setToAddress('EMAIL', 'Jacob Emerick'); |