@@ -27,8 +27,9 @@ |
||
| 27 | 27 | protected function get_page_number() |
| 28 | 28 | {
|
| 29 | 29 | $page = URLDecode::getPiece(2); |
| 30 | - if(isset($page) && is_numeric($page)) |
|
| 31 | - return $page; |
|
| 30 | + if(isset($page) && is_numeric($page)) {
|
|
| 31 | + return $page; |
|
| 32 | + } |
|
| 32 | 33 | return 1; |
| 33 | 34 | } |
| 34 | 35 | |
@@ -29,8 +29,9 @@ |
||
| 29 | 29 | $path = URLDecode::getPiece(1); |
| 30 | 30 | $this->watercourse = WatercourseCollector::getByAlias($path); |
| 31 | 31 | |
| 32 | - if(!$this->watercourse) |
|
| 33 | - $this->eject(); |
|
| 32 | + if(!$this->watercourse) {
|
|
| 33 | + $this->eject(); |
|
| 34 | + } |
|
| 34 | 35 | |
| 35 | 36 | parent::__construct(); |
| 36 | 37 | } |
@@ -112,8 +112,9 @@ discard block |
||
| 112 | 112 | {
|
| 113 | 113 | $album = array(); |
| 114 | 114 | |
| 115 | - if($this->waterfall->album == 0) |
|
| 116 | - return $album; |
|
| 115 | + if($this->waterfall->album == 0) {
|
|
| 116 | + return $album; |
|
| 117 | + } |
|
| 117 | 118 | |
| 118 | 119 | $photo_list = AlbumCollector::getPhotoListForAlbum($this->waterfall->album); |
| 119 | 120 | foreach($photo_list as $photo) |
@@ -122,10 +123,11 @@ discard block |
||
| 122 | 123 | $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
| 123 | 124 | $photo_array['description'] = $photo->description; |
| 124 | 125 | |
| 125 | - if($photo->height < $photo->width) |
|
| 126 | - list($height, $width) = array(75, 100); |
|
| 127 | - else |
|
| 128 | - list($height, $width) = array(100, 75); |
|
| 126 | + if($photo->height < $photo->width) {
|
|
| 127 | + list($height, $width) = array(75, 100); |
|
| 128 | + } else {
|
|
| 129 | + list($height, $width) = array(100, 75); |
|
| 130 | + } |
|
| 129 | 131 | |
| 130 | 132 | $photo_array['image_node'] = sprintf( |
| 131 | 133 | self::$THUMB_IMAGE_NODE, |
@@ -26,16 +26,20 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function activate() |
| 28 | 28 | {
|
| 29 | - if(!Request::hasPost()) |
|
| 30 | - return false; |
|
| 31 | - if(!Request::getPost('submit') == 'Submit Comment')
|
|
| 32 | - return false; |
|
| 29 | + if(!Request::hasPost()) {
|
|
| 30 | + return false; |
|
| 31 | + } |
|
| 32 | + if(!Request::getPost('submit') == 'Submit Comment') {
|
|
| 33 | + return false; |
|
| 34 | + } |
|
| 33 | 35 | |
| 34 | 36 | $errors = $this->fetch_errors(); |
| 35 | - if(count($errors) > 0) |
|
| 36 | - return $errors; |
|
| 37 | - if(Request::getPost('catch') !== '')
|
|
| 38 | - return false; |
|
| 37 | + if(count($errors) > 0) {
|
|
| 38 | + return $errors; |
|
| 39 | + } |
|
| 40 | + if(Request::getPost('catch') !== '') {
|
|
| 41 | + return false; |
|
| 42 | + } |
|
| 39 | 43 | |
| 40 | 44 | $page_id = $this->save_comment_page(); |
| 41 | 45 | $commenter_id = $this->save_commenter(); |
@@ -50,18 +54,24 @@ discard block |
||
| 50 | 54 | private function fetch_errors() |
| 51 | 55 | {
|
| 52 | 56 | $errors = array(); |
| 53 | - if(!Validate::checkRequest('post', 'name', 'name'))
|
|
| 54 | - $errors['name'] = 'You must include a valid name'; |
|
| 55 | - if(!Validate::checkRequest('post', 'email', 'email'))
|
|
| 56 | - $errors['email'] = 'You must include a valid email'; |
|
| 57 | - if(Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url'))
|
|
| 58 | - $errors['website'] = 'Please enter a valid website'; |
|
| 59 | - if(!Validate::checkRequest('post', 'comment', 'string'))
|
|
| 60 | - $errors['comment'] = 'You must enter a comment'; |
|
| 61 | - if(Request::getPost('notify') && Request::getPost('notify') != 'check')
|
|
| 62 | - $errors['notify'] = 'You entered an invalid notify request'; |
|
| 63 | - if(Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer'))
|
|
| 64 | - $errors['reply'] = 'You entered an invalid reply request'; |
|
| 57 | + if(!Validate::checkRequest('post', 'name', 'name')) {
|
|
| 58 | + $errors['name'] = 'You must include a valid name'; |
|
| 59 | + } |
|
| 60 | + if(!Validate::checkRequest('post', 'email', 'email')) {
|
|
| 61 | + $errors['email'] = 'You must include a valid email'; |
|
| 62 | + } |
|
| 63 | + if(Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url')) {
|
|
| 64 | + $errors['website'] = 'Please enter a valid website'; |
|
| 65 | + } |
|
| 66 | + if(!Validate::checkRequest('post', 'comment', 'string')) {
|
|
| 67 | + $errors['comment'] = 'You must enter a comment'; |
|
| 68 | + } |
|
| 69 | + if(Request::getPost('notify') && Request::getPost('notify') != 'check') {
|
|
| 70 | + $errors['notify'] = 'You entered an invalid notify request'; |
|
| 71 | + } |
|
| 72 | + if(Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer')) {
|
|
| 73 | + $errors['reply'] = 'You entered an invalid reply request'; |
|
| 74 | + } |
|
| 65 | 75 | |
| 66 | 76 | return $errors; |
| 67 | 77 | } |
@@ -69,8 +79,9 @@ discard block |
||
| 69 | 79 | private function save_comment_page() |
| 70 | 80 | {
|
| 71 | 81 | $page_result = CommentCollector::getCommentPageByURL($this->path, $this->site); |
| 72 | - if($page_result !== null) |
|
| 73 | - return $page_result->id; |
|
| 82 | + if($page_result !== null) {
|
|
| 83 | + return $page_result->id; |
|
| 84 | + } |
|
| 74 | 85 | |
| 75 | 86 | $query = "INSERT INTO `jpemeric_comment`.`comment_page` (`site`, `path`) VALUES ('%d', '%s')";
|
| 76 | 87 | $query = sprintf($query, $this->site, $this->path); |
@@ -85,8 +96,9 @@ discard block |
||
| 85 | 96 | 'name' => Request::getPost('name'),
|
| 86 | 97 | 'email' => Request::getPost('email'));
|
| 87 | 98 | |
| 88 | - if(Request::getPost('website') != '')
|
|
| 89 | - $cookie_value['website'] = Request::getPost('website');
|
|
| 99 | + if(Request::getPost('website') != '') {
|
|
| 100 | + $cookie_value['website'] = Request::getPost('website');
|
|
| 101 | + } |
|
| 90 | 102 | |
| 91 | 103 | $cookie_value = json_encode($cookie_value); |
| 92 | 104 | |
@@ -95,8 +107,9 @@ discard block |
||
| 95 | 107 | ->save(); |
| 96 | 108 | |
| 97 | 109 | $commenter_result = CommentCollector::getCommenterByFields(Request::getPost('name'), Request::getPost('email'), Request::getPost('website'));
|
| 98 | - if($commenter_result !== null) |
|
| 99 | - return $commenter_result->id; |
|
| 110 | + if($commenter_result !== null) {
|
|
| 111 | + return $commenter_result->id; |
|
| 112 | + } |
|
| 100 | 113 | |
| 101 | 114 | $query = "INSERT INTO `jpemeric_comment`.`commenter` (`name`,`email`,`url`) VALUES ('%s','%s','%s')";
|
| 102 | 115 | |
@@ -112,8 +125,9 @@ discard block |
||
| 112 | 125 | private function save_comment() |
| 113 | 126 | {
|
| 114 | 127 | $comment_result = CommentCollector::getCommentByBody(Request::getPost('comment'));
|
| 115 | - if($comment_result !== null) |
|
| 116 | - return $comment_result->id; |
|
| 128 | + if($comment_result !== null) {
|
|
| 129 | + return $comment_result->id; |
|
| 130 | + } |
|
| 117 | 131 | |
| 118 | 132 | $query = "INSERT INTO `jpemeric_comment`.`comment` (`body`, `body_format`) VALUES ('%s', '%s')";
|
| 119 | 133 | |
@@ -133,8 +147,9 @@ discard block |
||
| 133 | 147 | $query = "INSERT INTO `jpemeric_comment`.`comment_meta` (`commenter`,`comment`,`reply`,`notify`,`comment_page`,`date`,`display`) VALUES ('%d','%d','%d','%d','%d','%s','%d')";
|
| 134 | 148 | |
| 135 | 149 | $reply = Database::escape(Request::getPost('type'));
|
| 136 | - if($reply == 'new') |
|
| 137 | - $reply = 0; |
|
| 150 | + if($reply == 'new') {
|
|
| 151 | + $reply = 0; |
|
| 152 | + } |
|
| 138 | 153 | // else check to make sure value is legit |
| 139 | 154 | |
| 140 | 155 | $notify = (Request::getPost('notify') == 'check') ? 1 : 0;
|
@@ -163,8 +178,9 @@ discard block |
||
| 163 | 178 | |
| 164 | 179 | foreach($notification_result as $notification_row) |
| 165 | 180 | {
|
| 166 | - if($notification_row->email == Request::getPost('email'))
|
|
| 167 | - continue; |
|
| 181 | + if($notification_row->email == Request::getPost('email')) {
|
|
| 182 | + continue; |
|
| 183 | + } |
|
| 168 | 184 | |
| 169 | 185 | $email_recipient_array[$notification_row->email] = array( |
| 170 | 186 | 'email' => $notification_row->email, |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | Loader::load('utility', 'Content');
|
| 59 | 59 | $uri = Content::instance('URLSafe', "/{$post->category}/{$post->title_url}/")->activate();
|
| 60 | - } |
|
| 61 | - else |
|
| 60 | + } else |
|
| 62 | 61 | {
|
| 63 | 62 | $post_uri = URLDecode::getPiece(1); |
| 64 | 63 | if($post_uri !== null) |
@@ -19,24 +19,33 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | private static function get_router_name() |
| 21 | 21 | {
|
| 22 | - if(Request::isAJAX()) |
|
| 23 | - return 'AJAXRouter'; |
|
| 24 | - if(URLDecode::getURI() == '/robots.txt') |
|
| 25 | - return 'RobotRouter'; |
|
| 26 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
| 27 | - return 'SitemapRouter'; |
|
| 28 | - if(URLDecode::getURI() == '/rss/') |
|
| 29 | - return 'RSSRouter'; |
|
| 30 | - if(URLDecode::getExtension() == 'css') |
|
| 31 | - return 'StyleRouter'; |
|
| 32 | - if(URLDecode::getExtension() == 'js') |
|
| 33 | - return 'ScriptRouter'; |
|
| 34 | - if(URLDecode::getExtension() == 'ico') |
|
| 35 | - return 'ImageRouter'; |
|
| 36 | - if(URLDecode::getExtension() == 'jpg') |
|
| 37 | - return 'ImageRouter'; |
|
| 38 | - if(URLDecode::getExtension() == 'png') |
|
| 39 | - return 'ImageRouter'; |
|
| 22 | + if(Request::isAJAX()) {
|
|
| 23 | + return 'AJAXRouter'; |
|
| 24 | + } |
|
| 25 | + if(URLDecode::getURI() == '/robots.txt') {
|
|
| 26 | + return 'RobotRouter'; |
|
| 27 | + } |
|
| 28 | + if(URLDecode::getURI() == '/sitemap.xml') {
|
|
| 29 | + return 'SitemapRouter'; |
|
| 30 | + } |
|
| 31 | + if(URLDecode::getURI() == '/rss/') {
|
|
| 32 | + return 'RSSRouter'; |
|
| 33 | + } |
|
| 34 | + if(URLDecode::getExtension() == 'css') {
|
|
| 35 | + return 'StyleRouter'; |
|
| 36 | + } |
|
| 37 | + if(URLDecode::getExtension() == 'js') {
|
|
| 38 | + return 'ScriptRouter'; |
|
| 39 | + } |
|
| 40 | + if(URLDecode::getExtension() == 'ico') {
|
|
| 41 | + return 'ImageRouter'; |
|
| 42 | + } |
|
| 43 | + if(URLDecode::getExtension() == 'jpg') {
|
|
| 44 | + return 'ImageRouter'; |
|
| 45 | + } |
|
| 46 | + if(URLDecode::getExtension() == 'png') {
|
|
| 47 | + return 'ImageRouter'; |
|
| 48 | + } |
|
| 40 | 49 | |
| 41 | 50 | switch(URLDecode::getSite()) |
| 42 | 51 | {
|
@@ -93,19 +102,22 @@ discard block |
||
| 93 | 102 | |
| 94 | 103 | $redirect_uri = $this->check_for_special_redirect($redirect_uri); |
| 95 | 104 | |
| 96 | - if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
| 97 | - $redirect_uri .= '/'; |
|
| 105 | + if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') {
|
|
| 106 | + $redirect_uri .= '/'; |
|
| 107 | + } |
|
| 98 | 108 | |
| 99 | 109 | if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') {
|
| 100 | 110 | $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
| 101 | 111 | } |
| 102 | 112 | |
| 103 | - if($redirect_uri == URLDecode::getURI()) |
|
| 104 | - return; |
|
| 113 | + if($redirect_uri == URLDecode::getURI()) {
|
|
| 114 | + return; |
|
| 115 | + } |
|
| 105 | 116 | |
| 106 | 117 | $controller_check = $redirect_uri; |
| 107 | - if(substr($redirect_uri, 0, 4) == 'http') |
|
| 108 | - $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri);
|
|
| 118 | + if(substr($redirect_uri, 0, 4) == 'http') {
|
|
| 119 | + $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri);
|
|
| 120 | + } |
|
| 109 | 121 | |
| 110 | 122 | $controller = $this->get_controller($controller_check); |
| 111 | 123 | if($controller == '/Error404Controller') |
@@ -154,11 +166,13 @@ discard block |
||
| 154 | 166 | {
|
| 155 | 167 | foreach($this->get_direct_array() as $check) |
| 156 | 168 | {
|
| 157 | - if($uri == $check->match) |
|
| 158 | - return "{$this->get_primary_folder()}/{$check->controller}";
|
|
| 169 | + if($uri == $check->match) {
|
|
| 170 | + return "{$this->get_primary_folder()}/{$check->controller}";
|
|
| 171 | + } |
|
| 159 | 172 | |
| 160 | - if(preg_match("@^{$check->match}$@", $uri))
|
|
| 161 | - return "{$this->get_primary_folder()}/{$check->controller}";
|
|
| 173 | + if(preg_match("@^{$check->match}$@", $uri)) {
|
|
| 174 | + return "{$this->get_primary_folder()}/{$check->controller}";
|
|
| 175 | + } |
|
| 162 | 176 | } |
| 163 | 177 | |
| 164 | 178 | return '/Error404Controller'; |
@@ -166,23 +180,30 @@ discard block |
||
| 166 | 180 | |
| 167 | 181 | final private function get_primary_folder() |
| 168 | 182 | {
|
| 169 | - if(Request::isAjax()) |
|
| 170 | - return 'ajax'; |
|
| 171 | - if(URLDecode::getURI() == '/robots.txt') |
|
| 172 | - return 'robot'; |
|
| 173 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
| 174 | - return 'sitemap'; |
|
| 175 | - if(URLDecode::getURI() == '/rss/') |
|
| 176 | - return 'rss'; |
|
| 177 | - if(URLDecode::getExtension() == 'css') |
|
| 178 | - return 'styles'; |
|
| 179 | - if(URLDecode::getExtension() == 'js') |
|
| 180 | - return 'scripts'; |
|
| 183 | + if(Request::isAjax()) {
|
|
| 184 | + return 'ajax'; |
|
| 185 | + } |
|
| 186 | + if(URLDecode::getURI() == '/robots.txt') {
|
|
| 187 | + return 'robot'; |
|
| 188 | + } |
|
| 189 | + if(URLDecode::getURI() == '/sitemap.xml') {
|
|
| 190 | + return 'sitemap'; |
|
| 191 | + } |
|
| 192 | + if(URLDecode::getURI() == '/rss/') {
|
|
| 193 | + return 'rss'; |
|
| 194 | + } |
|
| 195 | + if(URLDecode::getExtension() == 'css') {
|
|
| 196 | + return 'styles'; |
|
| 197 | + } |
|
| 198 | + if(URLDecode::getExtension() == 'js') {
|
|
| 199 | + return 'scripts'; |
|
| 200 | + } |
|
| 181 | 201 | if( |
| 182 | 202 | URLDecode::getExtension() == 'jpg' || |
| 183 | 203 | URLDecode::getExtension() == 'ico' || |
| 184 | - URLDecode::getExtension() == 'png') |
|
| 185 | - return 'images'; |
|
| 204 | + URLDecode::getExtension() == 'png') {
|
|
| 205 | + return 'images'; |
|
| 206 | + } |
|
| 186 | 207 | |
| 187 | 208 | return URLDecode::getSite(); |
| 188 | 209 | } |
@@ -103,12 +103,13 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | private static function process_complex_pieces($type, $array) |
| 105 | 105 | {
|
| 106 | - if(in_array(404, $array)) |
|
| 107 | - $site = '404'; |
|
| 108 | - else if(in_array(503, $array)) |
|
| 109 | - $site = '503'; |
|
| 110 | - else |
|
| 111 | - $site = strtolower(URLDecode::getSite()); |
|
| 106 | + if(in_array(404, $array)) {
|
|
| 107 | + $site = '404'; |
|
| 108 | + } else if(in_array(503, $array)) {
|
|
| 109 | + $site = '503'; |
|
| 110 | + } else {
|
|
| 111 | + $site = strtolower(URLDecode::getSite()); |
|
| 112 | + } |
|
| 112 | 113 | |
| 113 | 114 | $final_path = self::get_final_path($type, $site); |
| 114 | 115 | |
@@ -133,11 +134,13 @@ discard block |
||
| 133 | 134 | {
|
| 134 | 135 | $piece_path = self::get_piece_path($type, $file); |
| 135 | 136 | $contents .= file_get_contents($piece_path); |
| 136 | - if(filemtime($final_path) < filemtime($piece_path)) |
|
| 137 | - $create_new = true; |
|
| 137 | + if(filemtime($final_path) < filemtime($piece_path)) {
|
|
| 138 | + $create_new = true; |
|
| 139 | + } |
|
| 140 | + } |
|
| 141 | + if($create_new) {
|
|
| 142 | + return self::make_final_file($type, $contents, $file_name, true); |
|
| 138 | 143 | } |
| 139 | - if($create_new) |
|
| 140 | - return self::make_final_file($type, $contents, $file_name, true); |
|
| 141 | 144 | |
| 142 | 145 | return self::get_final_link($type, $file_name); |
| 143 | 146 | } |
@@ -147,8 +150,9 @@ discard block |
||
| 147 | 150 | $path = Loader::getRoot() . "/{$type}/final/{$file}*";
|
| 148 | 151 | |
| 149 | 152 | $files = glob($path); |
| 150 | - if(count($files) > 0) |
|
| 151 | - return $files[0]; |
|
| 153 | + if(count($files) > 0) {
|
|
| 154 | + return $files[0]; |
|
| 155 | + } |
|
| 152 | 156 | return; |
| 153 | 157 | } |
| 154 | 158 | |
@@ -157,8 +161,9 @@ discard block |
||
| 157 | 161 | $path = Loader::getRoot() . "/{$type}/piece/{$file}*";
|
| 158 | 162 | |
| 159 | 163 | $files = glob($path); |
| 160 | - if(count($files) > 0) |
|
| 161 | - return $files[0]; |
|
| 164 | + if(count($files) > 0) {
|
|
| 165 | + return $files[0]; |
|
| 166 | + } |
|
| 162 | 167 | return; |
| 163 | 168 | } |
| 164 | 169 | |
@@ -174,9 +179,9 @@ discard block |
||
| 174 | 179 | $version = substr($version, 2, strpos($version, '.') - 2); |
| 175 | 180 | $version++; |
| 176 | 181 | $file_name = substr($file_name, 0, strpos($file_name, '-v')); |
| 182 | + } else {
|
|
| 183 | + $version = 2; |
|
| 177 | 184 | } |
| 178 | - else |
|
| 179 | - $version = 2; |
|
| 180 | 185 | $file_name .= "-v{$version}";
|
| 181 | 186 | } |
| 182 | 187 | |
@@ -193,8 +198,9 @@ discard block |
||
| 193 | 198 | } |
| 194 | 199 | |
| 195 | 200 | file_put_contents($path, $contents); |
| 196 | - if($exists) |
|
| 197 | - unlink($old_file); |
|
| 201 | + if($exists) {
|
|
| 202 | + unlink($old_file); |
|
| 203 | + } |
|
| 198 | 204 | Debugger::logMessage("New {$type} file created - {$file_name}.");
|
| 199 | 205 | return self::get_final_link($type, $file_name); |
| 200 | 206 | } |
@@ -21,8 +21,9 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function setValue($value) |
| 23 | 23 | {
|
| 24 | - if(!$this->is_loaded) |
|
| 25 | - $this->load(); |
|
| 24 | + if(!$this->is_loaded) {
|
|
| 25 | + $this->load(); |
|
| 26 | + } |
|
| 26 | 27 | |
| 27 | 28 | $this->value = $value; |
| 28 | 29 | return $this; |
@@ -30,8 +31,9 @@ discard block |
||
| 30 | 31 | |
| 31 | 32 | public function getValue() |
| 32 | 33 | {
|
| 33 | - if(!$this->is_loaded) |
|
| 34 | - $this->load(); |
|
| 34 | + if(!$this->is_loaded) {
|
|
| 35 | + $this->load(); |
|
| 36 | + } |
|
| 35 | 37 | return $this->value; |
| 36 | 38 | } |
| 37 | 39 | |
@@ -42,24 +44,26 @@ discard block |
||
| 42 | 44 | |
| 43 | 45 | public function exists() |
| 44 | 46 | {
|
| 45 | - if(!$this->is_loaded) |
|
| 46 | - $this->load(); |
|
| 47 | + if(!$this->is_loaded) {
|
|
| 48 | + $this->load(); |
|
| 49 | + } |
|
| 47 | 50 | return $this->exists; |
| 48 | 51 | } |
| 49 | 52 | |
| 50 | 53 | private final function load() |
| 51 | 54 | {
|
| 52 | 55 | $name = $this->getName(); |
| 53 | - if(isset($_COOKIE[$name])) |
|
| 54 | - $value = $_COOKIE[$name]; |
|
| 56 | + if(isset($_COOKIE[$name])) {
|
|
| 57 | + $value = $_COOKIE[$name]; |
|
| 58 | + } |
|
| 55 | 59 | |
| 56 | 60 | if(isset($value)) |
| 57 | 61 | {
|
| 58 | 62 | $this->value = $value; |
| 59 | 63 | $this->exists = true; |
| 64 | + } else {
|
|
| 65 | + $this->exists = false; |
|
| 60 | 66 | } |
| 61 | - else |
|
| 62 | - $this->exists = false; |
|
| 63 | 67 | |
| 64 | 68 | $this->is_loaded = true; |
| 65 | 69 | } |
@@ -84,24 +88,29 @@ discard block |
||
| 84 | 88 | private final function check_values() |
| 85 | 89 | {
|
| 86 | 90 | $name = $this->getName(); |
| 87 | - if(empty($name) || strlen($name) < 1) |
|
| 88 | - return false; |
|
| 91 | + if(empty($name) || strlen($name) < 1) {
|
|
| 92 | + return false; |
|
| 93 | + } |
|
| 89 | 94 | |
| 90 | 95 | $value = $this->getValue(); |
| 91 | - if(!isset($value) || strlen($value) < 1) |
|
| 92 | - return false; |
|
| 96 | + if(!isset($value) || strlen($value) < 1) {
|
|
| 97 | + return false; |
|
| 98 | + } |
|
| 93 | 99 | |
| 94 | 100 | $expiration = $this->getExpiration(); |
| 95 | - if(!isset($expiration) || !is_int($expiration)) |
|
| 96 | - return false; |
|
| 101 | + if(!isset($expiration) || !is_int($expiration)) {
|
|
| 102 | + return false; |
|
| 103 | + } |
|
| 97 | 104 | |
| 98 | 105 | $domain = $this->getDomain(); |
| 99 | - if(!isset($domain) || strlen($domain) < 1) |
|
| 100 | - return false; |
|
| 106 | + if(!isset($domain) || strlen($domain) < 1) {
|
|
| 107 | + return false; |
|
| 108 | + } |
|
| 101 | 109 | |
| 102 | 110 | $path = $this->getPath(); |
| 103 | - if(!isset($path) || strlen($path) < 1) |
|
| 104 | - return false; |
|
| 111 | + if(!isset($path) || strlen($path) < 1) {
|
|
| 112 | + return false; |
|
| 113 | + } |
|
| 105 | 114 | |
| 106 | 115 | return true; |
| 107 | 116 | } |
@@ -26,7 +26,9 @@ discard block |
||
| 26 | 26 | {
|
| 27 | 27 | //if(!$this->time_to_run($frequency)) |
| 28 | 28 | // continue; |
| 29 | - if ($cron != 'TwitterCron') continue; |
|
| 29 | + if ($cron != 'TwitterCron') {
|
|
| 30 | + continue; |
|
| 31 | + } |
|
| 30 | 32 | |
| 31 | 33 | Loader::load('utility', "cron/{$cron}");
|
| 32 | 34 | $reflection = new ReflectionClass($cron); |
@@ -51,18 +53,21 @@ discard block |
||
| 51 | 53 | |
| 52 | 54 | foreach($time as $key => $value) |
| 53 | 55 | {
|
| 54 | - if($value == '*') |
|
| 55 | - continue; |
|
| 56 | + if($value == '*') {
|
|
| 57 | + continue; |
|
| 58 | + } |
|
| 56 | 59 | if(stristr($value, '/')) |
| 57 | 60 | {
|
| 58 | 61 | $value = substr($value, 2); |
| 59 | - if($cur[$key] % $value == 0) |
|
| 60 | - continue; |
|
| 61 | - else |
|
| 62 | - return; |
|
| 62 | + if($cur[$key] % $value == 0) {
|
|
| 63 | + continue; |
|
| 64 | + } else {
|
|
| 65 | + return; |
|
| 66 | + } |
|
| 67 | + } |
|
| 68 | + if($cur[$key] == $value) {
|
|
| 69 | + continue; |
|
| 63 | 70 | } |
| 64 | - if($cur[$key] == $value) |
|
| 65 | - continue; |
|
| 66 | 71 | return; |
| 67 | 72 | } |
| 68 | 73 | return true; |