@@ -38,6 +38,9 @@ |
||
| 38 | 38 | $this->entries[] = $entry; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $url |
|
| 43 | + */ |
|
| 41 | 44 | protected function disallow_for_all_robots($url = null) |
| 42 | 45 | {
|
| 43 | 46 | $entry = new stdclass(); |
@@ -18,6 +18,9 @@ discard block |
||
| 18 | 18 | Debugger::hide(); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | + /** |
|
| 22 | + * @param string $title |
|
| 23 | + */ |
|
| 21 | 24 | final protected function setTitle($title) |
| 22 | 25 | {
|
| 23 | 26 | $this->xml->channel->addChild('title', $title);
|
@@ -30,11 +33,17 @@ discard block |
||
| 30 | 33 | $this->xml->channel->addChild('link', $url);
|
| 31 | 34 | } |
| 32 | 35 | |
| 36 | + /** |
|
| 37 | + * @param string $description |
|
| 38 | + */ |
|
| 33 | 39 | final protected function setDescription($description) |
| 34 | 40 | {
|
| 35 | 41 | $this->xml->channel->addChild('description', $description);
|
| 36 | 42 | } |
| 37 | 43 | |
| 44 | + /** |
|
| 45 | + * @param string $url |
|
| 46 | + */ |
|
| 38 | 47 | final protected function setAtom($url) |
| 39 | 48 | {
|
| 40 | 49 | $atom = $this->xml->channel->addChild('link', '', 'http://www.w3.org/2005/Atom');
|
@@ -76,6 +85,9 @@ discard block |
||
| 76 | 85 | $this->xml->channel->addChild('ttl', $ttl);
|
| 77 | 86 | } |
| 78 | 87 | |
| 88 | + /** |
|
| 89 | + * @param string $pubDate |
|
| 90 | + */ |
|
| 79 | 91 | final protected function addItem($title, $link, $description, $category, $pubDate) |
| 80 | 92 | {
|
| 81 | 93 | $item = $this->xml->channel->addChild('item');
|
@@ -64,6 +64,9 @@ |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | + /** |
|
| 68 | + * @param string $changefreq |
|
| 69 | + */ |
|
| 67 | 70 | private function add_paginated_pages($posts, $base_url, $changefreq, $rank) |
| 68 | 71 | {
|
| 69 | 72 | switch($changefreq) |
@@ -133,6 +133,10 @@ |
||
| 133 | 133 | $this->addURL('about/', date('Y-01-01'), self::$ABOUT_PAGE_CHANGEFREQ, self::$ABOUT_PAGE_RANK);
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | + /** |
|
| 137 | + * @param integer $items_per_page |
|
| 138 | + * @param string $type |
|
| 139 | + */ |
|
| 136 | 140 | private function add_paginated_pages($count, $items_per_page, $base_url, $type) |
| 137 | 141 | {
|
| 138 | 142 | switch($type) {
|
@@ -79,6 +79,9 @@ discard block |
||
| 79 | 79 | return $final_files; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $type |
|
| 84 | + */ |
|
| 82 | 85 | private static function process_simple_pieces($type, $file) |
| 83 | 86 | {
|
| 84 | 87 | $piece_path = self::get_piece_path($type, $file); |
@@ -101,6 +104,9 @@ discard block |
||
| 101 | 104 | return self::get_final_link($type, $file_name); |
| 102 | 105 | } |
| 103 | 106 | |
| 107 | + /** |
|
| 108 | + * @param string $type |
|
| 109 | + */ |
|
| 104 | 110 | private static function process_complex_pieces($type, $array) |
| 105 | 111 | {
|
| 106 | 112 | if(in_array(404, $array)) |
@@ -152,6 +158,9 @@ discard block |
||
| 152 | 158 | return; |
| 153 | 159 | } |
| 154 | 160 | |
| 161 | + /** |
|
| 162 | + * @return string |
|
| 163 | + */ |
|
| 155 | 164 | private static function get_piece_path($type, $file) |
| 156 | 165 | {
|
| 157 | 166 | $path = Loader::getRoot() . "/{$type}/piece/{$file}*";
|
@@ -162,6 +171,9 @@ discard block |
||
| 162 | 171 | return; |
| 163 | 172 | } |
| 164 | 173 | |
| 174 | + /** |
|
| 175 | + * @param string $contents |
|
| 176 | + */ |
|
| 165 | 177 | private static function make_final_file($type, $contents, $file_name, $exists = false) |
| 166 | 178 | {
|
| 167 | 179 | if($exists) |
@@ -213,6 +225,9 @@ discard block |
||
| 213 | 225 | return $path; |
| 214 | 226 | } |
| 215 | 227 | |
| 228 | + /** |
|
| 229 | + * @param string $type |
|
| 230 | + */ |
|
| 216 | 231 | public static function getLastModified($type, $file) |
| 217 | 232 | {
|
| 218 | 233 | $final_path = self::get_final_path($type, $file); |
@@ -37,6 +37,9 @@ discard block |
||
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | + /** |
|
| 41 | + * @param string[] $match |
|
| 42 | + */ |
|
| 40 | 43 | private function get_display_url($match) |
| 41 | 44 | {
|
| 42 | 45 | $display_url = $this->check_for_redirect($match[0]); |
@@ -67,6 +70,9 @@ discard block |
||
| 67 | 70 | return $link; |
| 68 | 71 | } |
| 69 | 72 | |
| 73 | + /** |
|
| 74 | + * @return string |
|
| 75 | + */ |
|
| 70 | 76 | private function check_for_redirect($url) |
| 71 | 77 | {
|
| 72 | 78 | $headers = @get_headers($url); |
@@ -35,6 +35,10 @@ |
||
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | + /** |
|
| 39 | + * @param string $handle_link |
|
| 40 | + * @param string $handle_display |
|
| 41 | + */ |
|
| 38 | 42 | private function get_replacement_link($handle_link, $handle_display) |
| 39 | 43 | {
|
| 40 | 44 | return sprintf(self::$USER_LINK, $handle_link, $handle_display); |
@@ -36,6 +36,10 @@ discard block |
||
| 36 | 36 | $this->replace_element_patterns(); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $pattern |
|
| 41 | + * @param string $replace |
|
| 42 | + */ |
|
| 39 | 43 | private function process_element($pattern, $replace) |
| 40 | 44 | {
|
| 41 | 45 | $match_count = preg_match_all($pattern, $this->content, $matches, PREG_SET_ORDER); |
@@ -54,11 +58,17 @@ discard block |
||
| 54 | 58 | } |
| 55 | 59 | } |
| 56 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string|null $text |
|
| 63 | + */ |
|
| 57 | 64 | private function create_placeholder($text) |
| 58 | 65 | {
|
| 59 | 66 | return md5($text . rand()); |
| 60 | 67 | } |
| 61 | 68 | |
| 69 | + /** |
|
| 70 | + * @param string|null $text |
|
| 71 | + */ |
|
| 62 | 72 | private function create_full_match_pattern($text) |
| 63 | 73 | {
|
| 64 | 74 | $pattern = ''; |
@@ -75,6 +85,10 @@ discard block |
||
| 75 | 85 | $this->content = strip_tags($this->content); |
| 76 | 86 | } |
| 77 | 87 | |
| 88 | + /** |
|
| 89 | + * @param string $pattern |
|
| 90 | + * @param string $replace |
|
| 91 | + */ |
|
| 78 | 92 | private function link_unlinked_urls($pattern, $replace) |
| 79 | 93 | {
|
| 80 | 94 | $match_count = preg_match_all($pattern, $this->content, $matches, PREG_SET_ORDER); |
@@ -24,6 +24,11 @@ |
||
| 24 | 24 | return Loader::getImagePath('photo', $path);
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param string $string |
|
| 29 | + * @param boolean $is_absolute |
|
| 30 | + * @param string $size |
|
| 31 | + */ |
|
| 27 | 32 | private function get_thumb($string, $is_absolute, $size) |
| 28 | 33 | {
|
| 29 | 34 | list($category, $file_name) = explode('/', $string);
|