| @@ -7,6 +7,7 @@ module Docs · 6 unmodified lines |
| 7 | 7 | 'Cond' => 'pthreads', |
| 8 | 8 | 'CURL' => 'cURL', |
| 9 | 9 | 'Date' => 'Date/Time', |
| 10 | + 'Ds' => 'Data Structures', |
| 10 | 11 | 'ErrorException' => 'Predefined Exceptions', |
| 11 | 12 | 'Exception' => 'Predefined Exceptions', |
| 12 | 13 | 'Json' => 'JSON', |
| @@ -14,6 +15,7 @@ module Docs · 1 unmodified line |
| 14 | 15 | 'Mutex' => 'pthreads', |
| 15 | 16 | 'php_user_filter' => 'Stream', |
| 16 | 17 | 'Pool' => 'pthreads', |
| 18 | + 'QuickHash' => 'Quickhash', |
| 17 | 19 | 'Reflector' => 'Reflection', |
| 18 | 20 | 'Soap' => 'SOAP', |
| 19 | 21 | 'SplFile' => 'SPL/File', |
| @@ -24,6 +26,7 @@ module Docs · 4 unmodified lines |
| 24 | 26 | 'streamWrapper' => 'Stream', |
| 25 | 27 | 'Thread' => 'pthreads', |
| 26 | 28 | 'tidy' => 'Tidy', |
| 29 | + 'Weak' => 'Weakref', |
| 27 | 30 | 'Worker' => 'pthreads', |
| 28 | 31 | 'XsltProcessor' => 'XSLT', |
| 29 | 32 | 'Yar' => 'Yar', |
| @@ -48,8 +51,10 @@ module Docs · 18 unmodified lines |
| 48 | 51 | end |
| 49 | 52 | |
| 50 | 53 | REPLACE_TYPES = { |
| 54 | + 'APCu' => 'APC', |
| 51 | 55 | 'Error' => 'Errors', |
| 52 | 56 | 'Exceptions' => 'SPL/Exceptions', |
| 57 | + 'Exif' => 'Image/Exif', |
| 53 | 58 | 'finfo' => 'File System', |
| 54 | 59 | 'GD and Image' => 'Image', |
| 55 | 60 | 'Gmagick' => 'Image/GraphicsMagick', |
| @@ -74,7 +79,7 @@ module Docs · 18 unmodified lines |
| 74 | 79 | 'Database' => ['DBA', 'ODBC', 'PDO'], |
| 75 | 80 | 'Date and Time' => ['Calendar', 'Date/Time'], |
| 76 | 81 | 'Errors' => ['Error Handling', 'Predefined Exceptions'], |
| 77 | | − 'File System' => ['Directory', 'Fileinfo', 'Filesystem', 'Inotify'], |
| 82 | + 'File System' => ['Directory', 'Fileinfo', 'Filesystem', 'Inotify', 'Proctitle'], |
| 78 | 83 | 'HTML' => ['DOM', 'Tidy'], |
| 79 | 84 | 'Language' => ['Control Structures', 'Misc.', 'PHP Options/Info', 'Predefined Variables'], |
| 80 | 85 | 'Mail' => ['Mail', 'Mailparse'], |
| @@ -116,6 +121,47 @@ module Docs · 35 unmodified lines |
| 116 | 121 | REPLACE_TYPES[type] || type |
| 117 | 122 | end |
| 118 | 123 | |
| 124 | + ALIASES = { |
| 125 | + 'language.oop5.traits' => ['trait'], |
| 126 | + 'language.operators.type' => ['instanceof'], |
| 127 | + 'functions.user-defined' => ['function'], |
| 128 | + 'language.oop5.visibility' => ['public', 'private', 'protected'], |
| 129 | + 'language.references.whatdo' => ['=&'], |
| 130 | + 'language.oop5.static' => ['static'], |
| 131 | + 'language.oop5.interfaces' => ['interface', 'implements'], |
| 132 | + 'language.oop5.inheritance' => ['extends'], |
| 133 | + 'language.oop5.cloning' => ['clone', '__clone()'], |
| 134 | + 'language.operators.logical' => ['and', 'or', 'xor'], |
| 135 | + 'language.operators.increment' => ['++', '--'], |
| 136 | + 'language.generators.syntax' => ['yield'], |
| 137 | + 'language.oop5.final' => ['final'], |
| 138 | + 'language.exceptions' => ['try', 'catch', 'finally'], |
| 139 | + 'language.oop5.decon' => ['__construct()', '__destruct()'], |
| 140 | + 'language.operators.comparison' => ['==', '===', '!=', '<>', '!==', '<=>'], |
| 141 | + 'language.oop5.abstract' => ['abstract'], |
| 142 | + 'language.operators.bitwise' => ['&', '|', '^', '~', '<<', '>>'] |
| 143 | + } |
| 144 | + |
| 145 | + def additional_entries |
| 146 | + if aliases = ALIASES[slug] |
| 147 | + aliases.map { |a| [a] } |
| 148 | + elsif slug == 'language.constants.predefined' |
| 149 | + css('table tr[id]').map do |node| |
| 150 | + [node.at_css('code').content, node['id']] |
| 151 | + end |
| 152 | + elsif slug == 'language.oop5.magic' |
| 153 | + css('h3 a').map do |node| |
| 154 | + [node.content, node['href'][/#(.+)/, 1]] |
| 155 | + end |
| 156 | + elsif slug == 'language.oop5.overloading' |
| 157 | + css('.methodsynopsis[id]').map do |node| |
| 158 | + [node.at_css('.methodname').content + '()', node['id']] |
| 159 | + end |
| 160 | + else |
| 161 | + [] |
| 162 | + end |
| 163 | + end |
| 164 | + |
| 119 | 165 | def include_default_entry? |
| 120 | 166 | !initial_page? && doc.at_css('.reference', '.refentry', '.sect1', '.simpara', '.para') |
| 121 | 167 | end |